[PATCH] D100745: [AArch64] Add AArch64TTIImpl::getMaskedMemoryOpCost function

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 01:53:09 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:928
+    if (auto *VecTy = dyn_cast<FixedVectorType>(Src))
+      ScalarCost *= VecTy->getNumElements();
+    return ScalarCost;
----------------
Should this actually be something to add to BasicTTIImpl.h so that it can be reused for other targets? The cost of implementing a masked memory op would be: `NumElts * (cost(load element) + cost(insert element)) <=> NumElts * cost(load element) + ScalarizationOverhead`

Then we only have to implement this function for the scalable case, and all other cases can call the BasicTTIImpl.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100745



More information about the llvm-commits mailing list