[llvm] r367748 - [Attributor] Fix dereferenceable callsite argument initialization
Hideto Ueno via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 21:10:50 PDT 2019
Author: uenoku
Date: Fri Aug 2 21:10:50 2019
New Revision: 367748
URL: http://llvm.org/viewvc/llvm-project?rev=367748&view=rev
Log:
[Attributor] Fix dereferenceable callsite argument initialization
Modified:
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
Modified: llvm/trunk/lib/Transforms/IPO/Attributor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Attributor.cpp?rev=367748&r1=367747&r2=367748&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp Fri Aug 2 21:10:50 2019
@@ -2053,10 +2053,12 @@ struct AADereferenceableCallSiteArgument
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).
More information about the llvm-commits
mailing list