[LLVMdev] Non-Chain Chains

David A. Greene greened at obbligato.org
Thu Jan 5 17:51:43 PST 2012


greened at obbligato.org (David A. Greene) writes:

>   - How do I get the previous instruction that was translated?
>     prior(CS.getInstruction()) in visitCall returns something invalid.
>     When I try to call getValue on the returned Instruction it blows up.
>     I really need the SDValue produced as a result of translating that
>     last instruction.  Is there some other way to get it?

I figured out I did this part wrong.  I can now get to the previous
instruction.

>   - Can a TokenFactor node take a non-chain input?  Consider:
>
>     r1 = load ...
>     r2 = add
>     r3 = call
>
>     The call will naturally take the chain input from the load but I
>     also want to add a dependence from the add to the call.  I was going
>     to do something like this:
>
>     Chain = TokenFactor(load chain, r2)
>     LowerCallTo(Chain, ...)

This, however is still a problem.

>     Is that legal?  If not, is there any way to express this dependence?
>     I could use flag/glue nodes in SUnits but it somehow seems uglier.
>     For one thing, we don't have the original instruction order once
>     we've created SDNodes so I can't imagine how I'd find the right
>     SUnit to glue to the call.

I still need help with this question.

                               -Dave



More information about the llvm-dev mailing list