[PATCH] D148036: [SLP]Improve reduction cost model for scalars.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 05:57:32 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/horizontal-smax.ll:91
 
+; FIXME: looks like the cost of @llvm.smax.i32 is not correct, lowered as select+cmp
 define i32 @smax_v16i32(i32) {
----------------
CMP+CMOV is quick even on ancient x86 - the smax.i32 throughput cost of 1 is realistic.

The issue is the predicted smax.v16i32 reduction cost, which is currently 33 (based on expansion of costs in getMinMaxReductionCost), but realistically is closer to 12 cycles (based off some quick llvm-mca tests)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148036



More information about the llvm-commits mailing list