[llvm] r253095 - tablegen: Add a simple heuristic to get better names for pressure sets
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 13 14:30:27 PST 2015
Author: matze
Date: Fri Nov 13 16:30:27 2015
New Revision: 253095
URL: http://llvm.org/viewvc/llvm-project?rev=253095&view=rev
Log:
tablegen: Add a simple heuristic to get better names for pressure sets
Differential Revision: http://reviews.llvm.org/D14597
Modified:
llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.cpp?rev=253095&r1=253094&r2=253095&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenRegisters.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenRegisters.cpp Fri Nov 13 16:30:27 2015
@@ -1574,6 +1574,12 @@ void CodeGenRegBank::pruneUnitSets() {
&& 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;
}
}
More information about the llvm-commits
mailing list