[PATCH] D49023: [MachineOutliner] Assert that Liveness tracking is accurate (NFC)

Yvan Roux via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 07:31:24 PDT 2018


yroux created this revision.
yroux added a reviewer: paquette.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

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) .


Repository:
  rL LLVM

https://reviews.llvm.org/D49023

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


Index: lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- lib/Target/AArch64/AArch64InstrInfo.cpp
+++ lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5065,6 +5065,7 @@
 
   // Check if LR is available through all of the MBB. If it's not, then set
   // a flag.
+  assert(MBB->getParent()->getRegInfo().tracksLiveness());
   LiveRegUnits LRU(getRegisterInfo());
   LRU.addLiveOuts(MBB);
 
Index: include/llvm/CodeGen/MachineOutliner.h
===================================================================
--- include/llvm/CodeGen/MachineOutliner.h
+++ include/llvm/CodeGen/MachineOutliner.h
@@ -142,6 +142,7 @@
   /// If a target does not need this information, then this should not be
   /// called.
   void initLRU(const TargetRegisterInfo &TRI) {
+    assert(MBB->getParent()->getRegInfo().tracksLiveness());
     LRU.init(TRI);
     LRU.addLiveOuts(*MBB);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49023.154400.patch
Type: text/x-patch
Size: 916 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180706/584fe5f4/attachment.bin>


More information about the llvm-commits mailing list