[llvm-dev] Selection DAG chain question

Hendrik Greving via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 16 11:10:14 PDT 2020


Re: Do they really need to be chained with each other or anything else
Yes. For 2 reasons. Our architecture lowers udivmem into something with 1
producer and 2 consumers. Reason 1) neither the producers nor the consumers
must get reordered. Reason 2) one of the consumers might be missing (either
the div or mod consumer might not be present. Yet we need to keep the
consuming instruction with side effects. The only way to achieve is to add
it into the chain. Problem here: divmod does not have a chain.

I scanned other architectures, haven't found an example where somebody
creates a chain out of thin air. Do you know any?

On Thu, Jul 16, 2020 at 10:54 AM Tim Northover <t.p.northover at gmail.com>
wrote:

> On Thu, 16 Jul 2020 at 16:44, Hendrik Greving via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > But then the new nodes are not chained with respect to other nodes, or
> not chained with respect to each other, in case there are several UDIVREM.
>
> Do they really need to be chained with each other or anything else?
> The case I know of is when they get lowered to a libcall. That libcall
> has effects that mean it needs a chain of some kind, but it doesn't
> really matter in any other way where in the basic block it happens.
>
> As long as it's after its inputs have been created and before its
> outputs are consumed, everything is fine. And that's handled by the
> normal value operands.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200716/f39ccf6c/attachment.html>


More information about the llvm-dev mailing list