[llvm-commits] [llvm] r138651 - in /llvm/trunk: lib/Transforms/Scalar/IndVarSimplify.cpp test/Transforms/IndVarSimplify/crash.ll
Bill Wendling
isanbard at gmail.com
Fri Aug 26 13:40:15 PDT 2011
Author: void
Date: Fri Aug 26 15:40:15 2011
New Revision: 138651
URL: http://llvm.org/viewvc/llvm-project?rev=138651&view=rev
Log:
Don't sink landingpad instructions during ind-var simplification.
Modified:
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/trunk/test/Transforms/IndVarSimplify/crash.ll
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=138651&r1=138650&r2=138651&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 26 15:40:15 2011
@@ -1724,6 +1724,10 @@
if (isa<DbgInfoIntrinsic>(I))
continue;
+ // Skip landingpad instructions.
+ if (isa<LandingPadInst>(I))
+ continue;
+
// Don't sink static AllocaInsts out of the entry block, which would
// turn them into dynamic allocas!
if (AllocaInst *AI = dyn_cast<AllocaInst>(I))
Modified: llvm/trunk/test/Transforms/IndVarSimplify/crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/crash.ll?rev=138651&r1=138650&r2=138651&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/crash.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/crash.ll Fri Aug 26 15:40:15 2011
@@ -53,3 +53,35 @@
%2 = add nsw i32 %r.0, 1 ; <i32> [#uses=1]
br label %bb24
}
+
+; PR10770
+
+declare void @__go_panic() noreturn
+
+declare void @__go_undefer()
+
+declare i32 @__gccgo_personality_v0(i32, i64, i8*, i8*)
+
+define void @main.main() uwtable {
+entry:
+ invoke void @__go_panic() noreturn
+ to label %0 unwind label %"5.i"
+
+; <label>:0 ; preds = %entry
+ unreachable
+
+"3.i": ; preds = %"7.i", %"5.i"
+ invoke void @__go_undefer()
+ to label %main.f.exit unwind label %"7.i"
+
+"5.i": ; preds = %entry
+ %1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gccgo_personality_v0
+ catch i8* null
+ br label %"3.i"
+
+"7.i": ; preds = %"3.i"
+ br label %"3.i"
+
+main.f.exit: ; preds = %"3.i"
+ unreachable
+}
More information about the llvm-commits
mailing list