mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Fix a bug in the safety analysis routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bc53e5e628
commit
3602549c3d
@ -69,6 +69,9 @@ static bool AnalyzeGlobal(Value *V, GlobalStatus &GS,
|
||||
if (isa<LoadInst>(I)) {
|
||||
GS.isLoaded = true;
|
||||
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
|
||||
// Don't allow a store OF the address, only stores TO the address.
|
||||
if (SI->getOperand(0) == V) return true;
|
||||
|
||||
// If this store is just storing the initializer into a global (i.e. not
|
||||
// changing the value), ignore it. For now we just handle direct
|
||||
// stores, no stores to fields of aggregates.
|
||||
@ -239,9 +242,6 @@ bool GlobalOpt::runOnModule(Module &M) {
|
||||
|
||||
++NumMarked;
|
||||
Changed = true;
|
||||
} else if (!GS.isNotSuitableForSRA &&
|
||||
!GV->getInitializer()->getType()->isFirstClassType()) {
|
||||
//std::cerr << "COULD SRA: " << *GV;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user