[llvm-branch-commits] [llvm] [Sparc][MC] Use CoerceFromRegClass instead of validateTargetOperandClass (PR #245073)
Brad Smith via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Nov 22 18:13:00 PST 2026
brad0 wrote:
LGTM. I built before/after and checked with llvm-mc and llc. Accept/reject and encodings are the same for all the odd/misaligned cases I tried (IntPair, DFP, QFP, CoprocPair, sparc and sparcv9). The only change is %sp/%fp for the o6/i6 pair, which matches binutils. Inline asm {o6}/{i6}/{r14}/{r30} still resolve the same.
A few small things:
- There are no MC tests for misaligned pairs. Can you add a few error tests (ldd %o7, faddd %f1, faddq %f2/%f34, ldd %c1)? Nothing else tests this now that the % 2 / % 4 checks are gone.
- In matchRegisterName, the comment at the top of the if (Reg) block is stale. "%i6" no longer matches anything in the generated matcher, and the canonicalization it describes is gone. Maybe something like: "Some registers share a spelling (e.g. "f0" for F0/D0/Q0, "sp" for O6/O6_O7). PositionOrder in SparcRegisterInfo.td makes the generated matcher return the canonical one."
- The QFPRegs assert is still right, but "handle them in a similar way" points at code that was removed. Maybe just say the generated matcher never returns QFP registers because of PositionOrder.
https://github.com/llvm/llvm-project/pull/245073
More information about the llvm-branch-commits
mailing list