[PATCH] D43916: Named VReg support for MIR

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 13:10:44 PDT 2018


thegameg added inline comments.


================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:986
+    return error(Twine("unknown register name '") + Name + "'");
+
+  lex();
----------------
I think the code would be much simpler if we do the same thing as parseVirtualRegister here. By that I mean call createIncompleteVirtualRegister, create a VRegInfo object without any reg class, then let the rest of the code parse the reg class and follow the usual path. I also think that you don't need to explicitly parse the reg class in this function since the user will get an error like `Cannot determine class/bank of virtual register` if no reg class is specified at def time anyway. This would allow you to get rid of the other change you have where you conditionally lex things.

Please let me know if what I'm saying doesn't make sense in this case as I haven't really tried to implement this.


Repository:
  rL LLVM

https://reviews.llvm.org/D43916





More information about the llvm-commits mailing list