write to memory.) Marking it as such makes some checks for immobility go away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137655
91177308-0d34-0410-b5e6-
96231b3b80d8
return false;
if (I->mayReadFromMemory())
return false;
return false;
if (I->mayReadFromMemory())
return false;
- // The landingpad instruction is immobile.
- if (isa<LandingPadInst>(I))
- return false;
// Determine the insertion point, unless one was given.
if (!InsertPt) {
BasicBlock *Preheader = getLoopPreheader();
// Determine the insertion point, unless one was given.
if (!InsertPt) {
BasicBlock *Preheader = getLoopPreheader();
static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
assert(I->hasOneUse() && "Invariants didn't hold!");
static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
assert(I->hasOneUse() && "Invariants didn't hold!");
- // Cannot move control-flow-involving, volatile loads, vaarg, landingpad, etc.
- if (isa<PHINode>(I) || isa<LandingPadInst>(I) || I->mayHaveSideEffects() ||
- isa<TerminatorInst>(I))
+ // Cannot move control-flow-involving, volatile loads, vaarg, etc.
+ if (isa<PHINode>(I) || I->mayHaveSideEffects() || isa<TerminatorInst>(I))
return false;
// Do not sink alloca instructions out of the entry block.
return false;
// Do not sink alloca instructions out of the entry block.
case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
+ case Instruction::LandingPad:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->doesNotAccessMemory();
return true;
case Instruction::Call:
return !cast<CallInst>(this)->doesNotAccessMemory();
case Instruction::VAArg:
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
case Instruction::VAArg:
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
+ case Instruction::LandingPad:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->onlyReadsMemory();
return true;
case Instruction::Call:
return !cast<CallInst>(this)->onlyReadsMemory();