[PATCH] D14966: LiveIntervalAnalysis: Add function to reassign vregs of dead subregister defs
Andrew Trick via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 29 22:27:29 PST 2015
atrick requested changes to this revision.
atrick added a comment.
This revision now requires changes to proceed.
LGTM except for the inline comments.
================
Comment at: lib/CodeGen/LiveIntervalAnalysis.cpp:1481
@@ +1480,3 @@
+
+void LiveIntervals::renameDeadSubRegDefs() {
+ for (size_t I = 0, E = MRI->getNumVirtRegs(); I < E; ++I) {
----------------
This function needs comments reflecting some of what is explained in the commit message. It should be clear that this is an optimization not required for correctness.
================
Comment at: lib/CodeGen/LiveIntervalAnalysis.cpp:1498
@@ +1497,3 @@
+ SlotIndex Def = VNI->def;
+ unsigned Reg = LI->reg;
+ // Do we only have dead (subregister) defs at VNI->def?
----------------
This shadows 'Reg' above. It should probably be an assert.
================
Comment at: lib/CodeGen/LiveIntervalAnalysis.cpp:1528
@@ +1527,3 @@
+ MO.setReg(NewVReg);
+ MO.setIsUndef();
+ MO.setIsDead();
----------------
setIsUndef confused me at first. You must be assuming here that this is a subregister def and that subreg defs are always marked undef. Please comment. Also let me know where that invariant is explained and enforced.
Repository:
rL LLVM
http://reviews.llvm.org/D14966
More information about the llvm-commits
mailing list