[llvm] r365977 - [Attributor][FIX] Lookup of (call site) argument attributes
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 17:09:27 PDT 2019
Author: jdoerfert
Date: Fri Jul 12 17:09:27 2019
New Revision: 365977
URL: http://llvm.org/viewvc/llvm-project?rev=365977&view=rev
Log:
[Attributor][FIX] Lookup of (call site) argument attributes
Modified:
llvm/trunk/include/llvm/Transforms/IPO/Attributor.h
Modified: llvm/trunk/include/llvm/Transforms/IPO/Attributor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/Attributor.h?rev=365977&r1=365976&r2=365977&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/Attributor.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/Attributor.h Fri Jul 12 17:09:27 2019
@@ -179,9 +179,12 @@ struct Attributor {
assert(AAType::ID != Attribute::None &&
"Cannot lookup generic abstract attributes!");
- // Determine the argument number automatically for llvm::Arguments.
+ // Determine the argument number automatically for llvm::Arguments if none
+ // is set. Do not override a given one as it could be a use of the argument
+ // in a call site.
if (auto *Arg = dyn_cast<Argument>(&V))
- ArgNo = Arg->getArgNo();
+ if (ArgNo == -1)
+ ArgNo = Arg->getArgNo();
// If a function was given together with an argument number, perform the
// lookup for the actual argument instead. Don't do it for variadic
More information about the llvm-commits
mailing list