Skip to content

Commit 91aa211

Browse files
committed
[InstCombine] add vector tests for multi-use demanded bits; NFC
See D91415.
1 parent 9bcef58 commit 91aa211

File tree

1 file changed

+26
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+26
-0
lines changed

llvm/test/Transforms/InstCombine/and.ll

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,3 +1100,29 @@ define <2 x i8> @lowmask_add_splat(<2 x i8> %x, <2 x i8>* %p) {
11001100
%r = and <2 x i8> %a, <i8 32, i8 32> ; 0x20
11011101
ret <2 x i8> %r
11021102
}
1103+
1104+
define <2 x i8> @lowmask_add_splat_undef(<2 x i8> %x, <2 x i8>* %p) {
1105+
; CHECK-LABEL: @lowmask_add_splat_undef(
1106+
; CHECK-NEXT: [[A:%.*]] = add <2 x i8> [[X:%.*]], <i8 -64, i8 undef>
1107+
; CHECK-NEXT: store <2 x i8> [[A]], <2 x i8>* [[P:%.*]], align 2
1108+
; CHECK-NEXT: [[R:%.*]] = and <2 x i8> [[A]], <i8 undef, i8 32>
1109+
; CHECK-NEXT: ret <2 x i8> [[R]]
1110+
;
1111+
%a = add <2 x i8> %x, <i8 -64, i8 undef> ; 0xc0
1112+
store <2 x i8> %a, <2 x i8>* %p
1113+
%r = and <2 x i8> %a, <i8 undef, i8 32> ; 0x20
1114+
ret <2 x i8> %r
1115+
}
1116+
1117+
define <2 x i8> @lowmask_add_vec(<2 x i8> %x, <2 x i8>* %p) {
1118+
; CHECK-LABEL: @lowmask_add_vec(
1119+
; CHECK-NEXT: [[A:%.*]] = add <2 x i8> [[X:%.*]], <i8 -96, i8 -64>
1120+
; CHECK-NEXT: store <2 x i8> [[A]], <2 x i8>* [[P:%.*]], align 2
1121+
; CHECK-NEXT: [[R:%.*]] = and <2 x i8> [[A]], <i8 16, i8 32>
1122+
; CHECK-NEXT: ret <2 x i8> [[R]]
1123+
;
1124+
%a = add <2 x i8> %x, <i8 -96, i8 -64> ; 0xe0, 0xc0
1125+
store <2 x i8> %a, <2 x i8>* %p
1126+
%r = and <2 x i8> %a, <i8 16, i8 32> ; 0x10, 0x20
1127+
ret <2 x i8> %r
1128+
}

0 commit comments

Comments
 (0)