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.
but they should only match when accessing data structres whose address space
attribute is set to 1.
Can I use the predicate field in the instruction class to achieve this? If
so, how ?
We've the same situation in our back-end, two memories with its corresponding loads/stores each one. In order to select between two different loads (and stores), we have defined two complex patterns requiring its parent node (SDNPWantParent) so we can get the address space number.