summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitec4557f324a4264986f8544cf84c392bd26074c6 (patch)
treeccf99895d5b899b46d3d8ebb4b0bfc32b2a24fe4 /llvm/test/Transforms/LoopUnswitch
parent3cb19a156ded1e2fcc6f259c94bd7272ed2a1bef (diff)
downloadbcm5719-llvm-ec4557f324a4264986f8544cf84c392bd26074c6.tar.gz
bcm5719-llvm-ec4557f324a4264986f8544cf84c392bd26074c6.zip
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. llvm-svn: 81363
Diffstat (limited to 'llvm/test/Transforms/LoopUnswitch')
-rw-r--r--llvm/test/Transforms/LoopUnswitch/preserve-analyses.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopUnswitch/preserve-analyses.ll b/llvm/test/Transforms/LoopUnswitch/preserve-analyses.ll
index 1a0e9e6c879..8d3f1382f3c 100644
--- a/llvm/test/Transforms/LoopUnswitch/preserve-analyses.ll
+++ b/llvm/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
OpenPOWER on IntegriCloud