[llvm-dev] Basic Backend: Load Indirect

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sun Aug 28 17:20:53 PDT 2016


Hi Georg,

On 28 August 2016 at 10:24, Gschwandtner Georg - S1310567008 via
llvm-dev <llvm-dev at lists.llvm.org> wrote:
> ldr r5, r4 // load indirect from memory address in r4 to register
>
> [...]
>
> Does someone have a hint for me? I would very much appreciate it.

This CPU sounds simple enough that it won't need SelectAddrMode
functions at all. They're there mostly for targets with lots of
different possible ways to form an address with different trade-offs
in efficiency & size..

For you, an address has to be in a register, so you can probably just
write a TableGen pattern on the load instruction itself. Something
like:

   (set GPR:$Rd, (load GPR:$addr))

ought to work for the load.

Cheers.

Tim.


More information about the llvm-dev mailing list