Skip to content

Commit 465ecf8

Browse files
committed
[InstCombine] Rename UndefElts -> PoisonElts (NFC)
In line with updated shufflevector semantics, this represents the poison elements rather than undef elements now. This commit is a pure rename, without any logic changes.
1 parent 3375046 commit 465ecf8

6 files changed

+88
-87
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,9 @@ Instruction *InstCombinerImpl::simplifyMaskedStore(IntrinsicInst &II) {
357357

358358
// Use masked off lanes to simplify operands via SimplifyDemandedVectorElts
359359
APInt DemandedElts = possiblyDemandedEltsInMask(ConstMask);
360-
APInt UndefElts(DemandedElts.getBitWidth(), 0);
361-
if (Value *V =
362-
SimplifyDemandedVectorElts(II.getOperand(0), DemandedElts, UndefElts))
360+
APInt PoisonElts(DemandedElts.getBitWidth(), 0);
361+
if (Value *V = SimplifyDemandedVectorElts(II.getOperand(0), DemandedElts,
362+
PoisonElts))
363363
return replaceOperand(II, 0, V);
364364

365365
return nullptr;
@@ -439,12 +439,12 @@ Instruction *InstCombinerImpl::simplifyMaskedScatter(IntrinsicInst &II) {
439439

440440
// Use masked off lanes to simplify operands via SimplifyDemandedVectorElts
441441
APInt DemandedElts = possiblyDemandedEltsInMask(ConstMask);
442-
APInt UndefElts(DemandedElts.getBitWidth(), 0);
443-
if (Value *V =
444-
SimplifyDemandedVectorElts(II.getOperand(0), DemandedElts, UndefElts))
442+
APInt PoisonElts(DemandedElts.getBitWidth(), 0);
443+
if (Value *V = SimplifyDemandedVectorElts(II.getOperand(0), DemandedElts,
444+
PoisonElts))
445445
return replaceOperand(II, 0, V);
446-
if (Value *V =
447-
SimplifyDemandedVectorElts(II.getOperand(1), DemandedElts, UndefElts))
446+
if (Value *V = SimplifyDemandedVectorElts(II.getOperand(1), DemandedElts,
447+
PoisonElts))
448448
return replaceOperand(II, 1, V);
449449

450450
return nullptr;
@@ -1526,9 +1526,9 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
15261526
// support.
15271527
if (auto *IIFVTy = dyn_cast<FixedVectorType>(II->getType())) {
15281528
auto VWidth = IIFVTy->getNumElements();
1529-
APInt UndefElts(VWidth, 0);
1529+
APInt PoisonElts(VWidth, 0);
15301530
APInt AllOnesEltMask(APInt::getAllOnes(VWidth));
1531-
if (Value *V = SimplifyDemandedVectorElts(II, AllOnesEltMask, UndefElts)) {
1531+
if (Value *V = SimplifyDemandedVectorElts(II, AllOnesEltMask, PoisonElts)) {
15321532
if (V != II)
15331533
return replaceInstUsesWith(*II, V);
15341534
return II;

llvm/lib/Transforms/InstCombine/InstCombineInternal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
550550
bool SimplifyDemandedInstructionBits(Instruction &Inst, KnownBits &Known);
551551

552552
Value *SimplifyDemandedVectorElts(Value *V, APInt DemandedElts,
553-
APInt &UndefElts, unsigned Depth = 0,
553+
APInt &PoisonElts, unsigned Depth = 0,
554554
bool AllowMultipleUsers = false) override;
555555

556556
/// Canonicalize the position of binops relative to shufflevector.

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2440,9 +2440,9 @@ Instruction *InstCombinerImpl::foldVectorSelect(SelectInst &Sel) {
24402440
return nullptr;
24412441

24422442
unsigned NumElts = VecTy->getNumElements();
2443-
APInt UndefElts(NumElts, 0);
2443+
APInt PoisonElts(NumElts, 0);
24442444
APInt AllOnesEltMask(APInt::getAllOnes(NumElts));
2445-
if (Value *V = SimplifyDemandedVectorElts(&Sel, AllOnesEltMask, UndefElts)) {
2445+
if (Value *V = SimplifyDemandedVectorElts(&Sel, AllOnesEltMask, PoisonElts)) {
24462446
if (V != &Sel)
24472447
return replaceInstUsesWith(Sel, V);
24482448
return &Sel;

0 commit comments

Comments
 (0)