[llvm] [VPlan] Remove Def pointer from for VPSingleDefRecipes (NFC) (PR #195483)
via llvm-commits
llvm-commits at lists.llvm.org
Wed May 13 01:07:50 PDT 2026
================
@@ -141,15 +146,21 @@ Value *VPValue::getLiveInIRValue() const {
Type *VPIRValue::getType() const { return getUnderlyingValue()->getType(); }
-VPRecipeValue::VPRecipeValue(VPRecipeBase *Def, Value *UV)
- : VPValue(VPVRecipeValueSC, UV), Def(Def) {
- assert(Def && "VPRecipeValue requires a defining recipe");
+VPSingleDefValue::VPSingleDefValue(VPSingleDefRecipe *Def, Value *UV)
+ : VPRecipeValue(VPVSingleDefValueSC, UV) {
+ assert(Def && "VPSingleDefValue requires a defining recipe");
+ Def->addDefinedValue(this);
+}
+
+VPRecipeValue::~VPRecipeValue() = default;
+
+VPStandaloneRecipeValue::VPStandaloneRecipeValue(VPRecipeBase *Def, Value *UV)
+ : VPRecipeValue(VPVStandaloneRecipeValueSC, UV), Def(Def) {
+ assert(Def && "VPStandaloneRecipeValue requires a defining recipe");
Def->addDefinedValue(this);
}
-VPRecipeValue::~VPRecipeValue() {
- assert(Users.empty() &&
- "trying to delete a VPRecipeValue with remaining users");
----------------
ayalz wrote:
Better retain, or remove separately, if unrelated.
https://github.com/llvm/llvm-project/pull/195483
More information about the llvm-commits
mailing list