+ unsigned char flags;
+
+ public:
+ typedef BumpPtrAllocator Allocator;
+
+ /// The ID number of this value.
+ unsigned id;
+
+ /// The index of the defining instruction (if isDefAccurate() returns true).
+ SlotIndex def;
+
+ /// VNInfo constructor.
+ VNInfo(unsigned i, SlotIndex d, MachineInstr *c)
+ : copy(c), flags(0), id(i), def(d)
+ { }
+
+ /// VNInfo construtor, copies values from orig, except for the value number.
+ VNInfo(unsigned i, const VNInfo &orig)
+ : copy(orig.copy), flags(orig.flags), id(i), def(orig.def)
+ { }
+
+ /// Copy from the parameter into this VNInfo.
+ void copyFrom(VNInfo &src) {
+ flags = src.flags;
+ copy = src.copy;
+ def = src.def;
+ }
+
+ /// Used for copying value number info.
+ unsigned getFlags() const { return flags; }
+ void setFlags(unsigned flags) { this->flags = flags; }
+
+ /// Merge flags from another VNInfo
+ void mergeFlags(const VNInfo *VNI) {
+ flags = (flags | VNI->flags) & ~IS_UNUSED;
+ }
+
+ /// For a register interval, if this VN was definied by a copy instr
+ /// getCopy() returns a pointer to it, otherwise returns 0.
+ /// For a stack interval the behaviour of this method is undefined.
+ MachineInstr* getCopy() const { return copy; }
+ /// For a register interval, set the copy member.
+ /// This method should not be called on stack intervals as it may lead to
+ /// undefined behavior.
+ void setCopy(MachineInstr *c) { copy = c; }
+
+ /// isDefByCopy - Return true when this value was defined by a copy-like
+ /// instruction as determined by MachineInstr::isCopyLike.
+ bool isDefByCopy() const { return copy != 0; }
+
+ /// Returns true if one or more kills are PHI nodes.
+ /// Obsolete, do not use!
+ bool hasPHIKill() const { return flags & HAS_PHI_KILL; }
+ /// Set the PHI kill flag on this value.
+ void setHasPHIKill(bool hasKill) {
+ if (hasKill)
+ flags |= HAS_PHI_KILL;
+ else
+ flags &= ~HAS_PHI_KILL;
+ }
+
+ /// Returns true if this value is re-defined by an early clobber somewhere
+ /// during the live range.
+ bool hasRedefByEC() const { return flags & REDEF_BY_EC; }
+ /// Set the "redef by early clobber" flag on this value.
+ void setHasRedefByEC(bool hasRedef) {
+ if (hasRedef)
+ flags |= REDEF_BY_EC;
+ else
+ flags &= ~REDEF_BY_EC;
+ }
+
+ /// Returns true if this value is defined by a PHI instruction (or was,
+ /// PHI instrucions may have been eliminated).
+ bool isPHIDef() const { return flags & IS_PHI_DEF; }
+ /// Set the "phi def" flag on this value.
+ void setIsPHIDef(bool phiDef) {
+ if (phiDef)
+ flags |= IS_PHI_DEF;
+ else
+ flags &= ~IS_PHI_DEF;
+ }
+
+ /// Returns true if this value is unused.
+ bool isUnused() const { return flags & IS_UNUSED; }
+ /// Set the "is unused" flag on this value.
+ void setIsUnused(bool unused) {
+ if (unused)
+ flags |= IS_UNUSED;
+ else
+ flags &= ~IS_UNUSED;
+ }