[PATCH] D48591: [TargetLowering] isVectorClearMaskLegal - use ArrayRef<int> instead of const SmallVectorImpl<int>&

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 06:29:44 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48591#1143466, @lebedev.ri wrote:

> In https://reviews.llvm.org/D48591#1143450, @spatel wrote:
>
> >
>
>
> If it is modified, then `SmallVectorImpl` is needed, obviously.
> Else
>  If not all users are passing something derived from `SmallVectorImpl`, then `ArrayRef` is better.
>  Else, if all users are derived from `SmallVectorImpl`, then it is best to pass that,
>  since it is just a downcast, while construction of `ArrayRef` is, well, construction.
>  Example: https://godbolt.org/g/zkYiC4


Ah - thanks for the example. I didn't consider the codegen difference (generality and consistency of the source code are the main motivations here I think, but good to actually know about the potential perf difference).


Repository:
  rL LLVM

https://reviews.llvm.org/D48591





More information about the llvm-commits mailing list