[LLVMdev] Compiling for several operand memories

Magnus mangepe at gmail.com
Fri Oct 5 11:51:33 PDT 2012


Hello,
My target has two data memories, each with its own load/store instructions but also has some instructions using both memories. I want to be able to access both memories in C-programs through the address space attribute.
I have two ideas so far:
Either: use two sets of addressing modes in InstrInfo.td:
def ADDRrr_A : ComplexPattern<i16, 2, “SelectADDRrr_A", [], []>;
def ADDRri : ComplexPattern<i16, 2, "SelectADDRri", [frameindex], []>;
and
def ADDRrr_B : ComplexPattern<i16, 2, "SelectADDRrr_B", [], []>;

Or: do something in one of the lowering functions to catch load and stores, look at their address space attribute to pick the right assembly instruction

Can someone hint me on how this can be implemented? Any input would be greatly appreciated. 

best
-Magnus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121005/21cb0267/attachment.html>


More information about the llvm-dev mailing list