[PATCH] D100486: [COST]Improve cost model for shuffles in SLP.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 15:29:09 PDT 2022


ABataev added a comment.

In D100486#3517448 <https://reviews.llvm.org/D100486#3517448>, @asbirlea wrote:

> Following up on the regression I was seeing with https://reviews.llvm.org/D114171, the only meaningful IR change seems to be:
> Before the patch (after slp):
>
>   %65 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
>   %66 = insertelement <4 x float> %65, float %16, i32 2  
>   %67 = insertelement <4 x float> %66, float %15, i32 3
>   %68 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %67)
>   %69 = fcmp oeq <4 x float> %68, <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000>
>   %70 = freeze <4 x i1> %69 
>   %71 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> %70)
>
> After the patch (after slp)
>
>   %65 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> <i32 1, i32 0, i32 undef, i32 undef>  
>   %66 = shufflevector <4 x float> poison, <4 x float> %65, <4 x i32> <i32 4, i32 5, i32 2, i32 3> 
>   %67 = insertelement <4 x float> %66, float %16, i32 2  
>   %68 = insertelement <4 x float> %67, float %15, i32 3
>   %69 = call <4 x float> @llvm.fabs.v4f32(<4 x float> %68)
>   %70 = fcmp oeq <4 x float> %69, <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000>
>   %71 = freeze <4 x i1> %70  
>   %72 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> %71)
>
> I'm not clear why the order of 0,1 in the shufflevector changed or the purpose of the second shufflevector adding poison on positions that will be overwritten, but the operations that follow seem to not affected by these changes.
> Just providing an update, and not digging further into it at this time.

I'm still working on the reductions improvements. Hope to fix all these regressions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100486/new/

https://reviews.llvm.org/D100486



More information about the llvm-commits mailing list