[PATCH] D14597: tablegen: Simple heuristic for better pressure set names

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 16:27:57 PST 2015


MatzeB created this revision.
MatzeB added a reviewer: atrick.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.

Repository:
  rL LLVM

http://reviews.llvm.org/D14597

Files:
  utils/TableGen/CodeGenRegisters.cpp

Index: utils/TableGen/CodeGenRegisters.cpp
===================================================================
--- utils/TableGen/CodeGenRegisters.cpp
+++ utils/TableGen/CodeGenRegisters.cpp
@@ -1574,6 +1574,12 @@
           && UnitWeight == RegUnits[SuperSet.Units.back()].Weight) {
         DEBUG(dbgs() << "UnitSet " << SubIdx << " subsumed by " << SuperIdx
               << "\n");
+        // We can pick any of the set names for the merged set. Go for the
+        // shortest one to avoid picking the name of one of the classes that are
+        // artificially created by tablegen. So "FPR128_lo" instead of
+        // "QQQQ_with_qsub3_in_FPR128_lo".
+        if (RegUnitSets[SubIdx].Name.size() < RegUnitSets[SuperIdx].Name.size())
+          RegUnitSets[SuperIdx].Name = RegUnitSets[SubIdx].Name;
         break;
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14597.39990.patch
Type: text/x-patch
Size: 840 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151112/318adb37/attachment.bin>


More information about the llvm-commits mailing list