mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Make DSE only scan blocks that are reachable from the entry
block. Other blocks may have pointer cycles that will crash basicaa and other alias analyses. In any case, there is no point wasting cycles optimizing dead blocks. This fixes rdar://7635088 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95852 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -44,8 +44,14 @@ namespace {
|
||||
|
||||
virtual bool runOnFunction(Function &F) {
|
||||
bool Changed = false;
|
||||
|
||||
DominatorTree &DT = getAnalysis<DominatorTree>();
|
||||
|
||||
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
|
||||
Changed |= runOnBasicBlock(*I);
|
||||
// Only check non-dead blocks. Dead blocks may have strange pointer
|
||||
// cycles that will confuse alias analysis.
|
||||
if (DT.isReachableFromEntry(I))
|
||||
Changed |= runOnBasicBlock(*I);
|
||||
return Changed;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user