[PATCH] D59014: [TTI] Enable analysis of clib functions in getIntrinsicCosts. NFCI.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 11:56:58 PST 2019


RKSimon added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:211
   /// The latter is only interesting for varargs function types.
-  int getCallCost(FunctionType *FTy, int NumArgs = -1) const;
+  int getCallCost(FunctionType *FTy, int NumArgs = -1, User *U = nullptr) const;
 
----------------
samparker wrote:
> Can these be const pointers?
+1


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:817
+  /// source/destination type and alignment and the number of bytes copied.
+  int getMemcpyCost(const Instruction *I) const;
+
----------------
SjoerdMeijer wrote:
> RKSimon wrote:
> > Why do we need to provide individual cost functions like this? Isn't that what getCallCost/getIntrinsicCost are there for?
> I thought a separate function would be good so that targets can override it and do their target dependent decision making there, like e.g. checking if source/destinations types are legal or not. But I agree it is probably not strictly necessary, as querying DataLayout here would also be possible.
Would it be possible to remove the memcpy change from this patch so its just about adding the User* argument?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59014/new/

https://reviews.llvm.org/D59014





More information about the llvm-commits mailing list