[llvm] r278689 - [InstCombine] add tests for missing vector icmp folds
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 15 10:55:39 PDT 2016
Author: spatel
Date: Mon Aug 15 12:55:39 2016
New Revision: 278689
URL: http://llvm.org/viewvc/llvm-project?rev=278689&view=rev
Log:
[InstCombine] add tests for missing vector icmp folds
Modified:
llvm/trunk/test/Transforms/InstCombine/apint-shift.ll
Modified: llvm/trunk/test/Transforms/InstCombine/apint-shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/apint-shift.ll?rev=278689&r1=278688&r2=278689&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/apint-shift.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/apint-shift.ll Mon Aug 15 12:55:39 2016
@@ -205,6 +205,7 @@ define i1 @test16(i84 %X) {
ret i1 %cmp
}
+; FIXME: Vectors should fold too.
define <2 x i1> @test16vec(<2 x i84> %X) {
; CHECK-LABEL: @test16vec(
; CHECK-NEXT: [[SHR1:%.*]] = lshr <2 x i84> %X, <i84 4, i84 4>
@@ -229,6 +230,18 @@ define i1 @test17(i106 %A) {
ret i1 %C
}
+; FIXME: Vectors should fold too.
+define <2 x i1> @test17vec(<2 x i106> %A) {
+; CHECK-LABEL: @test17vec(
+; CHECK-NEXT: [[B:%.*]] = lshr <2 x i106> %A, <i106 3, i106 3>
+; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i106> [[B]], <i106 1234, i106 1234>
+; CHECK-NEXT: ret <2 x i1> [[C]]
+;
+ %B = lshr <2 x i106> %A, <i106 3, i106 3>
+ %C = icmp eq <2 x i106> %B, <i106 1234, i106 1234>
+ ret <2 x i1> %C
+}
+
define i1 @test18(i11 %A) {
; CHECK-LABEL: @test18(
; CHECK-NEXT: ret i1 false
@@ -248,6 +261,18 @@ define i1 @test19(i37 %A) {
ret i1 %C
}
+; FIXME: Vectors should fold too.
+define <2 x i1> @test19vec(<2 x i37> %A) {
+; CHECK-LABEL: @test19vec(
+; CHECK-NEXT: [[B:%.*]] = ashr <2 x i37> %A, <i37 2, i37 2>
+; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i37> [[B]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[C]]
+;
+ %B = ashr <2 x i37> %A, <i37 2, i37 2>
+ %C = icmp eq <2 x i37> %B, zeroinitializer
+ ret <2 x i1> %C
+}
+
define i1 @test19a(i39 %A) {
; CHECK-LABEL: @test19a(
; CHECK-NEXT: [[C:%.*]] = icmp ugt i39 %A, -5
@@ -258,6 +283,18 @@ define i1 @test19a(i39 %A) {
ret i1 %C
}
+; FIXME: Vectors should fold too.
+define <2 x i1> @test19a_vec(<2 x i39> %A) {
+; CHECK-LABEL: @test19a_vec(
+; CHECK-NEXT: [[B:%.*]] = ashr <2 x i39> %A, <i39 2, i39 2>
+; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i39> [[B]], <i39 -1, i39 -1>
+; CHECK-NEXT: ret <2 x i1> [[C]]
+;
+ %B = ashr <2 x i39> %A, <i39 2, i39 2>
+ %C = icmp eq <2 x i39> %B, <i39 -1, i39 -1>
+ ret <2 x i1> %C
+}
+
define i1 @test20(i13 %A) {
; CHECK-LABEL: @test20(
; CHECK-NEXT: ret i1 false
More information about the llvm-commits
mailing list