summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-02-08 00:20:49 +0000
committerJuergen Ributzka <juergen@apple.com>2014-02-08 00:20:49 +0000
commit6f1819f2e6465d9a29b25b49a4d60864e50946f6 (patch)
treea684277e9ce60fdf862d5b0771d1efaf1b403bea /test
parent1368e659d7f5f5b1f87268a9a4c8265b29879320 (diff)
downloadllvm-6f1819f2e6465d9a29b25b49a4d60864e50946f6.tar.gz
llvm-6f1819f2e6465d9a29b25b49a4d60864e50946f6.tar.bz2
llvm-6f1819f2e6465d9a29b25b49a4d60864e50946f6.tar.xz
[Constant Hoisting] Fix insertion point for constant materialization.
The bitcast instruction during constant materialization was not placed correcly in the presence of phi nodes. This commit fixes the insertion point to be in the idom instead. This fixes PR18768 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/ConstantHoisting/X86/phi.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/ConstantHoisting/X86/phi.ll b/test/Transforms/ConstantHoisting/X86/phi.ll
index abbba81654..cc2fdda40e 100644
--- a/test/Transforms/ConstantHoisting/X86/phi.ll
+++ b/test/Transforms/ConstantHoisting/X86/phi.ll
@@ -46,3 +46,25 @@ return:
}
declare void @foo(i8*)
+
+; PR18768
+define i32 @test3(i1 %c) {
+entry:
+ br i1 %c, label %if.then, label %if.end3
+
+if.then: ; preds = %entry
+ br label %if.end3
+
+if.end3: ; preds = %if.then, %entry
+ %d.0 = phi i32* [ inttoptr (i64 985162435264511 to i32*), %entry ], [ null, %if.then ]
+ %cmp4 = icmp eq i32* %d.0, inttoptr (i64 985162435264511 to i32*)
+ %cmp6 = icmp eq i32* %d.0, inttoptr (i64 985162418487296 to i32*)
+ %or = or i1 %cmp4, %cmp6
+ br i1 %or, label %if.then8, label %if.end9
+
+if.then8: ; preds = %if.end3
+ ret i32 1
+
+if.end9: ; preds = %if.then8, %if.end3
+ ret i32 undef
+}