From ca7d645a607cb2fd8c2e056f64a9e1cac17ea8bb Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 13 Nov 2015 22:30:27 +0000 Subject: [PATCH] tablegen: Add a simple heuristic to get better names for pressure sets Differential Revision: http://reviews.llvm.org/D14597 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253095 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeGenRegisters.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index f6eadce9c3d..0181f15d210 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -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; } } -- 2.34.1