diff options
author | Matthias Braun <matze@braunis.de> | 2017-01-05 20:01:19 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2017-01-05 20:01:19 +0000 |
commit | 1172332203b2074d8f2527ca07afcfb3f2678e27 (patch) | |
tree | 4e35a672882d49439613396bc63fcaf85ea9331e /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | e8e11eb7268a5078c88f30dd9e53c9317de1241d (diff) | |
download | bcm5719-llvm-1172332203b2074d8f2527ca07afcfb3f2678e27.tar.gz bcm5719-llvm-1172332203b2074d8f2527ca07afcfb3f2678e27.zip |
CodeGen: Assert that liveness is up to date when reading block live-ins.
Add an assert that checks whether liveins are up to date before they are
used.
- Do not print liveins into .mir files anymore in situations where they
are out of date anyway.
- The assert in the RegisterScavenger is superseded by the new one in
livein_begin().
- Skip parts of the liveness updating logic in IfConversion.cpp when
liveness isn't tracked anymore (just enough to avoid hitting the new
assert()).
Differential Revision: https://reviews.llvm.org/D27562
llvm-svn: 291169
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 549424d257f..3869f976854 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -286,7 +286,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, if (!livein_empty()) { if (Indexes) OS << '\t'; OS << " Live Ins:"; - for (const auto &LI : make_range(livein_begin(), livein_end())) { + for (const auto &LI : LiveIns) { OS << ' ' << PrintReg(LI.PhysReg, TRI); if (!LI.LaneMask.all()) OS << ':' << PrintLaneMask(LI.LaneMask); @@ -1292,3 +1292,10 @@ MachineBasicBlock::getEndClobberMask(const TargetRegisterInfo *TRI) const { void MachineBasicBlock::clearLiveIns() { LiveIns.clear(); } + +MachineBasicBlock::livein_iterator MachineBasicBlock::livein_begin() const { + assert(getParent()->getProperties().hasProperty( + MachineFunctionProperties::Property::TracksLiveness) && + "Liveness information is accurate"); + return LiveIns.begin(); +} |