// A store of a loop varying value to a loop invariant address only
// needs only the last copy of the store.
- if (isa<StoreInst>(UI) && !getOperand(1)->getDefiningRecipe()) {
+ if (isa<StoreInst>(UI) && !getOperand(1)->hasDefiningRecipe()) {
auto Lane = VPLane::getLastLaneForVF(State.VF);
State.ILV->scalarizeInstruction(UI, this, VPIteration(State.UF - 1, Lane), IsPredicated,
State);
}
Value *VPTransformState::get(VPValue *Def, const VPIteration &Instance) {
- if (!Def->getDefiningRecipe())
+ if (!Def->hasDefiningRecipe())
return Def->getLiveInIRValue();
if (hasScalarValue(Def, Instance)) {
if (CanIV->getStartValue() != getStartValue())
return false;
auto *StepVPV = getStepValue();
- if (StepVPV->getDefiningRecipe())
+ if (StepVPV->hasDefiningRecipe())
return false;
auto *StepC = dyn_cast_or_null<ConstantInt>(StepVPV->getLiveInIRValue());
return StepC && StepC->isOne();
VPRecipeBase *getDefiningRecipe();
const VPRecipeBase *getDefiningRecipe() const;
+ /// Returns true if this VPValue is defined by a recipe.
+ bool hasDefiningRecipe() const { return getDefiningRecipe(); }
+
/// Returns the underlying IR value, if this VPValue is defined outside the
/// scope of VPlan. Returns nullptr if the VPValue is defined by a VPDef
/// inside a VPlan.
Value *getLiveInIRValue() {
- assert(!getDefiningRecipe() &&
+ assert(!hasDefiningRecipe() &&
"VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
return getUnderlyingValue();
}
const Value *getLiveInIRValue() const {
- assert(!getDefiningRecipe() &&
+ assert(!hasDefiningRecipe() &&
"VPValue is not a live-in; it is defined by a VPDef inside a VPlan");
return getUnderlyingValue();
}
/// Returns true if the VPValue is defined outside any vector regions, i.e. it
/// is a live-in value.
/// TODO: Also handle recipes defined in pre-header blocks.
- bool isDefinedOutsideVectorRegions() const { return !getDefiningRecipe(); }
+ bool isDefinedOutsideVectorRegions() const { return !hasDefiningRecipe(); }
};
typedef DenseMap<Value *, VPValue *> Value2VPValueTy;