[llvm-commits] [llvm] r139088 - /llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Bill Wendling isanbard at gmail.com
Sun Sep 4 02:02:18 PDT 2011


Author: void
Date: Sun Sep  4 04:02:18 2011
New Revision: 139088

URL: http://llvm.org/viewvc/llvm-project?rev=139088&view=rev
Log:
The insertion point for the loads is right before the llvm.eh.exception
call. The call may be in the same BB as the landingpad instruction. If that's
the case, then inserting the loads after the landingpad inst, but before the
extractvalues, causes undefined behavior.

Modified:
    llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=139088&r1=139087&r2=139088&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Sun Sep  4 04:02:18 2011
@@ -487,7 +487,7 @@
     std::pair<Value*,Value*> ExnSelSlots = FnToLPadSlotMap[Parent->getParent()];
 
     IRBuilder<> Builder(Context);
-    Builder.SetInsertPoint(Parent, Parent->getFirstInsertionPt());
+    Builder.SetInsertPoint(Parent, Exn);
     LoadInst *LPExn = Builder.CreateLoad(ExnSelSlots.first, "exn.load");
     LoadInst *LPSel = Builder.CreateLoad(ExnSelSlots.second, "sel.load");
 





More information about the llvm-commits mailing list