[LLVMdev] Selecting FrameIndex

298 views
Skip to first unread message

someguy

unread,
Mar 18, 2009, 2:02:24 PM3/18/09
to LLVM Developers Mailing List
Hi All

I'm having nightmares with FrameIndexes during my backend development :(

I have ComplexPatterns defined for my two addressing modes (RR and
RI). Most of the time, FrameIndex operands appear to be on load/store
nodes, in which case everything works fine as my custom addressing
modes matchers work fine.

Unfortunately, I now have an add node which has a FrameIndex operand
(this results from a store to an int array in the source).

But there is no explicit pattern to match FrameIndex in the .td files,
even though I've specified 'frameindex' in the 'roots' of the
addressing mode ComplexPattern. The result is that I get a
CannotYetSelect on the FrameIndex operand during selection.

Anyone know what i'm doing wrong?
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Scott Michel

unread,
Mar 18, 2009, 3:00:47 PM3/18/09
to LLVM Developers Mailing List
someguy wrote:
> But there is no explicit pattern to match FrameIndex in the .td files,
> even though I've specified 'frameindex' in the 'roots' of the
> addressing mode ComplexPattern. The result is that I get a
> CannotYetSelect on the FrameIndex operand during selection.
>
> Anyone know what i'm doing wrong?
>
You're not doing anything wrong, you've just made friends with the
common subexpression eliminator. :-)

Have a look at the PPC or CellSPU backends' SelectionDAGISel::Select()
method.. You end up catching the ISD::FrameIndex node during instruction
selection and then doing something "useful" with it. In the CellSPU's
case, the ISD::FrameIndex node is turned into an add and the result
stored in a register.


-scooter

Bruno Cardoso Lopes

unread,
Mar 18, 2009, 3:49:03 PM3/18/09
to LLVM Developers Mailing List
Hi,

On Wed, Mar 18, 2009 at 3:02 PM, someguy
<just.s0m3....@gmail.com> wrote:
> Hi All
>
> I'm having nightmares with FrameIndexes during my backend development :(
> I have ComplexPatterns defined for my two addressing modes (RR and
> RI). Most of the time, FrameIndex operands appear to be on load/store
> nodes, in which case everything works fine as my custom addressing
> modes matchers work fine.
>
> Unfortunately, I now have an add node which has a FrameIndex operand
> (this results from a store to an int array in the source).
>
> But there is no explicit pattern to match FrameIndex in the .td files,
> even though I've specified 'frameindex' in the 'roots' of the
> addressing mode ComplexPattern. The result is that I get a
> CannotYetSelect on the FrameIndex operand during selection.
>
> Anyone know what i'm doing wrong?

Sparc and Mips solve this with LEA_ADDRi and LEA_ADDiu,
take a look at MipsInstrInfo.td and SelectAddr in MipsISelDAGToDAG.cpp.

--
Bruno Cardoso Lopes
http://www.brunocardoso.cc

Reply all
Reply to author
Forward
0 new messages