[llvm] [X86][MC] Report error when the instruction length exceeds 15 bytes (PR #83708)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 05:20:16 PST 2024


phoebewang wrote:

> @KanRobert Thank you for the explanation!
> 
> > We usually don't verify the inline asemble in codegen, because we assume user should be responsible for their mistakes in inline asemble.
> 
> @phoebewang I agree but we still check the correctness of opcodes and operands. I wondered if we can check the size as well. Apparently it's not so straightforward, especially including your example with compiler generated SIB for the "m" constrain.

Yes. SIB is the most headache, because when checking inline asm, we don't know the memory operands. When we can get the precise memory operands, we won't check inline asm again. Given we will emit error during encoding, it's not much important to check it in codegen.

My point is from user's perspective, because the generation of SIB is out of their control. So they may condemn it's compiler's fault to turn a legal inline asm into illegal.

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


More information about the llvm-commits mailing list