[PATCH] D110100: [NFCI][CodeGen, AArch64] Fix inconsistent TargetCostKind types.

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 12:47:10 PDT 2021


dfukalov created this revision.
dfukalov added reviewers: marels, RKSimon.
Herald added subscribers: hiraditya, kristof.beyls.
dfukalov requested review of this revision.
Herald added a project: LLVM.

The pass uses different cost kinds to estimate "old" and "interleaved" costs:
default cost kind for all targets override `getInterleavedMemoryOpCost()` is
`TCK_SizeAndLatency`. Although at the moment estimated `TCK_Latency` costs are
equal to `TCK_SizeAndLatency`, (so the change is NFC) it may change in future.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110100

Files:
  llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp


Index: llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
===================================================================
--- llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
+++ llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
@@ -1158,8 +1158,7 @@
   // be expected. Also sum the cost of the Instructions beeing left dead.
   for (auto &I : Is) {
     // Compute the old cost
-    InstructionCost +=
-        TTI.getInstructionCost(I, TargetTransformInfo::TCK_Latency);
+    InstructionCost += TTI.getInstructionCost(I, TTI::TCK_SizeAndLatency);
 
     // The final SVIs are allowed not to be dead, all uses will be replaced
     if (SVIs.find(I) != SVIs.end())
@@ -1212,7 +1211,7 @@
     Indices.push_back(i);
   InterleavedCost = TTI.getInterleavedMemoryOpCost(
       Instruction::Load, ILTy, Factor, Indices, InsertionPoint->getAlign(),
-      InsertionPoint->getPointerAddressSpace());
+      InsertionPoint->getPointerAddressSpace(), TTI::TCK_SizeAndLatency);
 
   if (InterleavedCost >= InstructionCost) {
     return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110100.373697.patch
Type: text/x-patch
Size: 1033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210920/d995da47/attachment.bin>


More information about the llvm-commits mailing list