[PATCH] D101297: [SLP]Allow masked gathers only if allowed by target.

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 06:39:33 PDT 2021


anton-afanasyev added a comment.



In D101297#2719529 <https://reviews.llvm.org/D101297#2719529>, @ABataev wrote:

> In D101297#2719521 <https://reviews.llvm.org/D101297#2719521>, @anton-afanasyev wrote:
>
>>> Pure cost won't work here, we need to check if this is legal just to try to generate masked gather at all. Cost problem is different.
>>
>> Can't we rely on cost model to deal with this? This can be profitable for futher vectorization, when we can start from such gather loads as seed. Yes, we have "unlegal" gathers for llvm ir, but they are lowered to legal code eventually. What is the motivation for this change?
>
> The cost model must be tweaked to support this kind of lowering. I can rework the patch in terms of cost model improvement to handle the case with non-legal masked gather more correctly instead of direct legality checks in SLP. Will it work?

I believe it will work correct after lowering fixes. I'm still investigating this case https://bugs.llvm.org/show_bug.cgi?id=50015, this is definitly lowering issue since llvm code looks correct.
Ok, I think this patch is good temp solution until miscompile issue isn't solved.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101297/new/

https://reviews.llvm.org/D101297



More information about the llvm-commits mailing list