[PATCH] D147322: [AArch64] Improve fshl cost modeling if 3rd arg is constant.

Zain Jaffal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 05:00:54 PDT 2023


zjaffal added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:572
+
+    return TyL.first * Cost * NumElements;
+  }
----------------
dmgreen wrote:
> Do you have any opinions of whether this should be `TyL.first * Cost` (with a Cost of 1/2) or `TyL.first + Cost` (with a cost of 0/1)? It might capture the "extra shift" a little better, for integer types at least.
> As far as I can see NumElements is always 1 here?
>As far as I can see NumElements is always 1 here? 
I was trying to see if the same code works for vector instructions but I think it might be easier to do that in a different patch given the following code is an overestimate for the true cost. 

> Do you have any opinions of whether this should be TyL.first * Cost (with a Cost of 1/2) or TyL.first + Cost (with a cost of 0/1)? It might capture the "extra shift" a little better, for integer types at least.
I will test it now and see if there are any differences. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147322



More information about the llvm-commits mailing list