aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-15 06:06:15 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-15 06:06:15 +0000
commit9b5f8c0fe37cbd80bd32758b7a6cc12760b875be (patch)
treedfddfc3689f9e4965c67a6698eded488a1bb33a0 /test
parent5a38b357cb07c1a1e86b037c2eb90de02cbedefb (diff)
downloadexternal_llvm-9b5f8c0fe37cbd80bd32758b7a6cc12760b875be.zip
external_llvm-9b5f8c0fe37cbd80bd32758b7a6cc12760b875be.tar.gz
external_llvm-9b5f8c0fe37cbd80bd32758b7a6cc12760b875be.tar.bz2
Fix pr3571: If stride is a value defined by an instruction, make sure it dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/LoopStrengthReduce/pr3571.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Transforms/LoopStrengthReduce/pr3571.ll b/test/Transforms/LoopStrengthReduce/pr3571.ll
new file mode 100644
index 0000000..79fcdb1
--- /dev/null
+++ b/test/Transforms/LoopStrengthReduce/pr3571.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis
+; PR3571
+
+target triple = "i386-mingw32"
+define void @_ZNK18qdesigner_internal10TreeWidget12drawBranchesEP8QPainterRK5QRectRK11QModelIndex() nounwind {
+entry:
+ br label %_ZNK11QModelIndex7isValidEv.exit.i
+
+bb.i: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i
+ %indvar.next = add i32 %result.0.i, 1 ; <i32> [#uses=1]
+ br label %_ZNK11QModelIndex7isValidEv.exit.i
+
+_ZNK11QModelIndex7isValidEv.exit.i: ; preds = %bb.i, %entry
+ %result.0.i = phi i32 [ 0, %entry ], [ %indvar.next, %bb.i ] ; <i32> [#uses=2]
+ %0 = load i32** null, align 4 ; <%struct.QAbstractItemDelegate*> [#uses=0]
+ br i1 false, label %_ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit, label %bb.i
+
+_ZN18qdesigner_internalL5levelEP18QAbstractItemModelRK11QModelIndex.exit: ; preds = %_ZNK11QModelIndex7isValidEv.exit.i
+ %1 = call i32 @_ZNK9QTreeView11indentationEv(i32* null) nounwind ; <i32> [#uses=1]
+ %2 = mul i32 %1, %result.0.i ; <i32> [#uses=1]
+ %3 = add i32 %2, -2 ; <i32> [#uses=1]
+ %4 = add i32 %3, 0 ; <i32> [#uses=1]
+ store i32 %4, i32* null, align 8
+ unreachable
+}
+
+declare i32 @_ZNK9QTreeView11indentationEv(i32*)