summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp28
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp4
2 files changed, 15 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index a8475d29827..52f9a1d27a6 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -57,20 +57,17 @@ void MachineFunctionInitializer::anchor() {}
void MachineFunctionProperties::print(raw_ostream &ROS) const {
// Leave this function even in NDEBUG as an out-of-line anchor.
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
- if (!Properties.any()) {
- ROS << "(empty)";
- return;
- }
for (BitVector::size_type i = 0; i < Properties.size(); ++i) {
- if (Properties[i]) {
- switch(static_cast<Property>(i)) {
- case Property::AllVRegsAllocated:
- ROS << "AllVRegsAllocated ";
- break;
- default:
- // TODO: Implement IsSSA/TracksLiveness when we make them properties.
- llvm_unreachable("Unexpected value for property enum");
- }
+ bool HasProperty = Properties[i];
+ switch(static_cast<Property>(i)) {
+ case Property::IsSSA:
+ ROS << (HasProperty ? "SSA, " : "Post SSA, ");
+ break;
+ case Property::AllVRegsAllocated:
+ ROS << (HasProperty ? "AllVRegsAllocated" : "HasVRegs");
+ break;
+ default:
+ break;
}
}
#endif
@@ -91,6 +88,8 @@ 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.
+ Properties.set(MachineFunctionProperties::Property::IsSSA);
if (STI->getRegisterInfo())
RegInfo = new (Allocator) MachineRegisterInfo(this);
else
@@ -396,9 +395,8 @@ void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const {
getProperties().print(OS);
OS << "> : ";
if (RegInfo) {
- OS << (RegInfo->isSSA() ? "SSA" : "Post SSA");
if (!RegInfo->tracksLiveness())
- OS << ", not tracking liveness";
+ OS << "not tracking liveness";
}
OS << '\n';
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index 8521bee82e6..536577cc9f3 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -24,8 +24,8 @@ using namespace llvm;
// Pin the vtable to this file.
void MachineRegisterInfo::Delegate::anchor() {}
-MachineRegisterInfo::MachineRegisterInfo(const MachineFunction *MF)
- : MF(MF), TheDelegate(nullptr), IsSSA(true), TracksLiveness(true),
+MachineRegisterInfo::MachineRegisterInfo(MachineFunction *MF)
+ : MF(MF), TheDelegate(nullptr), TracksLiveness(true),
TracksSubRegLiveness(false) {
unsigned NumRegs = getTargetRegisterInfo()->getNumRegs();
VRegInfo.reserve(256);
OpenPOWER on IntegriCloud