[PATCH] Fix for previously reverted SLPVectorizer cost model improvement

arnold aschwaighofer at apple.com
Tue Apr 8 08:35:19 PDT 2014


On Apr 8, 2014, at 7:50 AM, Eric Christopher <echristo at gmail.com> wrote:

> On Mon, Apr 7, 2014 at 6:34 PM, Arnold Schwaighofer
> <aschwaighofer at apple.com> wrote:
>> 
>> On Apr 6, 2014, at 9:14 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> 
>>> +    static inline bool isTriviallyVectorizable(Intrinsic::ID ID) {
>>> 
>>> I don't think that this function belongs in include/llvm/IR/IntrinsicInst.h.  This function describes the current capabilities of the loop vectorizer. Would you add a similar function that describes functions that can be LICM-ed or Scalarized or Unrolled into Intrinsics.h?  Moreover, we could easily teach the vectorizer to vectorize these functions (we have done it with Intel's OpenCL vectorizer).
>>> 
>> 
>> I think this api describes a property of the intrinsic instruction: Whether all operands are vector operands of the same width when the instruction is vectorized. Maybe, we should name it such: areAllOpdsIdenticallyWidened?
>> 
>> It is used by the two vectorizers to determine whether they can vectorize the instruction by simply widening the types:
>> 
>>  float @llvm.pow.f32(float  %Val, i32 %power) => <2 x float> @llvm.pow.f32(<2 x float> %Val, <2 x i32> %power)
>> 
>> in contrast to:
>> 
>>  float @llvm.powi.f32(float  %Val, i32 %power) => <2 x float> @llvm.powi.f32(<2 x float> %Val, i32 %power)
>> 
> 
> I think I agree with Nadav here. It's a piece of knowledge that's not
> generally useful outside of the vectorizer pass and there's really no
> reason for it to be in Intrinsics.h. It describes a property, but we
> should only put things in Intrinsics.h if they describe properties on
> the intrinsic definition.
> 
> Thoughts?

Okay, lets put the function in include/llvm/Transforms/Vectorize.h.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140408/eb4038a0/attachment.html>


More information about the llvm-commits mailing list