Lines Matching refs:Def
83 VPValue::VPValue(const unsigned char SC, Value *UV, VPDef *Def)
84 : SubclassID(SC), UnderlyingVal(UV), Def(Def) {
85 if (Def)
86 Def->addDefinedValue(this);
91 if (Def)
92 Def->removeDefinedValue(this);
97 if (const VPRecipeBase *R = dyn_cast_or_null<VPRecipeBase>(Def))
104 const VPRecipeBase *Instr = dyn_cast_or_null<VPRecipeBase>(this->Def);
121 return cast_or_null<VPRecipeBase>(Def);
125 return cast_or_null<VPRecipeBase>(Def);
227 Value *VPTransformState::get(VPValue *Def, const VPIteration &Instance) {
228 if (Def->isLiveIn())
229 return Def->getLiveInIRValue();
231 if (hasScalarValue(Def, Instance)) {
233 .PerPartScalars[Def][Instance.Part][Instance.Lane.mapToCacheIndex(VF)];
236 vputils::isUniformAfterVectorization(Def) &&
237 hasScalarValue(Def, {Instance.Part, VPLane::getFirstLane()})) {
238 return Data.PerPartScalars[Def][Instance.Part][0];
241 assert(hasVectorValue(Def, Instance.Part));
242 auto *VecPart = Data.PerPartOutput[Def][Instance.Part];
250 // set(Def, Extract, Instance);
254 Value *VPTransformState::get(VPValue *Def, unsigned Part, bool NeedsScalar) {
256 assert((VF.isScalar() || Def->isLiveIn() || hasVectorValue(Def, Part) ||
257 !vputils::onlyFirstLaneUsed(Def) ||
258 (hasScalarValue(Def, VPIteration(Part, 0)) &&
259 Data.PerPartScalars[Def][Part].size() == 1)) &&
262 return get(Def, VPIteration(Part, 0));
265 // If Values have been set for this Def return the one relevant for \p Part.
266 if (hasVectorValue(Def, Part))
267 return Data.PerPartOutput[Def][Part];
269 auto GetBroadcastInstrs = [this, Def](Value *V) {
270 bool SafeToHoist = Def->isDefinedOutsideVectorRegions();
289 if (!hasScalarValue(Def, {Part, 0})) {
290 assert(Def->isLiveIn() && "expected a live-in");
292 return get(Def, 0);
293 Value *IRV = Def->getLiveInIRValue();
295 set(Def, B, Part);
299 Value *ScalarValue = get(Def, {Part, 0});
303 set(Def, ScalarValue, Part);
307 bool IsUniform = vputils::isUniformAfterVectorization(Def);
311 if (!hasScalarValue(Def, {Part, LastLane})) {
314 assert((isa<VPWidenIntOrFpInductionRecipe>(Def->getDefiningRecipe()) ||
315 isa<VPScalarIVStepsRecipe>(Def->getDefiningRecipe()) ||
316 isa<VPExpandSCEVRecipe>(Def->getDefiningRecipe())) &&
322 auto *LastInst = cast<Instruction>(get(Def, {Part, LastLane}));
342 set(Def, VectorValue, Part);
347 set(Def, Undef, Part);
349 packScalarIntoVectorValue(Def, {Part, Lane});
350 VectorValue = get(Def, Part);
401 void VPTransformState::packScalarIntoVectorValue(VPValue *Def,
403 Value *ScalarInst = get(Def, Instance);
404 Value *VectorValue = get(Def, Instance.Part);
407 set(Def, VectorValue, Instance.Part);
529 for (auto *Def : R.definedValues())
530 Def->replaceAllUsesWith(NewValue);
1568 for (VPValue *Def : Recipe.definedValues())
1569 assignName(Def);
1600 bool vputils::onlyFirstLaneUsed(const VPValue *Def) {
1601 return all_of(Def->users(),
1602 [Def](const VPUser *U) { return U->onlyFirstLaneUsed(Def); });
1605 bool vputils::onlyFirstPartUsed(const VPValue *Def) {
1606 return all_of(Def->users(),
1607 [Def](const VPUser *U) { return U->onlyFirstPartUsed(Def); });