Skip to content

Commit a1aec2e

Browse files
Improve undef/poison usage in test (per PR automation failure), and using meaningful global instead of magic constant for shufflemask poison-indicator
1 parent 5d9e4d9 commit a1aec2e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ Instruction *InstCombinerImpl::visitExtractElementInst(ExtractElementInst &EI) {
545545
// extractelt (shufflevector %v1, %v2, splat-mask) idx ->
546546
// extractelt %v1, splat-mask[0]
547547
auto mask = SVI->getShuffleMask();
548-
if (mask[0] != -1 && all_equal(mask))
548+
if (mask[0] != PoisonMaskElem && all_equal(mask))
549549
return ExtractElementInst::Create(SVI->getOperand(0),
550550
Builder.getInt64(mask[0]));
551551

llvm/test/Transforms/InstCombine/vec_extract_through_broadcast.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ define float @no_extract_from_general_no_splat_0(<2 x float> %1, i64 %idx) {
3737
; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[TMP1]], i64 %idx
3838
; CHECK-NEXT: ret float [[TMP2]]
3939
;
40-
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 undef, i32 1, i32 1, i32 1>
40+
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 poison, i32 1, i32 1, i32 1>
4141
%4 = extractelement <4 x float> %3, i64 %idx
4242
ret float %4
4343
}
@@ -48,7 +48,7 @@ define float @no_extract_from_general_no_splat_1(<2 x float> %1, i64 %idx) {
4848
; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[TMP1]], i64 %idx
4949
; CHECK-NEXT: ret float [[TMP2]]
5050
;
51-
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 1, i32 undef, i32 1, i32 1>
51+
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 1, i32 poison, i32 1, i32 1>
5252
%4 = extractelement <4 x float> %3, i64 %idx
5353
ret float %4
5454
}

0 commit comments

Comments
 (0)