[PATCH] D117884: [RISCV] Add cost modelling for masked memory op

Alex Tsao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 11:22:28 PST 2022


alextsao1999 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:173
+
+  std::pair<InstructionCost, MVT> LT = TLI->getTypeLegalizationCost(DL, Src);
+  return LT.first;
----------------
alextsao1999 wrote:
> kito-cheng wrote:
> > That seems like not included the memory access cost? how about `return getMemoryOpCost (Opcode, Src, Alignment, AddressSpace, CostKind)` here?
> Thanks, I fixed it
I'm not very familiar with these. Besides the memory access cost, are there any costs to take into account?


================
Comment at: llvm/test/Analysis/CostModel/RISCV/masked_ldst.ll:27
+entry:
+  ; Legal fixed-width integer types
+  %v2i8 = call <2 x i8> @llvm.masked.load.v2i8.p0v2i8(<2 x i8> *undef, i32 8, <2 x i1> undef, <2 x i8> undef)
----------------
frasercrmck wrote:
> What do you mean by "legal" here?  The test isn't testing a configuration in which fixed-length vectors are supported by the backend.
Thanks, removed :p


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117884



More information about the llvm-commits mailing list