[PATCH] Do not track subregister liveness when it brings no benefits

Quentin Colombet qcolombet at apple.com
Wed Mar 18 16:53:41 PDT 2015


Hi Matthias,

The change LGTM with a few minor nitpicks.

As a follow up I would like a way to specify in table gen that we do not want to track some specific register classes.
For those cases, we do not want to generate the lanemask if we can, but at first we could abuse this flag I guess.
Could you file a PR for that?

Thanks,
-Quentin


REPOSITORY
  rL LLVM

================
Comment at: include/llvm/CodeGen/MachineRegisterInfo.h:188
@@ +187,3 @@
+  bool shouldTrackSubRegLiveness(const TargetRegisterClass &RC) const {
+    return TracksSubRegLiveness && RC.HasDisjunctSubRegs;
+  }
----------------
Call subRegLivenessEnabled instead of checking the underlying variable.

================
Comment at: include/llvm/CodeGen/MachineRegisterInfo.h:191
@@ +190,3 @@
+  bool shouldTrackSubRegLiveness(unsigned VReg) const {
+    return shouldTrackSubRegLiveness(*getRegClass(VReg));
+  }
----------------
assert that VReg is a virtual register.

================
Comment at: lib/CodeGen/LiveIntervalAnalysis.cpp:203
@@ -203,1 +202,3 @@
+  bool TrackSubRegs = MRI->shouldTrackSubRegLiveness(LI.reg);
+  LRCalc->calculate(LI, TrackSubRegs);
   computeDeadValues(LI, nullptr);
----------------
The local variable seems useless.

http://reviews.llvm.org/D8429

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list