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

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 14:02:57 PDT 2024


================
@@ -802,12 +802,17 @@ 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;
+  Align AlignBytes = Alignment ? *Alignment : Align(1);
----------------
diggerlin wrote:

put the definition of the variable before it first use. (just before the 
`if (Opcode == Instruction::Load && MemBytes == 32 && AlignBytes < SrcBytes)` )

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


More information about the llvm-commits mailing list