aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LoopUnswitch
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-09 18:18:18 +0000
committerDan Gohman <gohman@apple.com>2009-09-09 18:18:18 +0000
commitc292caf55c8f2794965542124d6571b5b59f0ba8 (patch)
treefdb55f31b4dff8436810adfd8aa0c81fd6f061e8 /test/Transforms/LoopUnswitch
parent17568251afb0cce65db9e99f594986e3e92debe1 (diff)
downloadexternal_llvm-c292caf55c8f2794965542124d6571b5b59f0ba8.zip
external_llvm-c292caf55c8f2794965542124d6571b5b59f0ba8.tar.gz
external_llvm-c292caf55c8f2794965542124d6571b5b59f0ba8.tar.bz2
Fix SplitCriticalEdge to properly update LCSSA form when splitting a
loop exit edge -- new PHIs may be needed not only for the additional splits that are made to preserve LoopSimplify form, but also for the original split. Factor out the code that inserts new PHIs so that it can be used for both. Remove LoopRotation.cpp's code for manually updating LCSSA form, as it is now redundant. This fixes PR4934. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopUnswitch')
-rw-r--r--test/Transforms/LoopUnswitch/preserve-analyses.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Transforms/LoopUnswitch/preserve-analyses.ll b/test/Transforms/LoopUnswitch/preserve-analyses.ll
index 1a0e9e6..8d3f138 100644
--- a/test/Transforms/LoopUnswitch/preserve-analyses.ll
+++ b/test/Transforms/LoopUnswitch/preserve-analyses.ll
@@ -93,3 +93,37 @@ bb6: ; preds = %bb2
return: ; preds = %bb8, %bb
ret void
}
+
+; This function requires special handling to preserve LCSSA form.
+; PR4934
+
+define void @pnp_check_irq() nounwind noredzone {
+entry:
+ %conv56 = trunc i64 undef to i32 ; <i32> [#uses=1]
+ br label %while.cond.i
+
+while.cond.i: ; preds = %while.cond.i.backedge, %entry
+ %call.i25 = call i8* @pci_get_device() nounwind noredzone ; <i8*> [#uses=2]
+ br i1 undef, label %if.then65, label %while.body.i
+
+while.body.i: ; preds = %while.cond.i
+ br i1 undef, label %if.then31.i.i, label %while.cond.i.backedge
+
+while.cond.i.backedge: ; preds = %if.then31.i.i, %while.body.i
+ br label %while.cond.i
+
+if.then31.i.i: ; preds = %while.body.i
+ switch i32 %conv56, label %while.cond.i.backedge [
+ i32 14, label %if.then42.i.i
+ i32 15, label %if.then42.i.i
+ ]
+
+if.then42.i.i: ; preds = %if.then31.i.i, %if.then31.i.i
+ %call.i25.lcssa48 = phi i8* [ %call.i25, %if.then31.i.i ], [ %call.i25, %if.then31.i.i ] ; <i8*> [#uses=0]
+ unreachable
+
+if.then65: ; preds = %while.cond.i
+ unreachable
+}
+
+declare i8* @pci_get_device() noredzone