[PATCH] D97454: [IR] Add CallSiteOnly flag to CallBase's attribute getters

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 01:47:09 PST 2021


aqjune created this revision.
aqjune added reviewers: lebedev.ri, nikic, fhahn, spatel.
Herald added subscribers: dexonsmith, hiraditya, mgorny.
aqjune requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I found that a few methods in CallBase return the value of attributes
attached to the call instruction without looking into the attributes
in the called function's declaration.
This causes sub-optimal results in some places.
For example, Value::getPointerDereferenceableBytes is calling
CallBase::getDereferenceableBytes which does not look into
dereferenceable attributes at the function declaration.
If the declaration had larger dereferenceable attribute value, this
results in a sub-optimal result.

To address this, I added 'CallSiteOnly' flag and updated such users to set this flag to false to get better result.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97454

Files:
  llvm/include/llvm/IR/InstrTypes.h
  llvm/include/llvm/IR/IntrinsicInst.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/IR/Instructions.cpp
  llvm/lib/IR/Value.cpp
  llvm/unittests/IR/CMakeLists.txt
  llvm/unittests/IR/CallBaseTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97454.326325.patch
Type: text/x-patch
Size: 12428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210225/ffde30ca/attachment.bin>


More information about the llvm-commits mailing list