[llvm-dev] LoopVectorizer: Should the cost-model be used for legalisation?

Sander De Smalen via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 5 03:53:08 PDT 2021


Hi Florian,

> Sounds good to me, thanks! Is this approach suitable for all current patches in-flight you mentioned that deal with constructs/types that are not legal with scalable vectors on AArch64?
> 
> AFAICT those in-flight patches include some of the patches below?
> 
> https://reviews.llvm.org/D102253
> https://reviews.llvm.org/D102394
> https://reviews.llvm.org/D101916

The approach is suitable for at least D102394 and probably D101916 as well (so those patches will need to be changed).

It is still useful to have a separate TTI interface to discard certain vector types early (D102253), because otherwise it requires some bigger changes to propagate InstructionCost in `struct RegisterUsage` and it's uses (because TargetTransformInfo::getRegUsageForType may return Invalid).

Hope that makes sense.

Thanks,

Sander


> On 1 Jul 2021, at 15:41, Florian Hahn <florian_hahn at apple.com> wrote:
> 
> 
> 
>> On Jun 24, 2021, at 16:12, Sander De Smalen <Sander.DeSmalen at arm.com> wrote:
>> 
>> Hi Florian, Vineet,
>> 
>> Thanks both for your input!
>> 
>> From the comments here and from conversations off-list, it seems there is no objection -and perhaps even a slight preference- to use the 'Invalid' state of InstructionCost as a feature. That's probably also the easiest way forward for now, since it avoids us adding all sorts of TTI methods for legalisation that we may need to delete again later when we have a scalarization mechanism for scalable VFs.
>> 
>> Assuming there is no further objection to this, we'll change our patches that are currently on Phabricator to pursue this approach instead.
> 
> 
> Sounds good to me, thanks! Is this approach suitable for all current patches in-flight you mentioned that deal with constructs/types that are not legal with scalable vectors on AArch64?
> 
> AFAICT those in-flight patches include some of the patches below?
> 
> https://reviews.llvm.org/D102253
> https://reviews.llvm.org/D102394
> https://reviews.llvm.org/D101916
> 
> Cheers,
> Florian



More information about the llvm-dev mailing list