summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-06 22:12:13 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-06 22:12:13 +0000
commit7b7037563b12589e675c655e5d1e4f737f50fa9d (patch)
treebcb1a6c4ce979a6403646d9c586fc97862b38d8c /test
parent1d0164e7ac8d1e23680a2c5139ba7b38af5b31c3 (diff)
downloadexternal_llvm-7b7037563b12589e675c655e5d1e4f737f50fa9d.zip
external_llvm-7b7037563b12589e675c655e5d1e4f737f50fa9d.tar.gz
external_llvm-7b7037563b12589e675c655e5d1e4f737f50fa9d.tar.bz2
Merging r196611:
------------------------------------------------------------------------ r196611 | dexonsmith | 2013-12-06 13:48:36 -0800 (Fri, 06 Dec 2013) | 5 lines Don't use isNullValue to evaluate ConstantExpr ConstantExpr can evaluate to false even when isNullValue gives false. Fixes PR18143. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/phi-select-constexpr.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/phi-select-constexpr.ll b/test/Transforms/InstCombine/phi-select-constexpr.ll
new file mode 100644
index 0000000..054e069
--- /dev/null
+++ b/test/Transforms/InstCombine/phi-select-constexpr.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -S -instcombine | FileCheck %s
+@A = extern_weak global i32, align 4
+@B = extern_weak global i32, align 4
+
+define i32 @foo(i1 %which) {
+entry:
+ br i1 %which, label %final, label %delay
+
+delay:
+ br label %final
+
+; CHECK-LABEL: final:
+; CHECK: phi i32 [ 1, %entry ], [ select (i1 icmp eq (i32* @A, i32* @B), i32 2, i32 1), %delay ]
+final:
+ %use2 = phi i1 [ false, %entry ], [ icmp eq (i32* @A, i32* @B), %delay ]
+ %value = select i1 %use2, i32 2, i32 1
+ ret i32 %value
+}
+