[LLVMdev] How to add a MVT::Glue property of intrinsic node?
Philip Reames
listmail at philipreames.com
Mon Jun 23 10:14:27 PDT 2014
On 06/23/2014 08:20 AM, Tim Northover wrote:
> Hi Haishan,
>
> On 23 June 2014 16:07, Haishan <hndxvon at 163.com> wrote:
>> I have implemented a pair intrinsic nodes in back-end, But there is a
>> chain dependence between two intrinsic nodes. So in the Pre-RA-sched stage,
>> these two intrinsic nodes would be apart. I expect that there is no node
>> between these two intrinsic nodes, therefore, I guess it would be work if
>> there is a MVT::Glue between these nodes. But I don’t know how to add.
> You can't Glue the two nodes together forever. All Glue really does is
> keep them together long enough for LLVM to put together a data
> dependency through "Uses" and "Defs" implicit operands. Once the
> MachineInstrs have been created, the two instructions are at the whim
> of the scheduler as much as any others.
>
> If you really need them to remain together, you have to either create
> a pseudo-instruction and expand it extremely late, or create a bundle
> (depending on what's natural for your target).
I just want to second Tim's point here. We tried to take the "separate
but tied together" scheme in an early implementation of our safepoint
work, and it was a really bad idea. It "mostly" worked, but we kept
running into a long series of subtle issues. I *strongly* suggest you
use the pseudo op approach. That has worked fairly well for us.
>
> That said, you usually just have to call SelectionDAG::getNode with an
> SDVTList containing some Glue for it to work as intended. The only
> time I've had that fail is when I forgot to add the Uses/Defs values
> to the Instructions, so they couldn't be matched up. What problems are
> you seeing from your attempts?
>
> Cheers.
>
> Tim.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list