[llvm-commits] [llvm] r160693 - /llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Nick Lewycky nicholas at mxc.ca
Tue Jul 24 14:33:01 PDT 2012


Author: nicholas
Date: Tue Jul 24 16:33:00 2012
New Revision: 160693

URL: http://llvm.org/viewvc/llvm-project?rev=160693&view=rev
Log:
Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.

Modified:
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=160693&r1=160692&r2=160693&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Jul 24 16:33:00 2012
@@ -442,12 +442,14 @@
       Dead[i].second->eraseFromParent();
       Instruction *I = Dead[i].first;
       do {
+	if (isAllocationFn(I))
+	  break;
         Instruction *J = dyn_cast<Instruction>(I->getOperand(0));
         if (!J)
           break;
         I->eraseFromParent();
         I = J;
-      } while (!isAllocationFn(I));
+      } while (1);
       I->eraseFromParent();
     }
   }





More information about the llvm-commits mailing list