[PATCH] D35267: Pass Divergence Analysis data to selection DAG to drive divergence dependent instruction selection

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 02:30:32 PST 2017


alex-t added a comment.

In https://reviews.llvm.org/D35267#949981, @efriedma wrote:

> > Any DAG transformation that change divergent pattern to not-divergent or vice versa is illegal.
>
> Transforming "x*0 -> 0" is illegal if x is divergent?  That seems surprising.


Okay, I was unclear. Except for the constants. Your example is a corner case that turn the variable to the constant.
In this case w/o bit propagation we're still correct but sub-optimal.
I can imagine though the case where a long sequence of constant folding ends up with pure zero. If in addition the operand that becomes constant was the only divergent operand, we'd like to propagate.


https://reviews.llvm.org/D35267





More information about the llvm-commits mailing list