[PATCH] D148123: [AArch64][CostModel] Make sext/zext free if folded into a masked load

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 07:53:14 PDT 2023


david-arm marked 2 inline comments as done.
david-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:2131
+      (CCH == TTI::CastContextHint::Masked) && ST->hasSVEorSME())
+    CCH = TTI::CastContextHint::Normal;
+
----------------
dmgreen wrote:
> Is this always true that they are equivalent?
> 
> For a `nxv8i16 load zext to nxv8i32` (without masking) you can convert it into a pair of extending load (each cost 1, so load+zext costs 2 total).
> 
> The same can't be done for `nxv8i16 masked_load zext to nxv8i32` without either converting the nxv8i1 mask to two nxv4i1 masks, or zext a single load with a pair of uunpk's. (For MVE both are expensive so we give the instruction a high cost, preferring lower vector factors).
Good point! I think the new version should fix that.


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

https://reviews.llvm.org/D148123



More information about the llvm-commits mailing list