Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames
2010-09-25 12:04:16 +00:00
parent 8db2defa83
commit 6e2968c85c
11 changed files with 78 additions and 104 deletions

View File

@ -39,25 +39,13 @@ namespace llvm {
/// This class holds information about a machine level values, including
/// definition and use points.
///
/// Care must be taken in interpreting the def index of the value. The
/// following rules apply:
///
/// If the isDefAccurate() method returns false then def does not contain the
/// index of the defining MachineInstr, or even (necessarily) to a
/// MachineInstr at all. In general such a def index is not meaningful
/// and should not be used. The exception is that, for values originally
/// defined by PHI instructions, after PHI elimination def will contain the
/// index of the MBB in which the PHI originally existed. This can be used
/// to insert code (spills or copies) which deals with the value, which will
/// be live in to the block.
class VNInfo {
private:
enum {
HAS_PHI_KILL = 1,
REDEF_BY_EC = 1 << 1,
IS_PHI_DEF = 1 << 2,
IS_UNUSED = 1 << 3,
IS_DEF_ACCURATE = 1 << 4
IS_UNUSED = 1 << 3
};
MachineInstr *copy;
@ -73,10 +61,8 @@ namespace llvm {
SlotIndex def;
/// VNInfo constructor.
/// d is presumed to point to the actual defining instr. If it doesn't
/// setIsDefAccurate(false) should be called after construction.
VNInfo(unsigned i, SlotIndex d, MachineInstr *c)
: copy(c), flags(IS_DEF_ACCURATE), id(i), def(d)
: copy(c), flags(0), id(i), def(d)
{ }
/// VNInfo construtor, copies values from orig, except for the value number.
@ -145,16 +131,6 @@ namespace llvm {
else
flags &= ~IS_UNUSED;
}
/// Returns true if the def is accurate.
bool isDefAccurate() const { return flags & IS_DEF_ACCURATE; }
/// Set the "is def accurate" flag on this value.
void setIsDefAccurate(bool defAccurate) {
if (defAccurate)
flags |= IS_DEF_ACCURATE;
else
flags &= ~IS_DEF_ACCURATE;
}
};
/// LiveRange structure - This represents a simple register range in the
@ -320,10 +296,9 @@ namespace llvm {
/// getNextValue - Create a new value number and return it. MIIdx specifies
/// the instruction that defines the value number.
VNInfo *getNextValue(SlotIndex def, MachineInstr *CopyMI,
bool isDefAccurate, VNInfo::Allocator &VNInfoAllocator) {
VNInfo::Allocator &VNInfoAllocator) {
VNInfo *VNI =
new (VNInfoAllocator) VNInfo((unsigned)valnos.size(), def, CopyMI);
VNI->setIsDefAccurate(isDefAccurate);
valnos.push_back(VNI);
return VNI;
}