[PATCH] D132477: Improve cost model for some 128-bit vector operations that use SVE

Hassnaa Hamdi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 02:31:45 PDT 2022


hassnaa-arm added inline comments.


================
Comment at: llvm/test/Analysis/CostModel/AArch64/sve-fixed-length.ll:105
+; expected cost: 512
+; CHECK: cost of [[#mul(mul(mul(mul((div(512-1, VBITS)+1), 2), (div(512-1, VBITS)+1)), 8), 2)]] for instruction:  %sdiv512.i8   = sdiv <64 x i8> undef, undef
+  %sdiv512.i8  = sdiv <64 x i8> undef, undef
----------------
david-arm wrote:
> With my comment about the incorrect legalisation cost above I think these CHECK lines can be simplified to just a single mul, i.e.
> 
> ; CHECK: cost of [[#mul((div(512-1, VBITS)+1), 16]] for instruction:  %sdiv512.i8   = sdiv <64 x i8> undef, undef
> ; CHECK: cost of [[#mul((div(512-1, VBITS)+1), 8]] for instruction:  %sdiv512.i16   = sdiv <32 x i16> undef, undef
> ; CHECK: cost of [[#mul((div(512-1, VBITS)+1), 2]] for instruction:  %sdiv512.i32   = sdiv <16 x i32> undef, undef
> ; CHECK: cost of [[#mul((div(512-1, VBITS)+1), 2]] for instruction:  %sdiv512.i64   = sdiv <8 x i64> undef, undef
about the part of multiplying by 16 and 8 instead of (2 * 8) and (2 * 4)
I did it that way for the sake of clarification. to clarify that I'm multiplying the base cost * extra cost of 8/4 for i8/16.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132477



More information about the llvm-commits mailing list