[llvm] 93b9173 - [Analysis][NFC] Improve documentation for getMemoryOpCost (#156875)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 05:39:02 PDT 2025


Author: David Sherwood
Date: 2025-09-10T13:38:57+01:00
New Revision: 93b91730757cb6216464980d2a78350557d048a7

URL: https://github.com/llvm/llvm-project/commit/93b91730757cb6216464980d2a78350557d048a7
DIFF: https://github.com/llvm/llvm-project/commit/93b91730757cb6216464980d2a78350557d048a7.diff

LOG: [Analysis][NFC] Improve documentation for getMemoryOpCost (#156875)

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.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/TargetTransformInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index a8a41772ec61c..a5e98bb7bc137 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -1535,7 +1535,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,


        


More information about the llvm-commits mailing list