Skip to content

Commit 70d3c01

Browse files
Fixed varname convention per PR feedback; on reflection from PR feedback removing negative tests
1 parent a1aec2e commit 70d3c01

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,10 @@ Instruction *InstCombinerImpl::visitExtractElementInst(ExtractElementInst &EI) {
544544
} else if (auto *SVI = dyn_cast<ShuffleVectorInst>(I)) {
545545
// extractelt (shufflevector %v1, %v2, splat-mask) idx ->
546546
// extractelt %v1, splat-mask[0]
547-
auto mask = SVI->getShuffleMask();
548-
if (mask[0] != PoisonMaskElem && all_equal(mask))
547+
auto Mask = SVI->getShuffleMask();
548+
if (Mask[0] != PoisonMaskElem && all_equal(Mask))
549549
return ExtractElementInst::Create(SVI->getOperand(0),
550-
Builder.getInt64(mask[0]));
550+
Builder.getInt64(Mask[0]));
551551

552552
// If this is extracting an element from a shufflevector, figure out where
553553
// it came from and extract from the appropriate input element instead.

llvm/test/Transforms/InstCombine/vec_extract_through_broadcast.ll

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,3 @@ define float @extract_from_general_scalable_splat(<vscale x 2 x float> %1, i64 %
3030
%4 = extractelement <vscale x 4 x float> %3, i64 %idx
3131
ret float %4
3232
}
33-
34-
define float @no_extract_from_general_no_splat_0(<2 x float> %1, i64 %idx) {
35-
; CHECK-LABEL: @no_extract_from_general_no_splat_0(
36-
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x float> [[W:%.*]], <2 x float> poison, <4 x i32> <i32 poison, i32 1, i32 1, i32 1>
37-
; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[TMP1]], i64 %idx
38-
; CHECK-NEXT: ret float [[TMP2]]
39-
;
40-
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 poison, i32 1, i32 1, i32 1>
41-
%4 = extractelement <4 x float> %3, i64 %idx
42-
ret float %4
43-
}
44-
45-
define float @no_extract_from_general_no_splat_1(<2 x float> %1, i64 %idx) {
46-
; CHECK-LABEL: @no_extract_from_general_no_splat_1(
47-
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x float> [[W:%.*]], <2 x float> poison, <4 x i32> <i32 1, i32 poison, i32 1, i32 1>
48-
; CHECK-NEXT: [[TMP2:%.*]] = extractelement <4 x float> [[TMP1]], i64 %idx
49-
; CHECK-NEXT: ret float [[TMP2]]
50-
;
51-
%3 = shufflevector <2 x float> %1, <2 x float> poison, <4 x i32> <i32 1, i32 poison, i32 1, i32 1>
52-
%4 = extractelement <4 x float> %3, i64 %idx
53-
ret float %4
54-
}

0 commit comments

Comments
 (0)