[PATCH] D59710: [SLP] remove lower limit for forming reduction patterns

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 08:08:51 PST 2019


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/hadd.ll:93
+; SLM-NEXT:    [[R01:%.*]] = shufflevector <2 x i64> [[BIN_RDX2]], <2 x i64> [[BIN_RDX]], <2 x i32> <i32 0, i32 2>
 ; SLM-NEXT:    ret <2 x i64> [[R01]]
 ;
----------------
ABataev wrote:
> RKSimon wrote:
> > SLM has really poor v2i64 add costs - so I'm surprised this happened - we may need SLM special handling in getArithmeticReductionCost?
> I think it is the problem of the cost model, maybe SLM cost model is not aware of very expensive 2i64 add cost?
Taking a look...debug output shows:

```
SLP: Calculating cost for tree of size 1.
SLP: Adding cost -2 for bundle that starts with   %a0 = extractelement <2 x i64> %a, i32 0.
SLP: Spill Cost = 0.
SLP: Extract Cost = 0.
SLP: Total Cost = -2.
SLP: Adding cost 1 for reduction that starts with   %a0 = extractelement <2 x i64> %a, i32 0 (It is a splitting reduction)
SLP: Vectorizing horizontal reduction at cost:-1. (HorRdx)

```


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

https://reviews.llvm.org/D59710





More information about the llvm-commits mailing list