[PATCH] Vectorize math intrinsic calls in SLPVectorizer

Nadav Rotem nrotem at apple.com
Tue Apr 29 23:25:29 PDT 2014


+; CHECK: sin_libm
+; CHECK: %0 = bitcast double* %a to <2 x double>*
+; CHECK: %1 = load <2 x double>* %0, align 8
+; CHECK: %2 = bitcast double* %b to <2 x double>*
+; CHECK: %3 = load <2 x double>* %2, align 8
+; CHECK: %4 = fmul <2 x double> %1, %3
+; CHECK: %5 = call <2 x double> @llvm.sin.v2f64(<2 x double> %4)
+; CHECK: %6 = bitcast double* %c to <2 x double>*
+; CHECK: store <2 x double> %5, <2 x double>* %6, align 8
+; CHECK: ret void


Karthik, 

Your CHECK lines are too strict. If we ever change the IR or even something unrelated in the IR we would have to change all of the test cases that you added. Please include a single CHECK line with the ‘call’ instruction (in addition to the CHECK line with the function name and a CHECK line with RET). 

Thanks,
Nadav

On Apr 29, 2014, at 11:13 PM, Karthik Bhat <kv.bhat at samsung.com> wrote:

> Hi nadav, aschwaighofer, hfinkel, rsilvera,
> 
> Part 2/2 of [ Vectorize intrinsic math function calls in SLPVectorizer ]
> 
> Splitting patch in http://reviews.llvm.org/D3535
> 
> Now that we have getIntrinsicIDForCall in VectorUtil. Use the same logic as in LoopVectorize in SLPVectorizer and use getIntrinsicIDForCall to decide if the CallInstr can be classified as an intrinsic call. 
> If yes calculate the appropriate cost in SLPVectorize to decide if to vectorize or not.
> 
> Thanks
> Karthik Bhat
> 
> http://reviews.llvm.org/D3560
> 
> Files:
>  lib/Transforms/Vectorize/SLPVectorizer.cpp
>  test/Transforms/SLPVectorizer/X86/call.ll
> <D3560.8957.patch>





More information about the llvm-commits mailing list