Try to eliminate the use of the 'unwind' instruction.
authorBill Wendling <isanbard@gmail.com>
Fri, 2 Sep 2011 22:41:11 +0000 (22:41 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 2 Sep 2011 22:41:11 +0000 (22:41 +0000)
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
test/Transforms/ADCE/2004-05-04-UnreachableBlock.ll
test/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll
test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll
test/Transforms/LCSSA/invoke-dest.ll
test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll
test/Transforms/SimplifyCFG/2009-01-19-UnconditionalTrappingConstantExpr.ll
test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll
test/Transforms/SimplifyCFG/2010-03-30-InvokeCrash.ll
test/Transforms/SimplifyCFG/BrUnwind.ll
test/Transforms/TailCallElim/dont_reorder_load.ll

index ed1d2f8b839e458b0deb649350747672af46ac9e..27c716222ef8cc4ce7a63a0c90264727091882b3 100644 (file)
@@ -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(...)
index a6a41fd69effe9199ab7ca7eae70994be6721426..7ee0f468af0b92f59da690f7b5ac008de10930b5 100644 (file)
@@ -11,6 +11,6 @@ invoke_catch.0:         ; No predecessors!
         br i1 false, label %UnifiedUnwindBlock, label %UnifiedReturnBlock
 
 UnifiedUnwindBlock:             ; preds = %invoke_catch.0
-        unwind
+        unreachable
 }
 
index f4ecd42cefa44f174577e842b5f189cc783d2000..4ddc2f180a2d3e551572c678b30374fc06813fb6 100644 (file)
@@ -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( )
index 979157ebc8b4016a4306d3b22a5c57c7c499abab..a5cfc3b9264c4bee7a10e560f73013a0c8c5c14e 100644 (file)
@@ -10,7 +10,7 @@ entry:
 r:
        ret i32 0
 u:
-       unwind
+       unreachable
 }
 
 define i32 @caller() {
index 454715089c3b64af64948f757ed545715a301121..22b320296afd8861d4f7bc7bac5aa34898fd742e 100644 (file)
@@ -110,12 +110,18 @@ bb106:            ; preds = %invcont105, %bb61
                        to label %.noexc unwind label %lpad119          ; <i8*> [#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         ; <i1> [#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)
index d63318d1c32bdd5fb6c48d95e7de6a15f62f2f4e..27d9d8f674181b5e3f440d50c6ea5d1c83fcd790 100644 (file)
@@ -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)
index 33167bd5c661d1aa9d9ffdd62a3c1f6db0fde07b..568e61c6ac6de9fdc83d062a06ef3056583e1148 100644 (file)
@@ -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
 }
 
index 39cf3bb6d9b03d7736b71b5d40af9b995c919245..abf4455d780ba4008d7f25bf41b6a8b2b60b4ed7 100644 (file)
@@ -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)
index ced89cf4c2b310642232f6483dae1e509a94f1b4..7bffa1a8e0e2f7a90ed86b2dc71abd21ddd04673 100644 (file)
@@ -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(...)
index b19a27dea048d5155d15e44467afd2bbc7fdbda9..7ab8faa2cea9871de3d8f0c24564962bfcb4bc50 100644 (file)
@@ -10,6 +10,6 @@ B:              ; preds = %0
         call void @test( i1 %C )
         br label %X
 X:              ; preds = %B, %A
-        unwind
+        ret void
 }
 
index cc273c3ca53db2bf270bff5ce94704d49856518a..899e115966887eda2a78fd7af3bf22a11321b252 100644 (file)
@@ -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           ; <i32> [#uses=1]