[PATCH] D22397: MIRParser: Rewrite register info initialization; mostly NFC

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 17:52:22 PDT 2016


MatzeB marked 5 inline comments as done.
MatzeB added a comment.

Thanks for the review! New patch is coming.


================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:52
@@ +51,3 @@
+    for (unsigned I = MRI.getNumVirtRegs(); I < VRegIndex+1; ++I)
+      MRI.createIncompleteVirtualRegister();
+  }
----------------
qcolombet wrote:
> Could we maintain a map of "virtual ID” to actual vreg number instead of creating a bunch of useless ones?
> Although, that’s probably cheap, I don’t like the idea of a bunch of undef registers in the middle.
> 
> Also, that should reduce the number of incomplete virtual registers, since we would create registers only at use/def points and we will know the register class there for the most part.
I went without a map to give the user control over the exact vreg numbers he will end up with.
Thinking about this some more it is probably not an important feature to have and having a map does indeed simplify writing down some tests.

================
Comment at: lib/CodeGen/MachineFunctionAnalysis.cpp:58
@@ -54,1 +57,3 @@
+    }
+  }
   return false;
----------------
qcolombet wrote:
> Unrelated to the patch (+ I pushed a fix for that yesterday ;))
that went in by accident.

================
Comment at: test/CodeGen/MIR/X86/unused-virtual-register.mir:14
@@ -13,2 +13,3 @@
 ---
+# CHECK: Unused virtual register 0 in function 'test'
 name:            test
----------------
qcolombet wrote:
> I would get rid of that test. I basically don’t care if we don’t use dense numbering.
Obsolete and removed with the new patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D22397





More information about the llvm-commits mailing list