[llvm] [VPlan] Add specialized VPValue subclasses for different types (NFC) (PR #172758)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 28 08:07:33 PST 2025
================
@@ -197,6 +173,52 @@ class LLVM_ABI_FOR_TEST VPValue {
LLVM_ABI_FOR_TEST raw_ostream &operator<<(raw_ostream &OS,
const VPRecipeBase &R);
+/// A VPValue representing a live-in from the input IR. It wraps an underlying
+/// IR Value.
+struct VPLiveIn : public VPValue {
+ VPLiveIn(Value *UV) : VPValue(VPVLiveInSC, UV, nullptr) {
+ assert(UV && "VPLiveIn requires an underlying IR value");
+ }
+
+ /// Returns the underlying IR value.
+ Value *getValue() const { return getUnderlyingValue(); }
+
+ /// Returns the type of the underlying IR value.
+ Type *getType() const;
+
+ static bool classof(const VPValue *V) {
+ return V->getVPValueID() == VPVLiveInSC;
+ }
+};
+
+/// A symbolic live-in VPValue, used for values like vector trip count, VF, and
+/// VFxUF.
+struct VPSymbolicValue : public VPValue {
+ VPSymbolicValue() : VPValue(VPVSymbolicSC, nullptr, nullptr) {}
+
+ static bool classof(const VPValue *V) {
+ return V->getVPValueID() == VPVSymbolicSC;
+ }
+};
+
+/// A VPValue defined by a recipe that produces multiple values.
+class VPDefValue : public VPValue {
+ friend class VPValue;
+ friend class VPDef;
+ /// Pointer to the VPDef that defines this VPValue. If it is nullptr, the
+ /// VPValue is not defined by any recipe modeled in VPlan.
----------------
fhahn wrote:
removed stale, leftover comment, thanks
https://github.com/llvm/llvm-project/pull/172758
More information about the llvm-commits
mailing list