[llvm] [MIRParser] Accept sub-register for implicit operand verification (PR #180707)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 04:18:26 PST 2026


tyb0807 wrote:

Thanks for the feedback. I agree that `RegisterByHwMode` would be the proper solution (IIUC, having the `MCInstrDesc` declare the correct register per HwMode would eliminate the mismatch at the source rather than patching around it in the parser).

However I looked into what that would take. The TableGen side is straightforward, as we just need to mirror the existing `RegClassByHwMode` pattern. The harder part is the runtime plumbing: IIUC, again, `implicit_uses` / `implicit_defs` in `MCInstrDesc.h` would need to become HwMode-aware, and a quick grep shows that there are ~100 call sites across ~40 files that would all need HwMode context threaded through.

Would you be okay with landing this as an interim fix while `RegisterByHwMode` is worked on? The MIR round-trip is currently broken for wave32 instructions that use `$vcc_lo`, and the proper fix is a significantly larger effort.

https://github.com/llvm/llvm-project/pull/180707


More information about the llvm-commits mailing list