[llvm] update P7 v4i8 load cost (PR #108261)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 12:54:01 PDT 2024


================
@@ -802,12 +802,18 @@ InstructionCost PPCTTIImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
   // explicitly check this case. There are also corresponding store
   // instructions.
   unsigned MemBytes = Src->getPrimitiveSizeInBits();
-  if (ST->hasVSX() && IsAltivecType &&
-      (MemBytes == 64 || (ST->hasP8Vector() && MemBytes == 32)))
-    return 1;
+  unsigned SrcBytes = LT.second.getStoreSize();
+  if (ST->hasVSX() && IsAltivecType) {
+    if (MemBytes == 64 || (ST->hasP8Vector() && MemBytes == 32))
----------------
diggerlin wrote:

nit: this maybe not related to the patch,

I think the variable `MemBytes` should be `MemBits` , otherwise it is not easy to understand (it looks like compare with 64bytes and 32bytes)

`if (MemBytes == 64 || (ST->hasP8Vector() && MemBytes == 32))`

I think we can modify the variable name in the patch?

https://github.com/llvm/llvm-project/pull/108261


More information about the llvm-commits mailing list