From: Bill Wendling Date: Wed, 17 Aug 2011 20:36:44 +0000 (+0000) Subject: Revert r137655. There is some question about whether the 'landingpad' X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c9b2a987a291434490fd5b3b6e98b9992916ece4;p=oota-llvm.git Revert r137655. There is some question about whether the 'landingpad' instruction should be marked as potentially reading and/or writing memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137863 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp index 9a7c50d7fa4..36fd598d13c 100644 --- a/lib/Analysis/LoopInfo.cpp +++ b/lib/Analysis/LoopInfo.cpp @@ -99,6 +99,9 @@ bool Loop::makeLoopInvariant(Instruction *I, bool &Changed, return false; if (I->mayReadFromMemory()) return false; + // The landingpad instruction is immobile. + if (isa(I)) + return false; // Determine the insertion point, unless one was given. if (!InsertPt) { BasicBlock *Preheader = getLoopPreheader(); diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 47e7dd4c220..838678b9fab 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -1418,7 +1418,8 @@ static bool TryToSinkInstruction(Instruction *I, BasicBlock *DestBlock) { assert(I->hasOneUse() && "Invariants didn't hold!"); // Cannot move control-flow-involving, volatile loads, vaarg, etc. - if (isa(I) || I->mayHaveSideEffects() || isa(I)) + if (isa(I) || isa(I) || I->mayHaveSideEffects() || + isa(I)) return false; // Do not sink alloca instructions out of the entry block. diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp index 863b098e8f8..f54cec11e2e 100644 --- a/lib/VMCore/Instruction.cpp +++ b/lib/VMCore/Instruction.cpp @@ -320,7 +320,6 @@ bool Instruction::mayReadFromMemory() const { case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory case Instruction::AtomicCmpXchg: case Instruction::AtomicRMW: - case Instruction::LandingPad: return true; case Instruction::Call: return !cast(this)->doesNotAccessMemory(); @@ -341,7 +340,6 @@ bool Instruction::mayWriteToMemory() const { case Instruction::VAArg: case Instruction::AtomicCmpXchg: case Instruction::AtomicRMW: - case Instruction::LandingPad: return true; case Instruction::Call: return !cast(this)->onlyReadsMemory();