[llvm] [Analysis][NFC] Improve documentation for getMemoryOpCost (PR #156875)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 05:47:59 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: David Sherwood (david-arm)

<details>
<summary>Changes</summary>

The operand info argument appears to refer to different things depending upon whether it's a load or a store, so I've clarified this in the documentation.

---
Full diff: https://github.com/llvm/llvm-project/pull/156875.diff


1 Files Affected:

- (modified) llvm/include/llvm/Analysis/TargetTransformInfo.h (+3-1) 


``````````diff
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index af78e0c1e4799..103e5f949bcc1 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1533,7 +1533,9 @@ class TargetTransformInfo {
       Type *EltTy, int ReplicationFactor, int VF, const APInt &DemandedDstElts,
       TTI::TargetCostKind CostKind) const;
 
-  /// \return The cost of Load and Store instructions.
+  /// \return The cost of Load and Store instructions. The operand info
+  /// \p OpdInfo should refer to the stored value for stores and the address
+  /// for loads.
   LLVM_ABI InstructionCost getMemoryOpCost(
       unsigned Opcode, Type *Src, Align Alignment, unsigned AddressSpace,
       TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput,

``````````

</details>


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


More information about the llvm-commits mailing list