[Attributor] Fix dereferenceable callsite argument initialization

llvm-svn: 367748
This commit is contained in:
Hideto Ueno 2019-08-03 04:10:50 +00:00
parent aa2810b6e7
commit 96bb347205
1 changed files with 4 additions and 2 deletions

View File

@ -2053,10 +2053,12 @@ struct AADereferenceableCallSiteArgument : AADereferenceableImpl {
void initialize(Attributor &A) override {
CallSite CS(&getAnchoredValue());
if (CS.paramHasAttr(ArgNo, Attribute::Dereferenceable))
takeKnownDerefBytesMaximum(CS.getDereferenceableBytes(ArgNo));
takeKnownDerefBytesMaximum(
CS.getDereferenceableBytes(ArgNo + AttributeList::FirstArgIndex));
if (CS.paramHasAttr(ArgNo, Attribute::DereferenceableOrNull))
takeKnownDerefBytesMaximum(CS.getDereferenceableOrNullBytes(ArgNo));
takeKnownDerefBytesMaximum(CS.getDereferenceableOrNullBytes(
ArgNo + AttributeList::FirstArgIndex));
}
/// See AbstractAttribute::updateImpl(Attributor &A).