[PATCH] D79163: [Target][ARM] Tune getCastInstrCost for extending masked loads and truncating masked stores

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 14:00:28 PDT 2020


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:198
 
-  // The extend of a load is free
-  if (I && isa<LoadInst>(I->getOperand(0))) {
+  // Extending/Truncating masked load/stores is expensive because we can't split
+  // them. This means that we'll likely end up loading/storing each element
----------------
Technically it's not that we can't split them, it's that we choose not to. Essentially we will have to end up paying the cost somewhere, and from a cost-modelling perspective, this is a good place to say that splitting them will be expensive, especially in a tail predicated loop where we won't be able to split a vctp sensibly.

Also do we end up scalarize the masked load? That might change where we put the cost (we could just implement getMemoryOpCost and put the cost their instead).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79163





More information about the llvm-commits mailing list