[PATCH] D152001: [RISCV][SLP] Inflate insert/extract costs on very small vectors

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 09:43:56 PDT 2023


ABataev added inline comments.


================
Comment at: llvm/test/Transforms/SLPVectorizer/RISCV/math-function.ll:203
-; CHECK-NEXT:    [[TMP3:%.*]] = shufflevector <4 x float> [[TMP0]], <4 x float> poison, <2 x i32> <i32 2, i32 3>
-; CHECK-NEXT:    [[TMP4:%.*]] = call fast <2 x float> @llvm.exp.v2f32(<2 x float> [[TMP3]])
-; CHECK-NEXT:    [[TMP5:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
----------------
reames wrote:
> ABataev wrote:
> > reames wrote:
> > > For a bit of context since this confused me at first.
> > > 
> > > We don't actually have a vector lowering for exp.  As a result, @llvm.exp.v2f32 is getting scalarized by the backend, and the cost model knows this.  This is why this change to extract/insert element is seemingly effecting extract subvector costs.  It isn't; it's, correctly, effecting the perceived cost of the vector exp op.  
> > Then it requires the changes in the nide building algorithm. Need to check that the vector node is legal/vectorized, if it is not legal/salarized - build gather node instead of vector node
> Not sure what you meant here.  Can you expand/clarify?  In particular, was this meant as a requested change to this review?  Or as a side comment?
It is the correct fix. Need to change/fix buildnode algorithm. Need to check if it is legal to build vector node (like in your example for expf). If it is not, change the node to gather node, not vector node.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152001



More information about the llvm-commits mailing list