[NFC][InstCombine] Fixup some tests in just-added "omit mask before left-shift" tests

llvm-svn: 365663
This commit is contained in:
Roman Lebedev 2019-07-10 16:54:13 +00:00
parent d37edd0c79
commit 20b45a6115
3 changed files with 15 additions and 10 deletions

View File

@ -228,7 +228,8 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) {
; CHECK-NEXT: call void @use32(i32 [[T3]])
; CHECK-NEXT: call void @use32(i32 [[T4]])
; CHECK-NEXT: call void @use32(i32 [[T5]])
; CHECK-NEXT: ret i32 [[T4]]
; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]]
; CHECK-NEXT: ret i32 [[T6]]
;
%t0 = shl i32 1, %nbits0
%t1 = add nsw i32 %t0, -1
@ -243,7 +244,7 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) {
call void @use32(i32 %t4)
call void @use32(i32 %t5)
%t6 = shl i32 %t4, %t5
ret i32 %t4
ret i32 %t6
}
define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
; CHECK-LABEL: @t6_commutativity2(
@ -259,7 +260,8 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
; CHECK-NEXT: call void @use32(i32 [[T3]])
; CHECK-NEXT: call void @use32(i32 [[T4]])
; CHECK-NEXT: call void @use32(i32 [[T5]])
; CHECK-NEXT: ret i32 [[T4]]
; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]]
; CHECK-NEXT: ret i32 [[T6]]
;
%t0 = shl i32 1, %nbits0
%t1 = add nsw i32 %t0, -1
@ -274,7 +276,7 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
call void @use32(i32 %t4)
call void @use32(i32 %t5)
%t6 = shl i32 %t4, %t5
ret i32 %t4
ret i32 %t6
}
; Fast-math flags. We must not preserve them!

View File

@ -228,7 +228,8 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) {
; CHECK-NEXT: call void @use32(i32 [[T3]])
; CHECK-NEXT: call void @use32(i32 [[T4]])
; CHECK-NEXT: call void @use32(i32 [[T5]])
; CHECK-NEXT: ret i32 [[T4]]
; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]]
; CHECK-NEXT: ret i32 [[T6]]
;
%t0 = shl i32 -1, %nbits0
%t1 = xor i32 %t0, -1
@ -243,7 +244,7 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) {
call void @use32(i32 %t4)
call void @use32(i32 %t5)
%t6 = shl i32 %t4, %t5
ret i32 %t4
ret i32 %t6
}
define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
; CHECK-LABEL: @t6_commutativity2(
@ -259,7 +260,8 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
; CHECK-NEXT: call void @use32(i32 [[T3]])
; CHECK-NEXT: call void @use32(i32 [[T4]])
; CHECK-NEXT: call void @use32(i32 [[T5]])
; CHECK-NEXT: ret i32 [[T4]]
; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]]
; CHECK-NEXT: ret i32 [[T6]]
;
%t0 = shl i32 -1, %nbits0
%t1 = xor i32 %t0, -1
@ -274,7 +276,7 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) {
call void @use32(i32 %t4)
call void @use32(i32 %t5)
%t6 = shl i32 %t4, %t5
ret i32 %t4
ret i32 %t6
}
; Fast-math flags. We must not preserve them!

View File

@ -200,7 +200,8 @@ define i32 @n12(i32 %x, i32 %nbits) {
; CHECK-NEXT: call void @use32(i32 [[T0]])
; CHECK-NEXT: call void @use32(i32 [[T1]])
; CHECK-NEXT: call void @use32(i32 [[T2]])
; CHECK-NEXT: ret i32 [[T2]]
; CHECK-NEXT: [[T3:%.*]] = shl i32 [[T1]], [[T2]]
; CHECK-NEXT: ret i32 [[T3]]
;
%t0 = shl i32 %x, %nbits
%t1 = ashr i32 %t0, %nbits
@ -209,5 +210,5 @@ define i32 @n12(i32 %x, i32 %nbits) {
call void @use32(i32 %t1)
call void @use32(i32 %t2)
%t3 = shl i32 %t1, %t2 ; shift is smaller than mask
ret i32 %t2
ret i32 %t3
}