summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/add.ll14
-rw-r--r--llvm/test/Transforms/InstCombine/sub.ll5
-rw-r--r--llvm/test/Transforms/InstCombine/with_overflow.ll7
3 files changed, 11 insertions, 15 deletions
diff --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll
index 8b30026b4cf..a2f35cc4359 100644
--- a/llvm/test/Transforms/InstCombine/add.ll
+++ b/llvm/test/Transforms/InstCombine/add.ll
@@ -982,9 +982,8 @@ define i32 @add_to_sub2(i32 %A, i32 %M) {
; (X | C1) + C2 --> (X | C1) ^ C1 iff (C1 == -C2)
define i32 @test44(i32 %A) {
; CHECK-LABEL: @test44(
-; CHECK-NEXT: [[B:%.*]] = or i32 [[A:%.*]], 123
-; CHECK-NEXT: [[C:%.*]] = add nsw i32 [[B]], -123
-; CHECK-NEXT: ret i32 [[C]]
+; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[A:%.*]], -124
+; CHECK-NEXT: ret i32 [[TMP1]]
;
%B = or i32 %A, 123
%C = add i32 %B, -123
@@ -994,8 +993,8 @@ define i32 @test44(i32 %A) {
define i32 @test44_extra_use(i32 %A) {
; CHECK-LABEL: @test44_extra_use(
; CHECK-NEXT: [[B:%.*]] = or i32 [[A:%.*]], 123
-; CHECK-NEXT: [[C:%.*]] = add nsw i32 [[B]], -123
-; CHECK-NEXT: [[D:%.*]] = mul i32 [[B]], [[C]]
+; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[A]], -124
+; CHECK-NEXT: [[D:%.*]] = mul i32 [[B]], [[TMP1]]
; CHECK-NEXT: ret i32 [[D]]
;
%B = or i32 %A, 123
@@ -1017,9 +1016,8 @@ define i32 @test44_non_matching(i32 %A) {
define <2 x i32> @test44_vec(<2 x i32> %A) {
; CHECK-LABEL: @test44_vec(
-; CHECK-NEXT: [[B:%.*]] = or <2 x i32> [[A:%.*]], <i32 123, i32 123>
-; CHECK-NEXT: [[C:%.*]] = add nsw <2 x i32> [[B]], <i32 -123, i32 -123>
-; CHECK-NEXT: ret <2 x i32> [[C]]
+; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i32> [[A:%.*]], <i32 -124, i32 -124>
+; CHECK-NEXT: ret <2 x i32> [[TMP1]]
;
%B = or <2 x i32> %A, <i32 123, i32 123>
%C = add <2 x i32> %B, <i32 -123, i32 -123>
diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll
index 7af94f9b785..88c681c8cb5 100644
--- a/llvm/test/Transforms/InstCombine/sub.ll
+++ b/llvm/test/Transforms/InstCombine/sub.ll
@@ -1270,9 +1270,8 @@ define <2 x i32> @test69(<2 x i32> %x) {
; Check (X | Y) - Y --> X & ~Y when Y is a constant
define i32 @test70(i32 %A) {
; CHECK-LABEL: @test70(
-; CHECK-NEXT: [[B:%.*]] = or i32 [[A:%.*]], 123
-; CHECK-NEXT: [[C:%.*]] = add nsw i32 [[B]], -123
-; CHECK-NEXT: ret i32 [[C]]
+; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[A:%.*]], -124
+; CHECK-NEXT: ret i32 [[TMP1]]
;
%B = or i32 %A, 123
%C = sub i32 %B, 123
diff --git a/llvm/test/Transforms/InstCombine/with_overflow.ll b/llvm/test/Transforms/InstCombine/with_overflow.ll
index e80da2afe2f..b15e37ce6e0 100644
--- a/llvm/test/Transforms/InstCombine/with_overflow.ll
+++ b/llvm/test/Transforms/InstCombine/with_overflow.ll
@@ -531,10 +531,9 @@ define { i32, i1 } @umul_canonicalize_constant_arg0(i32 %x) nounwind {
define { i8, i1 } @uadd_always_overflow(i8 %x) nounwind {
; CHECK-LABEL: @uadd_always_overflow(
-; CHECK-NEXT: [[Y:%.*]] = or i8 [[X:%.*]], -64
-; CHECK-NEXT: [[A:%.*]] = add nsw i8 [[Y]], 64
-; CHECK-NEXT: [[TMP1:%.*]] = insertvalue { i8, i1 } { i8 undef, i1 true }, i8 [[A]], 0
-; CHECK-NEXT: ret { i8, i1 } [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X:%.*]], 63
+; CHECK-NEXT: [[TMP2:%.*]] = insertvalue { i8, i1 } { i8 undef, i1 true }, i8 [[TMP1]], 0
+; CHECK-NEXT: ret { i8, i1 } [[TMP2]]
;
%y = or i8 %x, 192
%a = call { i8, i1 } @llvm.uadd.with.overflow.i8(i8 %y, i8 64)
OpenPOWER on IntegriCloud