diff --git a/llvm/test/Transforms/InstCombine/abs-1.ll b/llvm/test/Transforms/InstCombine/abs-1.ll index 8bbc833d5d44..2b23953497b0 100644 --- a/llvm/test/Transforms/InstCombine/abs-1.ll +++ b/llvm/test/Transforms/InstCombine/abs-1.ll @@ -133,77 +133,77 @@ define i32 @abs_canonical_5(i8 %x) { define i32 @abs_canonical_6(i32 %a, i32 %b) { ; CHECK-LABEL: @abs_canonical_6( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 0 -; CHECK-NEXT: [[TMP2:%.*]] = sub i32 0, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP2]], i32 [[TMP1]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[T1]], 0 +; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP1]], i32 [[T1]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp1 = sub i32 %a, %b - %cmp = icmp sgt i32 %tmp1, -1 - %tmp2 = sub i32 %b, %a - %abs = select i1 %cmp, i32 %tmp1, i32 %tmp2 + %t1 = sub i32 %a, %b + %cmp = icmp sgt i32 %t1, -1 + %t2 = sub i32 %b, %a + %abs = select i1 %cmp, i32 %t1, i32 %t2 ret i32 %abs } define <2 x i8> @abs_canonical_7(<2 x i8> %a, <2 x i8 > %b) { ; CHECK-LABEL: @abs_canonical_7( -; CHECK-NEXT: [[TMP1:%.*]] = sub <2 x i8> [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> [[TMP1]], zeroinitializer -; CHECK-NEXT: [[TMP2:%.*]] = sub <2 x i8> zeroinitializer, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[TMP2]], <2 x i8> [[TMP1]] +; CHECK-NEXT: [[T1:%.*]] = sub <2 x i8> [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> [[T1]], zeroinitializer +; CHECK-NEXT: [[TMP1:%.*]] = sub <2 x i8> zeroinitializer, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[TMP1]], <2 x i8> [[T1]] ; CHECK-NEXT: ret <2 x i8> [[ABS]] ; - %tmp1 = sub <2 x i8> %a, %b - %cmp = icmp sgt <2 x i8> %tmp1, - %tmp2 = sub <2 x i8> %b, %a - %abs = select <2 x i1> %cmp, <2 x i8> %tmp1, <2 x i8> %tmp2 + %t1 = sub <2 x i8> %a, %b + %cmp = icmp sgt <2 x i8> %t1, + %t2 = sub <2 x i8> %b, %a + %abs = select <2 x i1> %cmp, <2 x i8> %t1, <2 x i8> %t2 ret <2 x i8> %abs } define i32 @abs_canonical_8(i32 %a) { ; CHECK-LABEL: @abs_canonical_8( -; CHECK-NEXT: [[TMP:%.*]] = sub i32 0, [[A:%.*]] +; CHECK-NEXT: [[T:%.*]] = sub i32 0, [[A:%.*]] ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[A]], 0 -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP]], i32 [[A]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[T]], i32 [[A]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp = sub i32 0, %a - %cmp = icmp slt i32 %tmp, 0 - %abs = select i1 %cmp, i32 %a, i32 %tmp + %t = sub i32 0, %a + %cmp = icmp slt i32 %t, 0 + %abs = select i1 %cmp, i32 %a, i32 %t ret i32 %abs } define i32 @abs_canonical_9(i32 %a, i32 %b) { ; CHECK-LABEL: @abs_canonical_9( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP1]], -1 -; CHECK-NEXT: [[TMP2:%.*]] = sub i32 [[B]], [[A]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP1]], i32 [[TMP2]] -; CHECK-NEXT: [[ADD:%.*]] = add i32 [[ABS]], [[TMP2]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[T1]], -1 +; CHECK-NEXT: [[T2:%.*]] = sub i32 [[B]], [[A]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[T1]], i32 [[T2]] +; CHECK-NEXT: [[ADD:%.*]] = add i32 [[ABS]], [[T2]] ; CHECK-NEXT: ret i32 [[ADD]] ; - %tmp1 = sub i32 %a, %b - %cmp = icmp sgt i32 %tmp1, -1 - %tmp2 = sub i32 %b, %a - %abs = select i1 %cmp, i32 %tmp1, i32 %tmp2 - %add = add i32 %abs, %tmp2 ; increase use count for %tmp2. + %t1 = sub i32 %a, %b + %cmp = icmp sgt i32 %t1, -1 + %t2 = sub i32 %b, %a + %abs = select i1 %cmp, i32 %t1, i32 %t2 + %add = add i32 %abs, %t2 ; increase use count for %t2. ret i32 %add } define i32 @abs_canonical_10(i32 %a, i32 %b) { ; CHECK-LABEL: @abs_canonical_10( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 0 -; CHECK-NEXT: [[NEGTMP:%.*]] = sub i32 0, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[NEGTMP]], i32 [[TMP1]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[T1]], 0 +; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP1]], i32 [[T1]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp2 = sub i32 %b, %a - %tmp1 = sub i32 %a, %b - %cmp = icmp sgt i32 %tmp1, -1 - %abs = select i1 %cmp, i32 %tmp1, i32 %tmp2 + %t2 = sub i32 %b, %a + %t1 = sub i32 %a, %b + %cmp = icmp sgt i32 %t1, -1 + %abs = select i1 %cmp, i32 %t1, i32 %t2 ret i32 %abs } @@ -297,76 +297,76 @@ define i32 @nabs_canonical_5(i8 %x) { define i32 @nabs_canonical_6(i32 %a, i32 %b) { ; CHECK-LABEL: @nabs_canonical_6( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 0 -; CHECK-NEXT: [[TMP2:%.*]] = sub i32 0, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP1]], i32 [[TMP2]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[T1]], 0 +; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[T1]], i32 [[TMP1]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp1 = sub i32 %a, %b - %cmp = icmp sgt i32 %tmp1, -1 - %tmp2 = sub i32 %b, %a - %abs = select i1 %cmp, i32 %tmp2, i32 %tmp1 + %t1 = sub i32 %a, %b + %cmp = icmp sgt i32 %t1, -1 + %t2 = sub i32 %b, %a + %abs = select i1 %cmp, i32 %t2, i32 %t1 ret i32 %abs } define <2 x i8> @nabs_canonical_7(<2 x i8> %a, <2 x i8 > %b) { ; CHECK-LABEL: @nabs_canonical_7( -; CHECK-NEXT: [[TMP1:%.*]] = sub <2 x i8> [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> [[TMP1]], zeroinitializer -; CHECK-NEXT: [[TMP2:%.*]] = sub <2 x i8> zeroinitializer, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[TMP1]], <2 x i8> [[TMP2]] +; CHECK-NEXT: [[T1:%.*]] = sub <2 x i8> [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt <2 x i8> [[T1]], zeroinitializer +; CHECK-NEXT: [[TMP1:%.*]] = sub <2 x i8> zeroinitializer, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[T1]], <2 x i8> [[TMP1]] ; CHECK-NEXT: ret <2 x i8> [[ABS]] ; - %tmp1 = sub <2 x i8> %a, %b - %cmp = icmp sgt <2 x i8> %tmp1, - %tmp2 = sub <2 x i8> %b, %a - %abs = select <2 x i1> %cmp, <2 x i8> %tmp2, <2 x i8> %tmp1 + %t1 = sub <2 x i8> %a, %b + %cmp = icmp sgt <2 x i8> %t1, + %t2 = sub <2 x i8> %b, %a + %abs = select <2 x i1> %cmp, <2 x i8> %t2, <2 x i8> %t1 ret <2 x i8> %abs } define i32 @nabs_canonical_8(i32 %a) { ; CHECK-LABEL: @nabs_canonical_8( -; CHECK-NEXT: [[TMP:%.*]] = sub i32 0, [[A:%.*]] +; CHECK-NEXT: [[T:%.*]] = sub i32 0, [[A:%.*]] ; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[A]], 0 -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[A]], i32 [[TMP]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[A]], i32 [[T]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp = sub i32 0, %a - %cmp = icmp slt i32 %tmp, 0 - %abs = select i1 %cmp, i32 %tmp, i32 %a + %t = sub i32 0, %a + %cmp = icmp slt i32 %t, 0 + %abs = select i1 %cmp, i32 %t, i32 %a ret i32 %abs } define i32 @nabs_canonical_9(i32 %a, i32 %b) { ; CHECK-LABEL: @nabs_canonical_9( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP1]], -1 -; CHECK-NEXT: [[TMP2:%.*]] = sub i32 [[B]], [[A]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP2]], i32 [[TMP1]] -; CHECK-NEXT: [[ADD:%.*]] = add i32 [[TMP2]], [[ABS]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[T1]], -1 +; CHECK-NEXT: [[T2:%.*]] = sub i32 [[B]], [[A]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[T2]], i32 [[T1]] +; CHECK-NEXT: [[ADD:%.*]] = add i32 [[T2]], [[ABS]] ; CHECK-NEXT: ret i32 [[ADD]] ; - %tmp1 = sub i32 %a, %b - %cmp = icmp sgt i32 %tmp1, -1 - %tmp2 = sub i32 %b, %a - %abs = select i1 %cmp, i32 %tmp2, i32 %tmp1 - %add = add i32 %tmp2, %abs ; increase use count for %tmp2 + %t1 = sub i32 %a, %b + %cmp = icmp sgt i32 %t1, -1 + %t2 = sub i32 %b, %a + %abs = select i1 %cmp, i32 %t2, i32 %t1 + %add = add i32 %t2, %abs ; increase use count for %t2 ret i32 %add } define i32 @nabs_canonical_10(i32 %a, i32 %b) { ; CHECK-LABEL: @nabs_canonical_10( -; CHECK-NEXT: [[TMP1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] -; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 0 -; CHECK-NEXT: [[NEGTMP:%.*]] = sub i32 0, [[TMP1]] -; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[TMP1]], i32 [[NEGTMP]] +; CHECK-NEXT: [[T1:%.*]] = sub i32 [[A:%.*]], [[B:%.*]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[T1]], 0 +; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[T1]] +; CHECK-NEXT: [[ABS:%.*]] = select i1 [[CMP]], i32 [[T1]], i32 [[TMP1]] ; CHECK-NEXT: ret i32 [[ABS]] ; - %tmp2 = sub i32 %b, %a - %tmp1 = sub i32 %a, %b - %cmp = icmp slt i32 %tmp1, 1 - %abs = select i1 %cmp, i32 %tmp1, i32 %tmp2 + %t2 = sub i32 %b, %a + %t1 = sub i32 %a, %b + %cmp = icmp slt i32 %t1, 1 + %abs = select i1 %cmp, i32 %t1, i32 %t2 ret i32 %abs } diff --git a/llvm/test/Transforms/InstCombine/and-or-icmps.ll b/llvm/test/Transforms/InstCombine/and-or-icmps.ll index 378b82020d4e..8d5471790739 100644 --- a/llvm/test/Transforms/InstCombine/and-or-icmps.ll +++ b/llvm/test/Transforms/InstCombine/and-or-icmps.ll @@ -3,7 +3,7 @@ define i1 @PR1817_1(i32 %X) { ; CHECK-LABEL: @PR1817_1( -; CHECK-NEXT: [[B:%.*]] = icmp ult i32 %X, 10 +; CHECK-NEXT: [[B:%.*]] = icmp ult i32 [[X:%.*]], 10 ; CHECK-NEXT: ret i1 [[B]] ; %A = icmp slt i32 %X, 10 @@ -14,7 +14,7 @@ define i1 @PR1817_1(i32 %X) { define i1 @PR1817_2(i32 %X) { ; CHECK-LABEL: @PR1817_2( -; CHECK-NEXT: [[A:%.*]] = icmp slt i32 %X, 10 +; CHECK-NEXT: [[A:%.*]] = icmp slt i32 [[X:%.*]], 10 ; CHECK-NEXT: ret i1 [[A]] ; %A = icmp slt i32 %X, 10 @@ -25,7 +25,7 @@ define i1 @PR1817_2(i32 %X) { define i1 @PR2330(i32 %a, i32 %b) { ; CHECK-LABEL: @PR2330( -; CHECK-NEXT: [[TMP1:%.*]] = or i32 %b, %a +; CHECK-NEXT: [[TMP1:%.*]] = or i32 [[B:%.*]], [[A:%.*]] ; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[TMP1]], 8 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -41,7 +41,7 @@ define i1 @PR2330(i32 %a, i32 %b) { define i1 @or_eq_with_one_bit_diff_constants1(i32 %x) { ; CHECK-LABEL: @or_eq_with_one_bit_diff_constants1( -; CHECK-NEXT: [[TMP1:%.*]] = or i32 %x, 1 +; CHECK-NEXT: [[TMP1:%.*]] = or i32 [[X:%.*]], 1 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 51 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -55,7 +55,7 @@ define i1 @or_eq_with_one_bit_diff_constants1(i32 %x) { define i1 @and_ne_with_one_bit_diff_constants1(i32 %x) { ; CHECK-LABEL: @and_ne_with_one_bit_diff_constants1( -; CHECK-NEXT: [[TMP1:%.*]] = or i32 %x, 1 +; CHECK-NEXT: [[TMP1:%.*]] = or i32 [[X:%.*]], 1 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 51 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -69,7 +69,7 @@ define i1 @and_ne_with_one_bit_diff_constants1(i32 %x) { define i1 @or_eq_with_one_bit_diff_constants2(i32 %x) { ; CHECK-LABEL: @or_eq_with_one_bit_diff_constants2( -; CHECK-NEXT: [[TMP1:%.*]] = or i32 %x, 32 +; CHECK-NEXT: [[TMP1:%.*]] = or i32 [[X:%.*]], 32 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 97 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -81,7 +81,7 @@ define i1 @or_eq_with_one_bit_diff_constants2(i32 %x) { define i1 @and_ne_with_one_bit_diff_constants2(i19 %x) { ; CHECK-LABEL: @and_ne_with_one_bit_diff_constants2( -; CHECK-NEXT: [[TMP1:%.*]] = or i19 %x, 128 +; CHECK-NEXT: [[TMP1:%.*]] = or i19 [[X:%.*]], 128 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i19 [[TMP1]], 193 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -95,7 +95,7 @@ define i1 @and_ne_with_one_bit_diff_constants2(i19 %x) { define i1 @or_eq_with_one_bit_diff_constants3(i8 %x) { ; CHECK-LABEL: @or_eq_with_one_bit_diff_constants3( -; CHECK-NEXT: [[TMP1:%.*]] = or i8 %x, -128 +; CHECK-NEXT: [[TMP1:%.*]] = or i8 [[X:%.*]], -128 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i8 [[TMP1]], -2 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -107,7 +107,7 @@ define i1 @or_eq_with_one_bit_diff_constants3(i8 %x) { define i1 @and_ne_with_one_bit_diff_constants3(i8 %x) { ; CHECK-LABEL: @and_ne_with_one_bit_diff_constants3( -; CHECK-NEXT: [[TMP1:%.*]] = or i8 %x, -128 +; CHECK-NEXT: [[TMP1:%.*]] = or i8 [[X:%.*]], -128 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i8 [[TMP1]], -63 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -122,7 +122,7 @@ define i1 @and_ne_with_one_bit_diff_constants3(i8 %x) { define i1 @or_eq_with_diff_one(i8 %x) { ; CHECK-LABEL: @or_eq_with_diff_one( -; CHECK-NEXT: [[TMP1:%.*]] = add i8 %x, -13 +; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[X:%.*]], -13 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i8 [[TMP1]], 2 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -136,7 +136,7 @@ define i1 @or_eq_with_diff_one(i8 %x) { define i1 @and_ne_with_diff_one(i32 %x) { ; CHECK-LABEL: @and_ne_with_diff_one( -; CHECK-NEXT: [[TMP1:%.*]] = add i32 %x, -39 +; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[X:%.*]], -39 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt i32 [[TMP1]], 1 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -151,7 +151,7 @@ define i1 @and_ne_with_diff_one(i32 %x) { define i1 @or_eq_with_diff_one_signed(i32 %x) { ; CHECK-LABEL: @or_eq_with_diff_one_signed( -; CHECK-NEXT: [[TMP1:%.*]] = add i32 %x, 1 +; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[X:%.*]], 1 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[TMP1]], 2 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -163,7 +163,7 @@ define i1 @or_eq_with_diff_one_signed(i32 %x) { define i1 @and_ne_with_diff_one_signed(i64 %x) { ; CHECK-LABEL: @and_ne_with_diff_one_signed( -; CHECK-NEXT: [[TMP1:%.*]] = add i64 %x, 1 +; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[X:%.*]], 1 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt i64 [[TMP1]], 1 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -177,7 +177,7 @@ define i1 @and_ne_with_diff_one_signed(i64 %x) { define <2 x i1> @or_eq_with_one_bit_diff_constants2_splatvec(<2 x i32> %x) { ; CHECK-LABEL: @or_eq_with_one_bit_diff_constants2_splatvec( -; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i32> %x, +; CHECK-NEXT: [[TMP1:%.*]] = or <2 x i32> [[X:%.*]], ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq <2 x i32> [[TMP1]], ; CHECK-NEXT: ret <2 x i1> [[TMP2]] ; @@ -189,7 +189,7 @@ define <2 x i1> @or_eq_with_one_bit_diff_constants2_splatvec(<2 x i32> %x) { define <2 x i1> @and_ne_with_diff_one_splatvec(<2 x i32> %x) { ; CHECK-LABEL: @and_ne_with_diff_one_splatvec( -; CHECK-NEXT: [[TMP1:%.*]] = add <2 x i32> %x, +; CHECK-NEXT: [[TMP1:%.*]] = add <2 x i32> [[X:%.*]], ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <2 x i32> [[TMP1]], ; CHECK-NEXT: ret <2 x i1> [[TMP2]] ; @@ -255,7 +255,7 @@ define void @simplify_before_foldAndOfICmps() { define i1 @PR42691_1(i32 %x) { ; CHECK-LABEL: @PR42691_1( -; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 %x, 2147483646 +; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 [[X:%.*]], 2147483646 ; CHECK-NEXT: ret i1 [[TMP1]] ; %c1 = icmp slt i32 %x, 0 @@ -266,7 +266,7 @@ define i1 @PR42691_1(i32 %x) { define i1 @PR42691_2(i32 %x) { ; CHECK-LABEL: @PR42691_2( -; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 %x, -2 +; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[X:%.*]], -2 ; CHECK-NEXT: ret i1 [[TMP1]] ; %c1 = icmp ult i32 %x, 2147483648 @@ -277,7 +277,7 @@ define i1 @PR42691_2(i32 %x) { define i1 @PR42691_3(i32 %x) { ; CHECK-LABEL: @PR42691_3( -; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 %x, -2147483647 +; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X:%.*]], -2147483647 ; CHECK-NEXT: ret i1 [[TMP1]] ; %c1 = icmp sge i32 %x, 0 @@ -288,7 +288,7 @@ define i1 @PR42691_3(i32 %x) { define i1 @PR42691_4(i32 %x) { ; CHECK-LABEL: @PR42691_4( -; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 %x, 1 +; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[X:%.*]], 1 ; CHECK-NEXT: ret i1 [[TMP1]] ; %c1 = icmp uge i32 %x, 2147483648 @@ -299,7 +299,7 @@ define i1 @PR42691_4(i32 %x) { define i1 @PR42691_5(i32 %x) { ; CHECK-LABEL: @PR42691_5( -; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, -1 +; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], -1 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 [[X_OFF]], 2147483645 ; CHECK-NEXT: ret i1 [[TMP1]] ; @@ -311,7 +311,7 @@ define i1 @PR42691_5(i32 %x) { define i1 @PR42691_6(i32 %x) { ; CHECK-LABEL: @PR42691_6( -; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, 2147483647 +; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], 2147483647 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i32 [[X_OFF]], 2147483645 ; CHECK-NEXT: ret i1 [[TMP1]] ; @@ -323,7 +323,7 @@ define i1 @PR42691_6(i32 %x) { define i1 @PR42691_7(i32 %x) { ; CHECK-LABEL: @PR42691_7( -; CHECK-NEXT: [[TMP1:%.*]] = add i32 %x, -1 +; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[X:%.*]], -1 ; CHECK-NEXT: [[TMP2:%.*]] = icmp slt i32 [[TMP1]], 0 ; CHECK-NEXT: ret i1 [[TMP2]] ; @@ -335,7 +335,7 @@ define i1 @PR42691_7(i32 %x) { define i1 @PR42691_8(i32 %x) { ; CHECK-LABEL: @PR42691_8( -; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, 2147483647 +; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], 2147483647 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X_OFF]], -2147483635 ; CHECK-NEXT: ret i1 [[TMP1]] ; @@ -347,7 +347,7 @@ define i1 @PR42691_8(i32 %x) { define i1 @PR42691_9(i32 %x) { ; CHECK-LABEL: @PR42691_9( -; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, -14 +; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], -14 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X_OFF]], 2147483633 ; CHECK-NEXT: ret i1 [[TMP1]] ; @@ -359,7 +359,7 @@ define i1 @PR42691_9(i32 %x) { define i1 @PR42691_10(i32 %x) { ; CHECK-LABEL: @PR42691_10( -; CHECK-NEXT: [[X_OFF:%.*]] = add i32 %x, -14 +; CHECK-NEXT: [[X_OFF:%.*]] = add i32 [[X:%.*]], -14 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X_OFF]], -15 ; CHECK-NEXT: ret i1 [[TMP1]] ; diff --git a/llvm/test/Transforms/InstCombine/apint-sub.ll b/llvm/test/Transforms/InstCombine/apint-sub.ll index 8d80f2c845b1..e4094f1d4290 100644 --- a/llvm/test/Transforms/InstCombine/apint-sub.ll +++ b/llvm/test/Transforms/InstCombine/apint-sub.ll @@ -11,7 +11,7 @@ define i23 @test1(i23 %A) { define i47 @test2(i47 %A) { ; CHECK-LABEL: @test2( -; CHECK-NEXT: ret i47 %A +; CHECK-NEXT: ret i47 [[A:%.*]] ; %B = sub i47 %A, 0 ret i47 %B @@ -19,7 +19,7 @@ define i47 @test2(i47 %A) { define i97 @test3(i97 %A) { ; CHECK-LABEL: @test3( -; CHECK-NEXT: ret i97 %A +; CHECK-NEXT: ret i97 [[A:%.*]] ; %B = sub i97 0, %A %C = sub i97 0, %B @@ -28,7 +28,7 @@ define i97 @test3(i97 %A) { define i108 @test4(i108 %A, i108 %x) { ; CHECK-LABEL: @test4( -; CHECK-NEXT: [[C:%.*]] = add i108 %x, %A +; CHECK-NEXT: [[C:%.*]] = add i108 [[X:%.*]], [[A:%.*]] ; CHECK-NEXT: ret i108 [[C]] ; %B = sub i108 0, %A @@ -38,8 +38,8 @@ define i108 @test4(i108 %A, i108 %x) { define i19 @test5(i19 %A, i19 %Bok, i19 %Cok) { ; CHECK-LABEL: @test5( -; CHECK-NEXT: [[D1:%.*]] = sub i19 %Cok, %Bok -; CHECK-NEXT: [[E:%.*]] = add i19 [[D1]], %A +; CHECK-NEXT: [[D1:%.*]] = sub i19 [[COK:%.*]], [[BOK:%.*]] +; CHECK-NEXT: [[E:%.*]] = add i19 [[D1]], [[A:%.*]] ; CHECK-NEXT: ret i19 [[E]] ; %D = sub i19 %Bok, %Cok @@ -49,8 +49,8 @@ define i19 @test5(i19 %A, i19 %Bok, i19 %Cok) { define i57 @test6(i57 %A, i57 %B) { ; CHECK-LABEL: @test6( -; CHECK-NEXT: [[B_NOT:%.*]] = xor i57 %B, -1 -; CHECK-NEXT: [[D:%.*]] = and i57 [[B_NOT]], %A +; CHECK-NEXT: [[B_NOT:%.*]] = xor i57 [[B:%.*]], -1 +; CHECK-NEXT: [[D:%.*]] = and i57 [[B_NOT]], [[A:%.*]] ; CHECK-NEXT: ret i57 [[D]] ; %C = and i57 %A, %B @@ -60,7 +60,7 @@ define i57 @test6(i57 %A, i57 %B) { define i77 @test7(i77 %A) { ; CHECK-LABEL: @test7( -; CHECK-NEXT: [[B:%.*]] = xor i77 %A, -1 +; CHECK-NEXT: [[B:%.*]] = xor i77 [[A:%.*]], -1 ; CHECK-NEXT: ret i77 [[B]] ; %B = sub i77 -1, %A @@ -69,7 +69,7 @@ define i77 @test7(i77 %A) { define i27 @test8(i27 %A) { ; CHECK-LABEL: @test8( -; CHECK-NEXT: [[C:%.*]] = shl i27 %A, 3 +; CHECK-NEXT: [[C:%.*]] = shl i27 [[A:%.*]], 3 ; CHECK-NEXT: ret i27 [[C]] ; %B = mul i27 9, %A @@ -79,7 +79,7 @@ define i27 @test8(i27 %A) { define i42 @test9(i42 %A) { ; CHECK-LABEL: @test9( -; CHECK-NEXT: [[C:%.*]] = mul i42 %A, -2 +; CHECK-NEXT: [[C:%.*]] = mul i42 [[A:%.*]], -2 ; CHECK-NEXT: ret i42 [[C]] ; %B = mul i42 3, %A @@ -89,7 +89,7 @@ define i42 @test9(i42 %A) { define i1 @test11(i9 %A, i9 %B) { ; CHECK-LABEL: @test11( -; CHECK-NEXT: [[CD:%.*]] = icmp ne i9 %A, %B +; CHECK-NEXT: [[CD:%.*]] = icmp ne i9 [[A:%.*]], [[B:%.*]] ; CHECK-NEXT: ret i1 [[CD]] ; %C = sub i9 %A, %B @@ -99,7 +99,7 @@ define i1 @test11(i9 %A, i9 %B) { define i43 @test12(i43 %A) { ; CHECK-LABEL: @test12( -; CHECK-NEXT: [[C:%.*]] = lshr i43 %A, 42 +; CHECK-NEXT: [[C:%.*]] = lshr i43 [[A:%.*]], 42 ; CHECK-NEXT: ret i43 [[C]] ; %B = ashr i43 %A, 42 @@ -109,7 +109,7 @@ define i43 @test12(i43 %A) { define i79 @test13(i79 %A) { ; CHECK-LABEL: @test13( -; CHECK-NEXT: [[C:%.*]] = ashr i79 %A, 78 +; CHECK-NEXT: [[C:%.*]] = ashr i79 [[A:%.*]], 78 ; CHECK-NEXT: ret i79 [[C]] ; %B = lshr i79 %A, 78 @@ -119,7 +119,7 @@ define i79 @test13(i79 %A) { define i1024 @test14(i1024 %A) { ; CHECK-LABEL: @test14( -; CHECK-NEXT: [[D:%.*]] = ashr i1024 %A, 1023 +; CHECK-NEXT: [[D:%.*]] = ashr i1024 [[A:%.*]], 1023 ; CHECK-NEXT: ret i1024 [[D]] ; %B = lshr i1024 %A, 1023 @@ -130,7 +130,7 @@ define i1024 @test14(i1024 %A) { define i51 @test16(i51 %A) { ; CHECK-LABEL: @test16( -; CHECK-NEXT: [[Y:%.*]] = sdiv i51 %A, -1123 +; CHECK-NEXT: [[Y:%.*]] = sdiv i51 [[A:%.*]], -1123 ; CHECK-NEXT: ret i51 [[Y]] ; %X = sdiv i51 %A, 1123 @@ -142,7 +142,7 @@ define i51 @test16(i51 %A) { ; PR3142 define i25 @test17(i25 %Aok) { ; CHECK-LABEL: @test17( -; CHECK-NEXT: [[B:%.*]] = sub i25 0, %Aok +; CHECK-NEXT: [[B:%.*]] = sub i25 0, [[AOK:%.*]] ; CHECK-NEXT: [[C:%.*]] = sdiv i25 [[B]], 1234 ; CHECK-NEXT: ret i25 [[C]] ; @@ -163,7 +163,7 @@ define i128 @test18(i128 %Y) { define i39 @test19(i39 %X, i39 %Y) { ; CHECK-LABEL: @test19( -; CHECK-NEXT: ret i39 %X +; CHECK-NEXT: ret i39 [[X:%.*]] ; %Z = sub i39 %X, %Y %Q = add i39 %Z, %Y @@ -172,7 +172,7 @@ define i39 @test19(i39 %X, i39 %Y) { define i1 @test20(i33 %g, i33 %h) { ; CHECK-LABEL: @test20( -; CHECK-NEXT: [[T4:%.*]] = icmp ne i33 %h, 0 +; CHECK-NEXT: [[T4:%.*]] = icmp ne i33 [[H:%.*]], 0 ; CHECK-NEXT: ret i1 [[T4]] ; %t2 = sub i33 %g, %h @@ -182,7 +182,7 @@ define i1 @test20(i33 %g, i33 %h) { define i1 @test21(i256 %g, i256 %h) { ; CHECK-LABEL: @test21( -; CHECK-NEXT: [[T4:%.*]] = icmp ne i256 %h, 0 +; CHECK-NEXT: [[T4:%.*]] = icmp ne i256 [[H:%.*]], 0 ; CHECK-NEXT: ret i1 [[T4]] ; %t2 = sub i256 %g, %h diff --git a/llvm/test/Transforms/InstCombine/mul.ll b/llvm/test/Transforms/InstCombine/mul.ll index eb8f17f457c6..be8b2459ef8f 100644 --- a/llvm/test/Transforms/InstCombine/mul.ll +++ b/llvm/test/Transforms/InstCombine/mul.ll @@ -521,8 +521,8 @@ define i64 @test_mul_canonicalize_neg_is_not_undone(i64 %L1) { define i32 @negate_if_true(i32 %x, i1 %cond) { ; CHECK-LABEL: @negate_if_true( ; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[X:%.*]] -; CHECK-NEXT: [[R:%.*]] = select i1 [[COND:%.*]], i32 [[TMP1]], i32 [[X]] -; CHECK-NEXT: ret i32 [[R]] +; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[COND:%.*]], i32 [[TMP1]], i32 [[X]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %sel = select i1 %cond, i32 -1, i32 1 %r = mul i32 %sel, %x @@ -532,8 +532,8 @@ define i32 @negate_if_true(i32 %x, i1 %cond) { define i32 @negate_if_false(i32 %x, i1 %cond) { ; CHECK-LABEL: @negate_if_false( ; CHECK-NEXT: [[TMP1:%.*]] = sub i32 0, [[X:%.*]] -; CHECK-NEXT: [[R:%.*]] = select i1 [[COND:%.*]], i32 [[X]], i32 [[TMP1]] -; CHECK-NEXT: ret i32 [[R]] +; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[COND:%.*]], i32 [[X]], i32 [[TMP1]] +; CHECK-NEXT: ret i32 [[TMP2]] ; %sel = select i1 %cond, i32 1, i32 -1 %r = mul i32 %sel, %x @@ -544,8 +544,8 @@ define <2 x i8> @negate_if_true_commute(<2 x i8> %px, i1 %cond) { ; CHECK-LABEL: @negate_if_true_commute( ; CHECK-NEXT: [[X:%.*]] = sdiv <2 x i8> , [[PX:%.*]] ; CHECK-NEXT: [[TMP1:%.*]] = sub nsw <2 x i8> zeroinitializer, [[X]] -; CHECK-NEXT: [[R:%.*]] = select i1 [[COND:%.*]], <2 x i8> [[TMP1]], <2 x i8> [[X]] -; CHECK-NEXT: ret <2 x i8> [[R]] +; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[COND:%.*]], <2 x i8> [[TMP1]], <2 x i8> [[X]] +; CHECK-NEXT: ret <2 x i8> [[TMP2]] ; %x = sdiv <2 x i8> , %px ; thwart complexity-based canonicalization %sel = select i1 %cond, <2 x i8> , <2 x i8> @@ -557,8 +557,8 @@ define <2 x i8> @negate_if_false_commute(<2 x i8> %px, <2 x i1> %cond) { ; CHECK-LABEL: @negate_if_false_commute( ; CHECK-NEXT: [[X:%.*]] = sdiv <2 x i8> , [[PX:%.*]] ; CHECK-NEXT: [[TMP1:%.*]] = sub <2 x i8> zeroinitializer, [[X]] -; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[COND:%.*]], <2 x i8> [[X]], <2 x i8> [[TMP1]] -; CHECK-NEXT: ret <2 x i8> [[R]] +; CHECK-NEXT: [[TMP2:%.*]] = select <2 x i1> [[COND:%.*]], <2 x i8> [[X]], <2 x i8> [[TMP1]] +; CHECK-NEXT: ret <2 x i8> [[TMP2]] ; %x = sdiv <2 x i8> , %px ; thwart complexity-based canonicalization %sel = select <2 x i1> %cond, <2 x i8> , <2 x i8>