[llvm] r360318 - Make sub-registers index names case sensitive in the MIRParser

Markus Lavin via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 01:29:04 PDT 2019


Author: markus
Date: Thu May  9 01:29:04 2019
New Revision: 360318

URL: http://llvm.org/viewvc/llvm-project?rev=360318&view=rev
Log:
Make sub-registers index names case sensitive in the MIRParser

Prior to this change sub-register index names are assumed to be lower
case (but they are printed with original casing). This means that if a
target has some upper case characters in its sub-register names then
mir-export directly followed by mir-import is not possible. This also
means that sub-register indices currently are (and will continue to be)
slightly inconsistent with register names which are printed and assumed
to be lower case.

As the current textual representation of mir has a few inconsistencies
in this area it is a bit arbitrary how to address the matter. This
change is towards the direction that we feel is most correct (i.e. case
sensitivity).

Differential Revision: https://reviews.llvm.org/D61499

Modified:
    llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp

Modified: llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp?rev=360318&r1=360317&r2=360318&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp (original)
+++ llvm/trunk/lib/CodeGen/MIRParser/MIParser.cpp Thu May  9 01:29:04 2019
@@ -176,7 +176,7 @@ void PerTargetMIParsingState::initNames2
   const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();
   for (unsigned I = 1, E = TRI->getNumSubRegIndices(); I < E; ++I)
     Names2SubRegIndices.insert(
-        std::make_pair(StringRef(TRI->getSubRegIndexName(I)).lower(), I));
+        std::make_pair(TRI->getSubRegIndexName(I), I));
 }
 
 unsigned PerTargetMIParsingState::getSubRegIndex(StringRef Name) {




More information about the llvm-commits mailing list