[PATCH] D14994: Enable MatchRegisterName to match register altnames

Sid Manning via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 12:58:06 PST 2016


sidneym added a subscriber: sidneym.

================
Comment at: lib/Target/Hexagon/HexagonRegisterInfo.td:94
@@ -90,2 +93,3 @@
 
+  let RegAltNameIndices = [regaltname] in {
   def R29 : Ri<29, "r29", ["sp"]>, DwarfRegNum<[29]>;
----------------
If RegAltNameIndices is needed then the registers below will need the same treatment.

================
Comment at: lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h:37
@@ -37,1 +36,3 @@
+  static const char *getRegisterName(unsigned RegNo,
+                                     unsigned AltIdx = Hexagon::NoRegAltName);
   void printRegName(raw_ostream &O, unsigned RegNo) const override;
----------------
Shouldn't the primary name always be favored over the alternate?

================
Comment at: utils/TableGen/AsmMatcherEmitter.cpp:2214
@@ +2213,3 @@
+      unsigned AltNameIndex = 0;
+      for (const Record *RegAltNameIndex : RegAltNameIndices) {
+        if (AltNames.size() <= AltNameIndex)
----------------
So this change permits multiple possible alternates?  Is that needed, can it just check if !AltNames.empty()?


http://reviews.llvm.org/D14994





More information about the llvm-commits mailing list