Replace MachineRegisterInfo::TracksLiveness with a MachineFunctionProperty

Use the MachineFunctionProperty mechanism to indicate whether the
liveness info is accurate instead of a bool flag on MRI.
Keeps the MRI accessor function for convenience. NFC

Differential Revision: http://reviews.llvm.org/D18767

llvm-svn: 266020
This commit is contained in:
Derek Schuff
2016-04-11 23:32:13 +00:00
parent 74c0c09666
commit f7b2bce1f1
4 changed files with 25 additions and 27 deletions

View File

@@ -63,6 +63,9 @@ void MachineFunctionProperties::print(raw_ostream &ROS) const {
case Property::IsSSA:
ROS << (HasProperty ? "SSA, " : "Post SSA, ");
break;
case Property::TracksLiveness:
ROS << (HasProperty ? "" : "not ") << "tracking liveness, ";
break;
case Property::AllVRegsAllocated:
ROS << (HasProperty ? "AllVRegsAllocated" : "HasVRegs");
break;
@@ -95,8 +98,9 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
unsigned FunctionNum, MachineModuleInfo &mmi)
: Fn(F), Target(TM), STI(TM.getSubtargetImpl(*F)), Ctx(mmi.getContext()),
MMI(mmi) {
// Assume the function starts in SSA form.
// Assume the function starts in SSA form with correct liveness.
Properties.set(MachineFunctionProperties::Property::IsSSA);
Properties.set(MachineFunctionProperties::Property::TracksLiveness);
if (STI->getRegisterInfo())
RegInfo = new (Allocator) MachineRegisterInfo(this);
else
@@ -404,12 +408,7 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
OS << "# Machine code for function " << getName() << ": ";
OS << "Properties: <";
getProperties().print(OS);
OS << "> : ";
if (RegInfo) {
if (!RegInfo->tracksLiveness())
OS << "not tracking liveness";
}
OS << '\n';
OS << ">\n";
// Print Frame Information
FrameInfo->print(*this, OS);