[llvm] [WIP][RFC] Teach MCA constant registers do not create dependencies (PR #89387)
Rin Dobrescu via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 19 08:13:48 PDT 2024
================
@@ -977,7 +977,8 @@ void RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
<< DiffSeqs.get(SubRegLists[i]) << ", " << DiffSeqs.get(SuperRegLists[i])
<< ", " << SubRegIdxSeqs.get(SubRegIdxLists[i]) << ", "
<< (Offset << RegUnitBits | FirstRU) << ", "
- << LaneMaskSeqs.get(RegUnitLaneMasks[i]) << " },\n";
+ << LaneMaskSeqs.get(RegUnitLaneMasks[i]) << ", " << Reg.Constant
----------------
Rin18 wrote:
This change manifests by setting the `bool Constant` variable in MCRegisterDesc as true for constant registers. It can be observed when .inc files are generated. We go from elements in the array of MCRegisterDesc <Target>RegDesc[] looking like this:
` {uint32_t Name, uint32_t SubRegs, uint32_t SuperRegs, uint32_t SubRegIndices, uint32_t RegUnits, uint16_t RegUnitLaneMasks}`
To this:
` {uint32_t Name, uint32_t SubRegs, uint32_t SuperRegs, uint32_t SubRegIndices, uint32_t RegUnits, uint16_t RegUnitLaneMasks, bool Constant}`
We then check if a given register is constant and skip it. I've precommited the V1-zero-dependency.s test to showcase the effect of this patch. Comparing the test in the two commits there is a higher IPC and the timeline view shows the zero register no longer creates dependencies when this patch is applied.
https://github.com/llvm/llvm-project/pull/89387
More information about the llvm-commits
mailing list