[PATCH] D20507: CodeGen: Refactor renameDisconnectedComponents() as a pass

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 15:38:56 PDT 2016


MatzeB marked 10 inline comments as done.

================
Comment at: lib/CodeGen/RenameIndependentSubregs.cpp:40
@@ +39,3 @@
+
+using namespace llvm;
+
----------------
qcolombet wrote:
> Could you add a DEBUG_TYPE and a few DEBUG statements in the pass to follow what is going on?
I added some DEBUG printing that tells you how many equivalence classes were found and into which newly created vregs they were distributed. I opted to not print anything for vregs where no independent classes could be found to keep the debug output small.

================
Comment at: lib/CodeGen/RenameIndependentSubregs.cpp:107
@@ +106,3 @@
+
+} // end anonymous namespace
+
----------------
qcolombet wrote:
> Period
I kept this as it is the officially recommended way in the llvm coding convention and what is done in most parts of llvm. I know it contradicts that other rule in the coding convention that states that you should write sentences ending in periods in your comments...

================
Comment at: lib/CodeGen/RenameIndependentSubregs.cpp:137
@@ +136,3 @@
+       ++I) {
+    unsigned NewVReg = MRI->createVirtualRegister(RegClass);
+    LiveInterval &NewLI = LIS->createEmptyInterval(NewVReg);
----------------
qcolombet wrote:
> Although the current implementation is correct, I was wondering what are your thoughts regarding relaxing the constraints on the register class and constraining them back when we rewrite the operands?
> I actually do not expect that we would get much more freedom for regalloc afterwards, but who knows.
> 
> Note: the current implementation is the right thing to do, I was thinking in terms of follow-up patch.
Yes this indeed something we could do in a follow-up commit, I added a TODO comment.
And for the record: We have the same issue in the LiveIntervals::splitSeparateComponents() code.


Repository:
  rL LLVM

http://reviews.llvm.org/D20507





More information about the llvm-commits mailing list