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

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 04:54:24 PDT 2021


uabelho added a comment.

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

> In D101297#2735949 <https://reviews.llvm.org/D101297#2735949>, @uabelho wrote:
>
>> E.g.
>>
>>   opt -slp-vectorizer -S -o - slp2.ll -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900
>>
>> now results in
>>
>>   define void @foo(%rec* %in_p) #0 {
>>   entry:
>>     %ptr1 = getelementptr inbounds %rec, %rec* %in_p, i16 0, i32 2
>>     %ptr2 = getelementptr inbounds %rec, %rec* %in_p, i16 0, i32 0
>>     %0 = insertelement <2 x i16*> poison, i16* %ptr2, i32 0
>>     %1 = insertelement <2 x i16*> %0, i16* %ptr1, i32 1
>>     %2 = call <2 x i16> @llvm.masked.gather.v2i16.v2p0i16(<2 x i16*> %1, i32 1, <2 x i1> <i1 true, i1 true>, <2 x i16> undef)
>>     store <2 x i16> %2, <2 x i16>* bitcast (%rec* @g to <2 x i16>*), align 1
>>     ret void
>>   }
>>
>> But before this patch it didn't use llvm.masked.gather.
>> And as far as I can see masked gather is not legal for this target.
>> F16659590: slp2.ll <https://reviews.llvm.org/F16659590>
>
> Well, this should not happen because of the tiny vectorization tree. I'll revert the patch and will add some extra detection/rework it for better cost estimation.

Ok, thanks!


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