[PATCH] D47999: cl::opt ForceTrackRegLiveness for forcing liveness tracking on MIR (in MIR-Parser)

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 10 19:42:49 PDT 2018


plotfi created this revision.
plotfi added reviewers: bogner, thegameg, qcolombet.
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D47999

Files:
  lib/CodeGen/MIRParser/MIRParser.cpp
  test/CodeGen/MIR/X86/force-liveness-track.mir


Index: test/CodeGen/MIR/X86/force-liveness-track.mir
===================================================================
--- /dev/null
+++ test/CodeGen/MIR/X86/force-liveness-track.mir
@@ -0,0 +1,14 @@
+# RUN: llc -o - %s -mtriple=x86_64 -force-mir-reg-liveness-tracking=1 | FileCheck %s
+---
+# CHECK: xorl  %eax, %eax
+# CHECK: movl  %eax, (%rcx)
+# CHECK: retq
+name: func0
+tracksRegLiveness: false
+body: |
+  bb.0:
+    %0 : gr32 = MOV32r0 implicit-def $eflags
+    dead %1 : gr32 = COPY %0
+    MOV32mr undef $rcx, 1, _, 0, _, killed %0 :: (volatile store 4)
+    RETQ undef $eax
+...
Index: lib/CodeGen/MIRParser/MIRParser.cpp
===================================================================
--- lib/CodeGen/MIRParser/MIRParser.cpp
+++ lib/CodeGen/MIRParser/MIRParser.cpp
@@ -44,6 +44,11 @@
 
 using namespace llvm;
 
+static cl::opt<bool>
+ForceTrackRegLiveness("force-mir-reg-liveness-tracking", cl::Hidden,
+                      cl::desc("Force MIR Register Liveness Tracking."),
+                      cl::init(false));
+
 namespace llvm {
 
 /// This class implements the parsing of LLVM IR that's embedded inside a MIR
@@ -431,7 +436,7 @@
   MachineFunction &MF = PFS.MF;
   MachineRegisterInfo &RegInfo = MF.getRegInfo();
   assert(RegInfo.tracksLiveness());
-  if (!YamlMF.TracksRegLiveness)
+  if (!YamlMF.TracksRegLiveness && !ForceTrackRegLiveness)
     RegInfo.invalidateLiveness();
 
   SMDiagnostic Error;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47999.150672.patch
Type: text/x-patch
Size: 1432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180611/3f1bc6a2/attachment.bin>


More information about the llvm-commits mailing list