llvm-project
d68056c4 - [MIR] Round-trip the "func" kind of inline asm operand flags (#237461)

Commit
23 hours ago
[MIR] Round-trip the "func" kind of inline asm operand flags (#237461) An x86 inline asm call or jmp whose target is a function, given as a "p" operand or as a "*m" operand that ISel turns into an address, gets a flag of kind Func. Like a Mem flag, it carries a memory constraint. But getKindName() returned "mem" for it, and the MIR printer printed the constraint only for a Mem flag. So this: call void asm sideeffect "call ${0:P}", "p,~{dirflag},~{fpsr},~{flags}"(ptr @g) was printed as: INLINEASM &"call ${0:P}", sideeffect attdialect, mem ops:5, target-flags(x86-plt) @g, 1, $noreg, 0, $noreg, ... which parses back as a Mem flag with no constraint. Printing that again hits llvm_unreachable, and the asm printer asserts in PrintMemReference() instead of emitting "callq g@PLT". MachineInstr::print() also printed the constraint as a register class (e.g. "mem:GR8_NOREX"). Name the kind "func", and print and parse its constraint as for a Mem flag. No in-tree test had a Func flag, so no existing tests change. Assisted-by: Claude Opus 5.5 --------- Co-authored-by: Matt Arsenault <Matthew.Arsenault@amd.com>
Author
Parents
Loading