[PATCH] D49168: [LV] Add a new reduction pattern match

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 7 10:31:32 PDT 2018


hsaito added a comment.

In https://reviews.llvm.org/D49168#1190457, @takahiro.miyoshi wrote:

> I modified my patch to use RK_FloatAdd instead of adding a new recurrence descriptor.
>  And, input IRs of this target loop is already converted into a select instruction, so I don't extend If-convert functionality.


Is this ready for another round of review? I took a quick look. I think this is the right direction to follow. Any specific reasons for restricting to FloatAdd? Should be the same for integers and SUB and MUL, as well, isn't it?
Please also add a negative test for "two use" cases but outside of the pattern you are looking for as well as "three use" negative test.

By any chance, did you try looking into creating a LIT test for the following conditional reduction where both IFs are converted to selects? I'm just curious about how much extension of your code would be needed to capture that.
If this is already caught great. If low hanging, its nice to extend a bit further (and try to see if that covers 3, 4, 5, ..., N cases).

if (cond1)

  sum+=...

if (cond2)

  sum+=...

[
if (cond3)

  sum+=...

if (cond4)

  sum+=...

...
if (condN)

  sum+=...

]

Thanks,
Hideki


https://reviews.llvm.org/D49168





More information about the llvm-commits mailing list