1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[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.
This commit is contained in:
Florian Hahn 2021-07-11 22:00:44 +02:00
parent 51f3472bbd
commit ac14d3966e
3 changed files with 11 additions and 11 deletions

View File

@ -516,7 +516,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
} }
case VPReplicateSC: case VPReplicateSC:
case VPWidenCallSC: case VPWidenCallSC:
return cast<Instruction>(getVPValue()->getUnderlyingValue()) return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
->mayWriteToMemory(); ->mayWriteToMemory();
case VPBranchOnMaskSC: case VPBranchOnMaskSC:
return false; return false;
@ -529,7 +529,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
case VPReductionSC: case VPReductionSC:
case VPWidenSelectSC: { case VPWidenSelectSC: {
const Instruction *I = const Instruction *I =
dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue()); dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I; (void)I;
assert((!I || !I->mayWriteToMemory()) && assert((!I || !I->mayWriteToMemory()) &&
"underlying instruction may write to memory"); "underlying instruction may write to memory");
@ -547,7 +547,7 @@ bool VPRecipeBase::mayReadFromMemory() const {
} }
case VPReplicateSC: case VPReplicateSC:
case VPWidenCallSC: case VPWidenCallSC:
return cast<Instruction>(getVPValue()->getUnderlyingValue()) return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
->mayReadFromMemory(); ->mayReadFromMemory();
case VPBranchOnMaskSC: case VPBranchOnMaskSC:
return false; return false;
@ -560,7 +560,7 @@ bool VPRecipeBase::mayReadFromMemory() const {
case VPReductionSC: case VPReductionSC:
case VPWidenSelectSC: { case VPWidenSelectSC: {
const Instruction *I = const Instruction *I =
dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue()); dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I; (void)I;
assert((!I || !I->mayReadFromMemory()) && assert((!I || !I->mayReadFromMemory()) &&
"underlying instruction may read from memory"); "underlying instruction may read from memory");
@ -584,7 +584,7 @@ bool VPRecipeBase::mayHaveSideEffects() const {
case VPReductionSC: case VPReductionSC:
case VPWidenSelectSC: { case VPWidenSelectSC: {
const Instruction *I = const Instruction *I =
dyn_cast_or_null<Instruction>(getVPValue()->getUnderlyingValue()); dyn_cast_or_null<Instruction>(getVPSingleValue()->getUnderlyingValue());
(void)I; (void)I;
assert((!I || !I->mayHaveSideEffects()) && assert((!I || !I->mayHaveSideEffects()) &&
"underlying instruction has side-effects"); "underlying instruction has side-effects");
@ -1179,7 +1179,7 @@ void VPWidenMemoryInstructionRecipe::print(raw_ostream &O, const Twine &Indent,
O << Indent << "WIDEN "; O << Indent << "WIDEN ";
if (!isStore()) { if (!isStore()) {
getVPValue()->printAsOperand(O, SlotTracker); getVPSingleValue()->printAsOperand(O, SlotTracker);
O << " = "; O << " = ";
} }
O << Instruction::getOpcodeName(Ingredient.getOpcode()) << " "; O << Instruction::getOpcodeName(Ingredient.getOpcode()) << " ";
@ -1217,7 +1217,7 @@ void VPWidenCanonicalIVRecipe::execute(VPTransformState &State) {
void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent, void VPWidenCanonicalIVRecipe::print(raw_ostream &O, const Twine &Indent,
VPSlotTracker &SlotTracker) const { VPSlotTracker &SlotTracker) const {
O << Indent << "EMIT "; O << Indent << "EMIT ";
getVPValue()->printAsOperand(O, SlotTracker); getVPSingleValue()->printAsOperand(O, SlotTracker);
O << " = WIDEN-CANONICAL-INDUCTION"; O << " = WIDEN-CANONICAL-INDUCTION";
} }
#endif #endif

View File

@ -230,7 +230,7 @@ bool VPlanTransforms::mergeReplicateRegions(VPlan &Plan) {
auto IsImmovableRecipe = [](VPRecipeBase &R) { auto IsImmovableRecipe = [](VPRecipeBase &R) {
assert(R.getNumDefinedValues() <= 1 && assert(R.getNumDefinedValues() <= 1 &&
"no multi-defs are expected in predicated blocks"); "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); auto *UI = dyn_cast<VPRecipeBase>(U);
if (!UI) if (!UI)
continue; continue;
@ -255,12 +255,12 @@ bool VPlanTransforms::mergeReplicateRegions(VPlan &Plan) {
for (VPRecipeBase &Phi1ToMove : make_early_inc_range(reverse(*Merge1))) { for (VPRecipeBase &Phi1ToMove : make_early_inc_range(reverse(*Merge1))) {
VPValue *PredInst1 = VPValue *PredInst1 =
cast<VPPredInstPHIRecipe>(&Phi1ToMove)->getOperand(0); cast<VPPredInstPHIRecipe>(&Phi1ToMove)->getOperand(0);
for (VPUser *U : Phi1ToMove.getVPValue()->users()) { for (VPUser *U : Phi1ToMove.getVPSingleValue()->users()) {
auto *UI = dyn_cast<VPRecipeBase>(U); auto *UI = dyn_cast<VPRecipeBase>(U);
if (!UI || UI->getParent() != Then2) if (!UI || UI->getParent() != Then2)
continue; continue;
for (unsigned I = 0, E = U->getNumOperands(); I != E; ++I) { for (unsigned I = 0, E = U->getNumOperands(); I != E; ++I) {
if (Phi1ToMove.getVPValue() != U->getOperand(I)) if (Phi1ToMove.getVPSingleValue() != U->getOperand(I))
continue; continue;
U->setOperand(I, PredInst1); U->setOperand(I, PredInst1);
} }

View File

@ -371,7 +371,7 @@ public:
assert(DefinedValues[I] && "defined value must be non-null"); assert(DefinedValues[I] && "defined value must be non-null");
return DefinedValues[I]; 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"); assert(DefinedValues[I] && "defined value must be non-null");
return DefinedValues[I]; return DefinedValues[I];
} }