From 47e208bbeaa2cd45e999f41b07bb5618afb0152d Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 2 Sep 2011 22:41:11 +0000 Subject: [PATCH] Try to eliminate the use of the 'unwind' instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139046 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/Generic/2007-12-17-InvokeAsm.ll | 2 +- test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll | 2 +- test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll | 2 +- test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll | 2 +- test/Transforms/LCSSA/invoke-dest.ll | 8 ++++++++ test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll | 2 +- .../2009-01-19-UnconditionalTrappingConstantExpr.ll | 4 ++-- test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll | 2 +- test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll | 6 +++++- test/Transforms/SimplifyCFG/BrUnwind.ll | 2 +- test/Transforms/TailCallElim/dont_reorder_load.ll | 2 +- 11 files changed, 23 insertions(+), 11 deletions(-) diff --git a/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll b/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll index ed1d2f8b839..27c716222ef 100644 --- a/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll +++ b/test/CodeGen/Generic/2007-12-17-InvokeAsm.ll @@ -11,7 +11,7 @@ entry: cleanup144: ; preds = %entry %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 cleanup - unwind + resume { i8*, i32 } %exn } declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll b/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll index a6a41fd69ef..7ee0f468af0 100644 --- a/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll +++ b/test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll @@ -11,6 +11,6 @@ invoke_catch.0: ; No predecessors! br i1 false, label %UnifiedUnwindBlock, label %UnifiedReturnBlock UnifiedUnwindBlock: ; preds = %invoke_catch.0 - unwind + unreachable } diff --git a/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll b/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll index f4ecd42cefa..4ddc2f180a2 100644 --- a/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll +++ b/test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll @@ -21,7 +21,7 @@ invoke_catch.0: ; preds = %entry to label %tmp.1.i.i183.noexc unwind label %terminate tmp.1.i.i183.noexc: ; preds = %invoke_catch.0 - unwind + ret void then.0: ; preds = %tmp.3.i.noexc invoke void @_ZN10QByteArray6resizeEi( ) diff --git a/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll b/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll index 979157ebc8b..a5cfc3b9264 100644 --- a/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll +++ b/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll @@ -10,7 +10,7 @@ entry: r: ret i32 0 u: - unwind + unreachable } define i32 @caller() { diff --git a/test/Transforms/LCSSA/invoke-dest.ll b/test/Transforms/LCSSA/invoke-dest.ll index 454715089c3..22b320296af 100644 --- a/test/Transforms/LCSSA/invoke-dest.ll +++ b/test/Transforms/LCSSA/invoke-dest.ll @@ -110,12 +110,18 @@ bb106: ; preds = %invcont105, %bb61 to label %.noexc unwind label %lpad119 ; [#uses=1] lpad: ; preds = %_ZN7cObjectnwEj.exit + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup br label %Unwind lpad119: ; preds = %bb106, %invcont104, %invcont103, %bb102, %bb49, %bb34, %bb12, %invcont10, %invcont9, %bb8 + %exn119 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup unreachable lpad123: ; preds = %.noexc + %exn123 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup %tmp5 = icmp eq i8* %tmp4, null ; [#uses=1] br i1 %tmp5, label %Unwind, label %bb.i2 @@ -126,6 +132,8 @@ Unwind: ; preds = %bb.i2, %lpad123, %lpad unreachable } +declare i32 @__gxx_personality_v0(...) + declare void @_ZN8EtherBus8tokenizeEPKcRSt6vectorIdSaIdEE(i8* nocapture, i8*, i8*) declare i8* @_Znaj(i32) diff --git a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll index d63318d1c32..27d9d8f6741 100644 --- a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll @@ -461,7 +461,7 @@ cleanup329: ; preds = %cond_true319, %cond_true302, %cond_next293, %cond_true27 %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - unwind + resume { i8*, i32 } %val } declare void @_ZN6QSizeFC1Edd(%struct.QPointF*, double, double) diff --git a/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll b/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll index 33167bd5c66..568e61c6ac6 100644 --- a/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll +++ b/test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll @@ -15,7 +15,7 @@ bb2: ret i32 42 bb6: - unwind + ret i32 927 } define i32 @test2(i32 %tmp21, i32 %tmp24, i1 %tmp34) { @@ -26,6 +26,6 @@ bb5: ; preds = %bb4 bb6: ret i32 42 bb7: - unwind + ret i32 927 } diff --git a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll index 39cf3bb6d9b..abf4455d780 100644 --- a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll @@ -463,7 +463,7 @@ cleanup329: ; preds = %cond_true319, %cond_true302, %cond_next293, %cond_true27 %val329 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - unwind + resume { i8*, i32 } %val329 } declare void @_ZN6QSizeFC1Edd(%struct.QPointF*, double, double) diff --git a/test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll index ced89cf4c2b..7bffa1a8e0e 100644 --- a/test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll +++ b/test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll @@ -14,5 +14,9 @@ r: ; preds = %entry ret void u: ; preds = %entry - unwind + %val = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } %val } + +declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/SimplifyCFG/BrUnwind.ll b/test/Transforms/SimplifyCFG/BrUnwind.ll index b19a27dea04..7ab8faa2cea 100644 --- a/test/Transforms/SimplifyCFG/BrUnwind.ll +++ b/test/Transforms/SimplifyCFG/BrUnwind.ll @@ -10,6 +10,6 @@ B: ; preds = %0 call void @test( i1 %C ) br label %X X: ; preds = %B, %A - unwind + ret void } diff --git a/test/Transforms/TailCallElim/dont_reorder_load.ll b/test/Transforms/TailCallElim/dont_reorder_load.ll index cc273c3ca53..899e1159668 100644 --- a/test/Transforms/TailCallElim/dont_reorder_load.ll +++ b/test/Transforms/TailCallElim/dont_reorder_load.ll @@ -16,7 +16,7 @@ entry: br i1 %tmp2, label %if, label %else if: ; preds = %entry - unwind + ret i32 37 else: ; preds = %entry %tmp7 = add i32 %start_arg, 1 ; [#uses=1]