Page MenuHomePhabricator

[IR] Add CallSiteOnly flag to CallBase's attribute getters
AbandonedPublic

Authored by aqjune on Feb 25 2021, 1:47 AM.

Details

Summary

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.

Diff Detail

Event Timeline

aqjune created this revision.Feb 25 2021, 1:47 AM
aqjune requested review of this revision.Feb 25 2021, 1:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2021, 1:47 AM
aqjune abandoned this revision.Mar 10 2021, 9:41 PM

Well, I found a way to get around this issue without changing these APIs. :)