The landingpad instruction isn't loop-invariant.
authorBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:22:49 +0000 (18:22 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 15 Aug 2011 18:22:49 +0000 (18:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137628 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopInfo.cpp

index 9a7c50d7fa4492506069bf6534497b3806dfd8f6..36fd598d13c4cc19f657b9cd198ced7a1032f3d3 100644 (file)
@@ -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<LandingPadInst>(I))
+    return false;
   // Determine the insertion point, unless one was given.
   if (!InsertPt) {
     BasicBlock *Preheader = getLoopPreheader();