1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +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 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

View File

@ -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);
}

View File

@ -371,7 +371,7 @@ public:
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];
}