[LLVMdev] Hitting assertion, unsure why

Scott Michel scooter.phd at gmail.com
Fri Jan 30 11:38:28 PST 2009


On Fri, Jan 30, 2009 at 9:59 AM, Villmow, Micah <Micah.Villmow at amd.com>wrote:

> The problem is linked to taking the address of the stack variable and
> passing it as a pointer to another function.


This is a common optimization since the addressing is a (simple, propagated)
base+offset and doesn't require a new stack spill.

So, my questions are:
> 1) Is there anything special I should be doing to handle a
> FrameIndexSDNode being passed into LowerCALL?


No. The CellSPU backend doesn't do anything special in this regard. It just
sees a MVT::i32 pointer.

2) If not, Where can I look that might show some light on what I'm doing
> wrong in tablegen/ISelLowering?


You might need to add some code to your ISelDAGToDAG source during
instruction selection to catch FrameIndex nodes and generate the instruction
sequence that creates the proper base+offset pointer. What you're likely
seeing is a FrameIndex that's used multiple times ("<multiple use>" when you
dump the DAG) and is now higher in the DAG as a sole node.

I'm surprised, however, that you haven't yet seen a "Cannot select ..."
assert.


-scooter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090130/2ee4ed2a/attachment.html>


More information about the llvm-dev mailing list