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

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 00:58:17 PST 2019


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: chandlerc, RKSimon, majnemer, samparker, dmgreen.

This is addressing the issue that we're not modeling the cost of clib functions
in TTI::getIntrinsicCosts and thus we're basically addressing this fixme:

      
  // FIXME: This is wrong for libc intrinsics.
      

To enable analysis of clib functions, we not only need an intrinsic ID and
formal arguments, but also the actual user of that function so that we can e.g.
look at alignment and values of arguments. So, this is the initial plumbing to
pass the user of an intrinsinsic on to getCallCosts, which queries
getIntrinsicCosts.

      

I would like to to start with modeling memcpy, have added a new getMemcpyCost
function, and added that to getIntrinsicCosts to show how this could work. It's
just returning a default costs, so this should not change any current behaviour.


https://reviews.llvm.org/D59014

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/BasicTTIImpl.h
  lib/Analysis/TargetTransformInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59014.189453.patch
Type: text/x-patch
Size: 14523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190306/fd8c2c9f/attachment-0001.bin>


More information about the llvm-commits mailing list