[llvm] c6e4c1f - [VPlan] Remove default arg from getVPValue (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 11 13:22:36 PDT 2021
Author: Florian Hahn
Date: 2021-07-11T22:03:09+02:00
New Revision: c6e4c1fbd80e60be3a819b22d6b647551f704191
URL: https://github.com/llvm/llvm-project/commit/c6e4c1fbd80e60be3a819b22d6b647551f704191
DIFF: https://github.com/llvm/llvm-project/commit/c6e4c1fbd80e60be3a819b22d6b647551f704191.diff
LOG: [VPlan] Remove default arg from getVPValue (NFC).
The const version of VPValue::getVPValue still had a default value for
the value index. Remove the default value and use getVPSingleValue
instead, which is the proper function.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
llvm/lib/Transforms/Vectorize/VPlanValue.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 67d447828732c..344c9974f7115 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -516,7 +516,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
}
case VPReplicateSC:
case VPWidenCallSC:
- return cast<Instruction>(getVPValue()->getUnderlyingValue())
+ return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
->mayWriteToMemory();
case VPBranchOnMaskSC:
return false;
@@ -529,7 +529,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
case VPReductionSC:
case VPWidenSelectSC: {
const Instruction *I =
- dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue());
+ dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I;
assert((!I || !I->mayWriteToMemory()) &&
"underlying instruction may write to memory");
@@ -547,7 +547,7 @@ bool VPRecipeBase::mayReadFromMemory() const {
}
case VPReplicateSC:
case VPWidenCallSC:
- return cast<Instruction>(getVPValue()->getUnderlyingValue())
+ return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
->mayReadFromMemory();
case VPBranchOnMaskSC:
return false;
@@ -560,7 +560,7 @@ bool VPRecipeBase::mayReadFromMemory() const {
case VPReductionSC:
case VPWidenSelectSC: {
const Instruction *I =
- dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue());
+ dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I;
assert((!I || !I->mayReadFromMemory()) &&
"underlying instruction may read from memory");
@@ -584,7 +584,7 @@ bool VPRecipeBase::mayHaveSideEffects() const {
case VPReductionSC:
case VPWidenSelectSC: {
const Instruction *I =
- dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue());
+ dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I;
assert((!I || !I->mayHaveSideEffects()) &&
"underlying instruction has side-effects");
@@ -1179,7 +1179,7 @@ void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent,
O << Indent << "WIDEN ";
if (!isStore()) {
- getVPValue()->printAsOperand(O, SlotTracker);
+ getVPSingleValue()->printAsOperand(O, SlotTracker);
O << " = ";
}
O << Instruction::getOpcodeName(Ingredient.getOpcode()) << " ";
@@ -1217,7 +1217,7 @@ void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) {
void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent,
VPSlotTracker &SlotTracker) const {
O << Indent << "EMIT ";
- getVPValue()->printAsOperand(O, SlotTracker);
+ getVPSingleValue()->printAsOperand(O, SlotTracker);
O << " = WIDEN-CANONICAL-INDUCTION";
}
#endif
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index cd0dd344f4c84..500a679f618f1 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -230,7 +230,7 @@ bool VPlanTransforms::mergeReplicateRegions(VPlan &Plan) {
auto IsImmovableRecipe = [](VPRecipeBase &R) {
assert(R.getNumDefinedValues() <= 1 &&
"no multi-defs are expected in predicated blocks");
- for (VPUser *U : R.getVPValue()->users()) {
+ for (VPUser *U : R.getVPSingleValue()->users()) {
auto *UI = dyn_cast<VPRecipeBase>(U);
if (!UI)
continue;
@@ -255,12 +255,12 @@ bool VPlanTransforms::mergeReplicateRegions(VPlan &Plan) {
for (VPRecipeBase &Phi1ToMove : make_early_inc_range(reverse(*Merge1))) {
VPValue *PredInst1 =
cast<VPPredInstPHIRecipe>(&Phi1ToMove)->getOperand(0);
- for (VPUser *U : Phi1ToMove.getVPValue()->users()) {
+ for (VPUser *U : Phi1ToMove.getVPSingleValue()->users()) {
auto *UI = dyn_cast<VPRecipeBase>(U);
if (!UI || UI->getParent() != Then2)
continue;
for (unsigned I = 0, E = U->getNumOperands(); I != E; ++I) {
- if (Phi1ToMove.getVPValue() != U->getOperand(I))
+ if (Phi1ToMove.getVPSingleValue() != U->getOperand(I))
continue;
U->setOperand(I, PredInst1);
}
diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h
index c4d05e38cbda5..866b0602e80c4 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -371,7 +371,7 @@ class VPDef {
assert(DefinedValues[I] && "defined value must be non-null");
return DefinedValues[I];
}
- const VPValue *getVPValue(unsigned I = 0) const {
+ const VPValue *getVPValue(unsigned I) const {
assert(DefinedValues[I] && "defined value must be non-null");
return DefinedValues[I];
}
More information about the llvm-commits
mailing list