[llvm] r336481 - [MachineOutliner] Assert that Liveness tracking is accurate (NFC)

Yvan Roux via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 7 01:02:19 PDT 2018


Author: yroux
Date: Sat Jul  7 01:02:19 2018
New Revision: 336481

URL: http://llvm.org/viewvc/llvm-project?rev=336481&view=rev
Log:
[MachineOutliner] Assert that Liveness tracking is accurate (NFC)

The checking is done deeper inside MachineBasicBlock, but this will
hopefully help to find issues when porting the machine outliner to a
target where Liveness tracking is broken (like ARM).

Differential Revision: https://reviews.llvm.org/D49023

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineOutliner.h
    llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineOutliner.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOutliner.h?rev=336481&r1=336480&r2=336481&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineOutliner.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineOutliner.h Sat Jul  7 01:02:19 2018
@@ -142,6 +142,8 @@ public:
   /// If a target does not need this information, then this should not be
   /// called.
   void initLRU(const TargetRegisterInfo &TRI) {
+    assert(MBB->getParent()->getRegInfo().tracksLiveness() &&
+           "Candidate's Machine Function must track liveness");
     LRU.init(TRI);
     LRU.addLiveOuts(*MBB);
 

Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=336481&r1=336480&r2=336481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Sat Jul  7 01:02:19 2018
@@ -5065,6 +5065,8 @@ AArch64InstrInfo::getMachineOutlinerMBBF
 
   // Check if LR is available through all of the MBB. If it's not, then set
   // a flag.
+  assert(MBB.getParent()->getRegInfo().tracksLiveness() &&
+         "Suitable Machine Function for outlining must track liveness");
   LiveRegUnits LRU(getRegisterInfo());
   LRU.addLiveOuts(MBB);
 




More information about the llvm-commits mailing list