[llvm-dev] InlineAsm and allocation to wrong register for indirect access

Paulo Matos via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 21 08:00:32 PDT 2016


I am seeing a case, in a private port, of an inline asm with indirect
memory references being allocated invalid registers (i.e. registers that
cannot be used on loads).

For example, the inline asm constraint is correct:
call void asm sideeffect "MOV $$r0,  $0\0AMOV $$r0,  $1\0A",
"*m,*m,~{r0}"(i16* @a, i16* %b) #1, !srcloc !1

but then $0 and $1 are allocated to registers that cannot be used as a
memory base pointer.

I am having trouble finding where this decision is made. Is InlineAsm
going through the normal register allocation process or does it have its
own specialized algorithm?

Any pointers to how registers are allocated in an InlineAsm would be

Kind regards,

Paulo Matos

More information about the llvm-dev mailing list