[llvm] r285036 - [InstCombine] regenerate some checks
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 15:50:27 PDT 2016
Author: spatel
Date: Mon Oct 24 17:50:26 2016
New Revision: 285036
URL: http://llvm.org/viewvc/llvm-project?rev=285036&view=rev
Log:
[InstCombine] regenerate some checks
Modified:
llvm/trunk/test/Transforms/InstCombine/select.ll
Modified: llvm/trunk/test/Transforms/InstCombine/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/select.ll?rev=285036&r1=285035&r2=285036&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/select.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/select.ll Mon Oct 24 17:50:26 2016
@@ -722,97 +722,108 @@ define i32 @test42(i32 %x, i32 %y) {
; CHECK-NEXT: ret i32 %c
}
-define i64 @test43(i32 %a) nounwind {
- %a_ext = sext i32 %a to i64
- %is_a_nonnegative = icmp sgt i32 %a, -1
- %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 0
- ret i64 %max
+define i64 @test43(i32 %a) {
; CHECK-LABEL: @test43(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonnegative = icmp slt i64 %a_ext, 0
-; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 0, i64 %a_ext
-; CHECK-NEXT: ret i64 %max
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONNEGATIVE:%.*]] = icmp slt i64 [[A_EXT]], 0
+; CHECK-NEXT: [[MAX:%.*]] = select i1 [[IS_A_NONNEGATIVE]], i64 0, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MAX]]
+;
+ %a_ext = sext i32 %a to i64
+ %is_a_nonnegative = icmp sgt i32 %a, -1
+ %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 0
+ ret i64 %max
}
-define i64 @test44(i32 %a) nounwind {
- %a_ext = sext i32 %a to i64
- %is_a_nonpositive = icmp slt i32 %a, 1
- %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 0
- ret i64 %min
+define i64 @test44(i32 %a) {
; CHECK-LABEL: @test44(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonpositive = icmp sgt i64 %a_ext, 0
-; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 0, i64 %a_ext
-; CHECK-NEXT: ret i64 %min
-}
-define i64 @test45(i32 %a) nounwind {
- %a_ext = zext i32 %a to i64
- %is_a_nonnegative = icmp ugt i32 %a, 2
- %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3
- ret i64 %max
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONPOSITIVE:%.*]] = icmp sgt i64 [[A_EXT]], 0
+; CHECK-NEXT: [[MIN:%.*]] = select i1 [[IS_A_NONPOSITIVE]], i64 0, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MIN]]
+;
+ %a_ext = sext i32 %a to i64
+ %is_a_nonpositive = icmp slt i32 %a, 1
+ %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 0
+ ret i64 %min
+}
+
+define i64 @test45(i32 %a) {
; CHECK-LABEL: @test45(
-; CHECK-NEXT: %a_ext = zext i32 %a to i64
-; CHECK-NEXT: %is_a_nonnegative = icmp ult i64 %a_ext, 3
-; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 3, i64 %a_ext
-; CHECK-NEXT: ret i64 %max
+; CHECK-NEXT: [[A_EXT:%.*]] = zext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONNEGATIVE:%.*]] = icmp ult i64 [[A_EXT]], 3
+; CHECK-NEXT: [[MAX:%.*]] = select i1 [[IS_A_NONNEGATIVE]], i64 3, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MAX]]
+;
+ %a_ext = zext i32 %a to i64
+ %is_a_nonnegative = icmp ugt i32 %a, 2
+ %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3
+ ret i64 %max
}
-define i64 @test46(i32 %a) nounwind {
- %a_ext = zext i32 %a to i64
- %is_a_nonpositive = icmp ult i32 %a, 3
- %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
- ret i64 %min
+define i64 @test46(i32 %a) {
; CHECK-LABEL: @test46(
-; CHECK-NEXT: %a_ext = zext i32 %a to i64
-; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2
-; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
-; CHECK-NEXT: ret i64 %min
-}
-define i64 @test47(i32 %a) nounwind {
- %a_ext = sext i32 %a to i64
- %is_a_nonnegative = icmp ugt i32 %a, 2
- %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3
- ret i64 %max
+; CHECK-NEXT: [[A_EXT:%.*]] = zext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONPOSITIVE:%.*]] = icmp ugt i64 [[A_EXT]], 2
+; CHECK-NEXT: [[MIN:%.*]] = select i1 [[IS_A_NONPOSITIVE]], i64 2, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MIN]]
+;
+ %a_ext = zext i32 %a to i64
+ %is_a_nonpositive = icmp ult i32 %a, 3
+ %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
+ ret i64 %min
+}
+
+define i64 @test47(i32 %a) {
; CHECK-LABEL: @test47(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonnegative = icmp ult i64 %a_ext, 3
-; CHECK-NEXT: %max = select i1 %is_a_nonnegative, i64 3, i64 %a_ext
-; CHECK-NEXT: ret i64 %max
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONNEGATIVE:%.*]] = icmp ult i64 [[A_EXT]], 3
+; CHECK-NEXT: [[MAX:%.*]] = select i1 [[IS_A_NONNEGATIVE]], i64 3, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MAX]]
+;
+ %a_ext = sext i32 %a to i64
+ %is_a_nonnegative = icmp ugt i32 %a, 2
+ %max = select i1 %is_a_nonnegative, i64 %a_ext, i64 3
+ ret i64 %max
}
-define i64 @test48(i32 %a) nounwind {
- %a_ext = sext i32 %a to i64
- %is_a_nonpositive = icmp ult i32 %a, 3
- %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
- ret i64 %min
+define i64 @test48(i32 %a) {
; CHECK-LABEL: @test48(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2
-; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
-; CHECK-NEXT: ret i64 %min
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONPOSITIVE:%.*]] = icmp ugt i64 [[A_EXT]], 2
+; CHECK-NEXT: [[MIN:%.*]] = select i1 [[IS_A_NONPOSITIVE]], i64 2, i64 [[A_EXT]]
+; CHECK-NEXT: ret i64 [[MIN]]
+;
+ %a_ext = sext i32 %a to i64
+ %is_a_nonpositive = icmp ult i32 %a, 3
+ %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
+ ret i64 %min
}
-define i64 @test49(i32 %a) nounwind {
- %a_ext = sext i32 %a to i64
- %is_a_nonpositive = icmp ult i32 %a, 3
- %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
- ret i64 %min
+define i64 @test49(i32 %a) {
; CHECK-LABEL: @test49(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2
-; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
-; CHECK-NEXT: ret i64 %min
-}
-define i64 @test50(i32 %a) nounwind {
- %is_a_nonpositive = icmp ult i32 %a, 3
- %a_ext = sext i32 %a to i64
- %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
- ret i64 %min
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONPOSITIVE:%.*]] = icmp ugt i64 [[A_EXT]], 2
+; CHECK-NEXT: [[MIN:%.*]] = select i1 [[IS_A_NONPOSITIVE]], i64 [[A_EXT]], i64 2
+; CHECK-NEXT: ret i64 [[MIN]]
+;
+ %a_ext = sext i32 %a to i64
+ %is_a_nonpositive = icmp ult i32 %a, 3
+ %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
+ ret i64 %min
+}
+
+define i64 @test50(i32 %a) {
; CHECK-LABEL: @test50(
-; CHECK-NEXT: %a_ext = sext i32 %a to i64
-; CHECK-NEXT: %is_a_nonpositive = icmp ugt i64 %a_ext, 2
-; CHECK-NEXT: %min = select i1 %is_a_nonpositive, i64 %a_ext, i64 2
-; CHECK-NEXT: ret i64 %min
+; CHECK-NEXT: [[A_EXT:%.*]] = sext i32 %a to i64
+; CHECK-NEXT: [[IS_A_NONPOSITIVE:%.*]] = icmp ugt i64 [[A_EXT]], 2
+; CHECK-NEXT: [[MIN:%.*]] = select i1 [[IS_A_NONPOSITIVE]], i64 [[A_EXT]], i64 2
+; CHECK-NEXT: ret i64 [[MIN]]
+;
+ %is_a_nonpositive = icmp ult i32 %a, 3
+ %a_ext = sext i32 %a to i64
+ %min = select i1 %is_a_nonpositive, i64 2, i64 %a_ext
+ ret i64 %min
}
; PR8994
More information about the llvm-commits
mailing list