mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Allow readonly functions to unwind exceptions. Teach
the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -300,7 +300,7 @@ static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB,
|
||||
// Okay, everything after this looks good, check to make sure that this block
|
||||
// doesn't include any side effects.
|
||||
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
|
||||
if (I->mayWriteToMemory())
|
||||
if (I->mayHaveSideEffects())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -383,7 +383,7 @@ bool LoopUnswitch::IsTrivialUnswitchCondition(Value *Cond, Constant **Val,
|
||||
// part of the loop that the code *would* execute. We already checked the
|
||||
// tail, check the header now.
|
||||
for (BasicBlock::iterator I = Header->begin(), E = Header->end(); I != E; ++I)
|
||||
if (I->mayWriteToMemory())
|
||||
if (I->mayHaveSideEffects())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user