[llvm-dev] Selection DAG chain question

Hendrik Greving via llvm-dev
Thu, 16 Jul 2020 21:34:43 -0000

Yea. I think AMD chains the node they're expanding into, but they don't
chain it into an _existing_ chain. e.g. adding A->B to the DAG is ok. But
adding A->B and next C->D with B->C is the problem. I appreciate the
input

On Thu, Jul 16, 2020 at 2:04 PM Matt Arsenault <arsenm2 at gmail.com>
wrote:

>
>
> > On Jul 16, 2020, at 17:00, Hendrik Greving <hgreving at
google.com> wrote:
> >
> > > No, non-sideeffecting operations can be legalized as compiler-rt
calls
> >
> > Right, but not as "regular" nodes with side-effects? I guess
you could
> search and analyze the DAG manually but that seems hacky. Maybe something
> that one day LLVM could support natively.
>
>
> You can’t add arbitrary chains or glue to the regular nodes, but you can
> define a custom node you select the same way with your chain/glue. You
> don’t need to preprocess the IR and can do in the custom lowering. This is
> what AMDGPU does for FDIV (see AMDGPUISD::FMA_W_CHAIN). GlobalISel avoids
> these complications by not having nodes or chains, and just instructions
> with side effects, so in that sense this is a solved problem.
>
> -Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200716/bc60a7e5/attachment.html>