summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/InstCombine/sub.ll24
1 files changed, 19 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll
index b1c7b7245cf..3df7e506f53 100644
--- a/llvm/test/Transforms/InstCombine/sub.ll
+++ b/llvm/test/Transforms/InstCombine/sub.ll
@@ -101,12 +101,26 @@ define i32 @test10a(i32 %A) {
}
define i1 @test11(i8 %A, i8 %B) {
- %C = sub i8 %A, %B
- %cD = icmp ne i8 %C, 0
- ret i1 %cD
; CHECK-LABEL: @test11(
-; CHECK: %cD = icmp ne i8 %A, %B
-; CHECK: ret i1 %cD
+; CHECK-NEXT: [[D:%.*]] = icmp ne i8 %A, %B
+; CHECK-NEXT: ret i1 [[D]]
+;
+ %C = sub i8 %A, %B
+ %D = icmp ne i8 %C, 0
+ ret i1 %D
+}
+
+; FIXME: Vectors should get the same folds as scalars.
+
+define <2 x i1> @test11vec(<2 x i8> %A, <2 x i8> %B) {
+; CHECK-LABEL: @test11vec(
+; CHECK-NEXT: [[C:%.*]] = sub <2 x i8> %A, %B
+; CHECK-NEXT: [[D:%.*]] = icmp ne <2 x i8> [[C]], zeroinitializer
+; CHECK-NEXT: ret <2 x i1> [[D]]
+;
+ %C = sub <2 x i8> %A, %B
+ %D = icmp ne <2 x i8> %C, zeroinitializer
+ ret <2 x i1> %D
}
define i32 @test12(i32 %A) {
OpenPOWER on IntegriCloud