forked from OSchip/llvm-project
Revert r137655. There is some question about whether the 'landingpad'
instruction should be marked as potentially reading and/or writing memory. llvm-svn: 137863
This commit is contained in:
parent
e41124ade1
commit
a9ee09f4be
|
@ -99,6 +99,9 @@ bool Loop::makeLoopInvariant(Instruction *I, bool &Changed,
|
||||||
return false;
|
return false;
|
||||||
if (I->mayReadFromMemory())
|
if (I->mayReadFromMemory())
|
||||||
return false;
|
return false;
|
||||||
|
// The landingpad instruction is immobile.
|
||||||
|
if (isa<LandingPadInst>(I))
|
||||||
|
return false;
|
||||||
// Determine the insertion point, unless one was given.
|
// Determine the insertion point, unless one was given.
|
||||||
if (!InsertPt) {
|
if (!InsertPt) {
|
||||||
BasicBlock *Preheader = getLoopPreheader();
|
BasicBlock *Preheader = getLoopPreheader();
|
||||||
|
|
|
@ -1418,7 +1418,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) {
|
||||||
assert(I->hasOneUse() && "Invariants didn't hold!");
|
assert(I->hasOneUse() && "Invariants didn't hold!");
|
||||||
|
|
||||||
// Cannot move control-flow-involving, volatile loads, vaarg, etc.
|
// Cannot move control-flow-involving, volatile loads, vaarg, etc.
|
||||||
if (isa<PHINode>(I) || I->mayHaveSideEffects() || isa<TerminatorInst>(I))
|
if (isa<PHINode>(I) || isa<LandingPadInst>(I) || I->mayHaveSideEffects() ||
|
||||||
|
isa<TerminatorInst>(I))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Do not sink alloca instructions out of the entry block.
|
// Do not sink alloca instructions out of the entry block.
|
||||||
|
|
|
@ -320,7 +320,6 @@ bool Instruction::mayReadFromMemory() const {
|
||||||
case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
|
case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
|
||||||
case Instruction::AtomicCmpXchg:
|
case Instruction::AtomicCmpXchg:
|
||||||
case Instruction::AtomicRMW:
|
case Instruction::AtomicRMW:
|
||||||
case Instruction::LandingPad:
|
|
||||||
return true;
|
return true;
|
||||||
case Instruction::Call:
|
case Instruction::Call:
|
||||||
return !cast<CallInst>(this)->doesNotAccessMemory();
|
return !cast<CallInst>(this)->doesNotAccessMemory();
|
||||||
|
@ -341,7 +340,6 @@ bool Instruction::mayWriteToMemory() const {
|
||||||
case Instruction::VAArg:
|
case Instruction::VAArg:
|
||||||
case Instruction::AtomicCmpXchg:
|
case Instruction::AtomicCmpXchg:
|
||||||
case Instruction::AtomicRMW:
|
case Instruction::AtomicRMW:
|
||||||
case Instruction::LandingPad:
|
|
||||||
return true;
|
return true;
|
||||||
case Instruction::Call:
|
case Instruction::Call:
|
||||||
return !cast<CallInst>(this)->onlyReadsMemory();
|
return !cast<CallInst>(this)->onlyReadsMemory();
|
||||||
|
|
Loading…
Reference in New Issue