summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/implies.ll
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-10-06 19:00:02 +0000
committerPhilip Reames <listmail@philipreames.com>2015-10-06 19:00:02 +0000
commit600a91580f34589283e21b5947f7af28a019d31b (patch)
treebeaf866c0bf71589d9c965a6157b5e40f085ed07 /llvm/test/Transforms/InstSimplify/implies.ll
parent87bc41bcee2fa0183e78fe1d24cecf30487da163 (diff)
downloadbcm5719-llvm-600a91580f34589283e21b5947f7af28a019d31b.tar.gz
bcm5719-llvm-600a91580f34589283e21b5947f7af28a019d31b.zip
Fix pr25040 - Handle vectors of i1s in recently added implication code
As mentioned in the bug, I'd missed the presence of a getScalarType in the caller of the new implies method. As a result, when we ended up with a implication over two vectors, we'd trip an assert and crash. Differential Revision: http://reviews.llvm.org/D13441 llvm-svn: 249442
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/implies.ll')
-rw-r--r--llvm/test/Transforms/InstSimplify/implies.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/implies.ll b/llvm/test/Transforms/InstSimplify/implies.ll
index 19e61930d75..80b6ac810d0 100644
--- a/llvm/test/Transforms/InstSimplify/implies.ll
+++ b/llvm/test/Transforms/InstSimplify/implies.ll
@@ -75,3 +75,19 @@ define i1 @test4(i32 %length.i, i32 %i) {
%res = icmp ule i1 %var30, %var29
ret i1 %res
}
+
+; A ==> A for vectors
+define <4 x i1> @test5(<4 x i1> %vec) {
+; CHECK-LABEL: @test5
+; CHECK: ret <4 x i1> <i1 true, i1 true, i1 true, i1 true>
+ %res = icmp ule <4 x i1> %vec, %vec
+ ret <4 x i1> %res
+}
+
+; Don't crash on vector inputs - pr25040
+define <4 x i1> @test6(<4 x i1> %a, <4 x i1> %b) {
+; CHECK-LABEL: @test6
+; CHECK: ret <4 x i1> %res
+ %res = icmp ule <4 x i1> %a, %b
+ ret <4 x i1> %res
+}
OpenPOWER on IntegriCloud