[llvm-dev] Selection DAG chain question

Craig Topper via llvm-dev
2020-07-16T18:19:44Z

Chain doesn't guarantee that operations on parallel chains don't get
interleaved. So if you need them to be tightly connected together and
there's no data value flowing between them, then you probably want to look
at using Glue rather than Chain.

~Craig


On Thu, Jul 16, 2020 at 11:10 AM Hendrik Greving via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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.
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20200716/d9366262/attachment.html>