[PATCH] D60311: MIR printer should lowercase sub-register names to be in sync with parser?

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 01:29:10 PDT 2019


markus created this revision.
markus added reviewers: arphaman, MatzeB.
Herald added a subscriber: dexonsmith.
Herald added a project: LLVM.

The MIRParser seem to only expect lowercase sub-register names (see `PerTargetMIParsingState::initNames2SubRegIndices()`) but the MIRPrinter does not lowercase before printing.

Our target has some uppercase letters in sub-register names and as a result we cannot immediately import what was exported without first doing a manual lowercase of these letters.


Repository:
  rL LLVM

https://reviews.llvm.org/D60311

Files:
  lib/CodeGen/MachineOperand.cpp


Index: lib/CodeGen/MachineOperand.cpp
===================================================================
--- lib/CodeGen/MachineOperand.cpp
+++ lib/CodeGen/MachineOperand.cpp
@@ -764,7 +764,7 @@
     // Print the sub register.
     if (unsigned SubReg = getSubReg()) {
       if (TRI)
-        OS << '.' << TRI->getSubRegIndexName(SubReg);
+        OS << '.' << StringRef(TRI->getSubRegIndexName(SubReg)).lower();
       else
         OS << ".subreg" << SubReg;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60311.193843.patch
Type: text/x-patch
Size: 470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190405/8680791e/attachment.bin>


More information about the llvm-commits mailing list