mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Delete unread globals through addrspacecast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -297,8 +297,9 @@ static bool CleanupConstantGlobalUsers(Value *V, Constant *Init,
|
||||
if (Init)
|
||||
SubInit = ConstantFoldLoadThroughGEPConstantExpr(Init, CE);
|
||||
Changed |= CleanupConstantGlobalUsers(CE, SubInit, TD, TLI);
|
||||
} else if (CE->getOpcode() == Instruction::BitCast &&
|
||||
CE->getType()->isPointerTy()) {
|
||||
} else if ((CE->getOpcode() == Instruction::BitCast &&
|
||||
CE->getType()->isPointerTy()) ||
|
||||
CE->getOpcode() == Instruction::AddrSpaceCast) {
|
||||
// Pointer cast, delete any stores and memsets to the global.
|
||||
Changed |= CleanupConstantGlobalUsers(CE, 0, TD, TLI);
|
||||
}
|
||||
|
Reference in New Issue
Block a user