[PATCH] D76634: [X86] Try to improve min/max reduction costs.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 28 14:32:20 PDT 2020


RKSimon added a comment.

The PHMINPOS vXi8/vXi16 lowering means we have different min vs max reduction costs - should we be trying to account for this?



================
Comment at: llvm/test/Analysis/CostModel/X86/reduce-smax.ll:47
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i64 @llvm.experimental.vector.reduce.smax.v2i64(<2 x i64> undef)
 ; AVX2-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4 = call i64 @llvm.experimental.vector.reduce.smax.v4i64(<4 x i64> undef)
+; AVX2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V8 = call i64 @llvm.experimental.vector.reduce.smax.v8i64(<8 x i64> undef)
----------------
I realise its not a regression but still really bad.


================
Comment at: llvm/test/Analysis/CostModel/X86/reduce-smax.ll:95
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V2 = call i32 @llvm.experimental.vector.reduce.smax.v2i32(<2 x i32> undef)
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V4 = call i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32> undef)
 ; AVX1-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i32 @llvm.experimental.vector.reduce.smax.v8i32(<8 x i32> undef)
----------------
No improvement?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76634





More information about the llvm-commits mailing list