Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -76,7 +76,7 @@ // number tracking or bit-encoding. // - Implement all pure methods. Also use overloading if the attribute is not // conforming with the "default" behavior: A (set of) LLVM-IR attribute(s) for -// an argument, call site argument, function return value, or function. See +// an argument, call base argument, function return value, or function. See // the class and method descriptions for more information on the two // "Abstract" classes and their respective methods. // - Register opportunities for the new abstract attribute in the @@ -147,10 +147,10 @@ /// Helper to describe and deal with positions in the LLVM-IR. /// /// A position in the IR is described by an anchor value and an "offset" that -/// could be the argument number, for call sites and arguments, or an indicator +/// could be the argument number, for call bases and arguments, or an indicator /// of the "position kind". The kinds, specified in the Kind enum below, include /// the locations in the attribute list, i.a., function scope and return value, -/// as well as a distinction between call sites and functions. Finally, there +/// as well as a distinction between call bases and functions. Finally, there /// are floating values that do not have a corresponding attribute list /// position. struct IRPosition { @@ -161,11 +161,11 @@ IRP_FLOAT, ///< A position that is not associated with a spot suitable ///< for attributes. This could be any value or instruction. IRP_RETURNED, ///< An attribute for the function return value. - IRP_CALL_SITE_RETURNED, ///< An attribute for a call site return value. + IRP_CALL_BASE_RETURNED, ///< An attribute for a call base return value. IRP_FUNCTION, ///< An attribute for a function (scope). - IRP_CALL_SITE, ///< An attribute for a call site (function scope). + IRP_CALL_BASE, ///< An attribute for a call base (function scope). IRP_ARGUMENT, ///< An attribute for a function argument. - IRP_CALL_SITE_ARGUMENT, ///< An attribute for a call site argument. + IRP_CALL_BASE_ARGUMENT, ///< An attribute for a call base argument. }; /// Default constructor available to create invalid positions implicitly. All @@ -178,7 +178,7 @@ if (auto *Arg = dyn_cast(&V)) return IRPosition::argument(*Arg); if (auto *CB = dyn_cast(&V)) - return IRPosition::callsite_returned(*CB); + return IRPosition::callbase_returned(*CB); return IRPosition(const_cast(V), IRP_FLOAT); } @@ -198,41 +198,41 @@ } /// Create a position describing the function scope of \p CB. - static const IRPosition callsite_function(const CallBase &CB) { - return IRPosition(const_cast(CB), IRP_CALL_SITE); + static const IRPosition callbase_function(const CallBase &CB) { + return IRPosition(const_cast(CB), IRP_CALL_BASE); } /// Create a position describing the returned value of \p CB. - static const IRPosition callsite_returned(const CallBase &CB) { - return IRPosition(const_cast(CB), IRP_CALL_SITE_RETURNED); + static const IRPosition callbase_returned(const CallBase &CB) { + return IRPosition(const_cast(CB), IRP_CALL_BASE_RETURNED); } /// Create a position describing the argument of \p CB at position \p ArgNo. - static const IRPosition callsite_argument(const CallBase &CB, + static const IRPosition callbase_argument(const CallBase &CB, unsigned ArgNo) { return IRPosition(const_cast(CB.getArgOperandUse(ArgNo)), - IRP_CALL_SITE_ARGUMENT); + IRP_CALL_BASE_ARGUMENT); } /// Create a position describing the argument of \p ACS at position \p ArgNo. - static const IRPosition callsite_argument(AbstractCallSite ACS, + static const IRPosition callbase_argument(AbstractCallSite ACS, unsigned ArgNo) { if (ACS.getNumArgOperands() <= ArgNo) return IRPosition(); int CSArgNo = ACS.getCallArgOperandNo(ArgNo); if (CSArgNo >= 0) - return IRPosition::callsite_argument( + return IRPosition::callbase_argument( cast(*ACS.getInstruction()), CSArgNo); return IRPosition(); } /// Create a position with function scope matching the "context" of \p IRP. - /// If \p IRP is a call site (see isAnyCallSitePosition()) then the result - /// will be a call site position, otherwise the function position of the + /// If \p IRP is a call base (see isAnyCallBasePosition()) then the result + /// will be a call base position, otherwise the function position of the /// associated function. static const IRPosition function_scope(const IRPosition &IRP) { - if (IRP.isAnyCallSitePosition()) { - return IRPosition::callsite_function( + if (IRP.isAnyCallBasePosition()) { + return IRPosition::callbase_function( cast(IRP.getAnchorValue())); } assert(IRP.getAssociatedFunction()); @@ -246,15 +246,15 @@ /// /// The anchor value might not be the associated value if the latter is not /// sufficient to determine where arguments will be manifested. This is, so - /// far, only the case for call site arguments as the value is not sufficient - /// to pinpoint them. Instead, we can use the call site as an anchor. + /// far, only the case for call base arguments as the value is not sufficient + /// to pinpoint them. Instead, we can use the call base as an anchor. Value &getAnchorValue() const { switch (getEncodingBits()) { case ENC_VALUE: case ENC_RETURNED_VALUE: case ENC_FLOATING_FUNCTION: return *getAsValuePtr(); - case ENC_CALL_SITE_ARGUMENT_USE: + case ENC_CALL_BASE_ARGUMENT_USE: return *(getAsUsePtr()->getUser()); default: llvm_unreachable("Unkown encoding!"); @@ -326,12 +326,12 @@ } /// Return the argument number of the associated value if it is an argument or - /// call site argument, otherwise a negative value. + /// call base argument, otherwise a negative value. int getArgNo() const { switch (getPositionKind()) { case IRPosition::IRP_ARGUMENT: return cast(getAsValuePtr())->getArgNo(); - case IRPosition::IRP_CALL_SITE_ARGUMENT: { + case IRPosition::IRP_CALL_BASE_ARGUMENT: { Use &U = *getAsUsePtr(); return cast(U.getUser())->getArgOperandNo(&U); } @@ -347,13 +347,13 @@ case IRPosition::IRP_FLOAT: break; case IRPosition::IRP_FUNCTION: - case IRPosition::IRP_CALL_SITE: + case IRPosition::IRP_CALL_BASE: return AttributeList::FunctionIndex; case IRPosition::IRP_RETURNED: - case IRPosition::IRP_CALL_SITE_RETURNED: + case IRPosition::IRP_CALL_BASE_RETURNED: return AttributeList::ReturnIndex; case IRPosition::IRP_ARGUMENT: - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE_ARGUMENT: return getArgNo() + AttributeList::FirstArgIndex; } llvm_unreachable( @@ -363,8 +363,8 @@ /// Return the associated position kind. Kind getPositionKind() const { char EncodingBits = getEncodingBits(); - if (EncodingBits == ENC_CALL_SITE_ARGUMENT_USE) - return IRP_CALL_SITE_ARGUMENT; + if (EncodingBits == ENC_CALL_BASE_ARGUMENT_USE) + return IRP_CALL_BASE_ARGUMENT; if (EncodingBits == ENC_FLOATING_FUNCTION) return IRP_FLOAT; @@ -376,8 +376,8 @@ if (isa(V)) return isReturnPosition(EncodingBits) ? IRP_RETURNED : IRP_FUNCTION; if (isa(V)) - return isReturnPosition(EncodingBits) ? IRP_CALL_SITE_RETURNED - : IRP_CALL_SITE; + return isReturnPosition(EncodingBits) ? IRP_CALL_BASE_RETURNED + : IRP_CALL_BASE; return IRP_FLOAT; } @@ -428,11 +428,11 @@ getAssociatedFunction()->setAttributes(AttrList); } - bool isAnyCallSitePosition() const { + bool isAnyCallBasePosition() const { switch (getPositionKind()) { - case IRPosition::IRP_CALL_SITE: - case IRPosition::IRP_CALL_SITE_RETURNED: - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE: + case IRPosition::IRP_CALL_BASE_RETURNED: + case IRPosition::IRP_CALL_BASE_ARGUMENT: return true; default: return false; @@ -467,31 +467,31 @@ Enc = {&AnchorVal, ENC_VALUE}; break; case IRPosition::IRP_FUNCTION: - case IRPosition::IRP_CALL_SITE: + case IRPosition::IRP_CALL_BASE: Enc = {&AnchorVal, ENC_VALUE}; break; case IRPosition::IRP_RETURNED: - case IRPosition::IRP_CALL_SITE_RETURNED: + case IRPosition::IRP_CALL_BASE_RETURNED: Enc = {&AnchorVal, ENC_RETURNED_VALUE}; break; case IRPosition::IRP_ARGUMENT: Enc = {&AnchorVal, ENC_VALUE}; break; - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE_ARGUMENT: llvm_unreachable( - "Cannot create call site argument IRP with an anchor value!"); + "Cannot create call base argument IRP with an anchor value!"); break; } verify(); } /// IRPosition for the use \p U. The position kind \p PK needs to be - /// IRP_CALL_SITE_ARGUMENT, the anchor value is the user, the associated value + /// IRP_CALL_BASE_ARGUMENT, the anchor value is the user, the associated value /// the used value. explicit IRPosition(Use &U, Kind PK) { - assert(PK == IRP_CALL_SITE_ARGUMENT && - "Use constructor is for call site arguments only!"); - Enc = {&U, ENC_CALL_SITE_ARGUMENT_USE}; + assert(PK == IRP_CALL_BASE_ARGUMENT && + "Use constructor is for call base arguments only!"); + Enc = {&U, ENC_CALL_BASE_ARGUMENT_USE}; verify(); } @@ -509,42 +509,42 @@ Attributor &A) const; /// Return the underlying pointer as Value *, valid for all positions but - /// IRP_CALL_SITE_ARGUMENT. + /// IRP_CALL_BASE_ARGUMENT. Value *getAsValuePtr() const { - assert(getEncodingBits() != ENC_CALL_SITE_ARGUMENT_USE && + assert(getEncodingBits() != ENC_CALL_BASE_ARGUMENT_USE && "Not a value pointer!"); return reinterpret_cast(Enc.getPointer()); } /// Return the underlying pointer as Use *, valid only for - /// IRP_CALL_SITE_ARGUMENT positions. + /// IRP_CALL_BASE_ARGUMENT positions. Use *getAsUsePtr() const { - assert(getEncodingBits() == ENC_CALL_SITE_ARGUMENT_USE && + assert(getEncodingBits() == ENC_CALL_BASE_ARGUMENT_USE && "Not a value pointer!"); return reinterpret_cast(Enc.getPointer()); } - /// Return true if \p EncodingBits describe a returned or call site returned + /// Return true if \p EncodingBits describe a returned or call base returned /// position. static bool isReturnPosition(char EncodingBits) { return EncodingBits == ENC_RETURNED_VALUE; } - /// Return true if the encoding bits describe a returned or call site returned + /// Return true if the encoding bits describe a returned or call base returned /// position. bool isReturnPosition() const { return isReturnPosition(getEncodingBits()); } /// The encoding of the IRPosition is a combination of a pointer and two /// encoding bits. The values of the encoding bits are defined in the enum /// below. The pointer is either a Value* (for the first three encoding bit - /// combinations) or Use* (for ENC_CALL_SITE_ARGUMENT_USE). + /// combinations) or Use* (for ENC_CALL_BASE_ARGUMENT_USE). /// ///{ enum { ENC_VALUE = 0b00, ENC_RETURNED_VALUE = 0b01, ENC_FLOATING_FUNCTION = 0b10, - ENC_CALL_SITE_ARGUMENT_USE = 0b11, + ENC_CALL_BASE_ARGUMENT_USE = 0b11, }; // Reserve the maximal amount of bits so there is no need to mask out the @@ -581,17 +581,17 @@ /// - the function (IRP_FUNCTION) /// - for IRP_ARGUMENT: /// - the function (IRP_FUNCTION) -/// - for IRP_CALL_SITE: +/// - for IRP_CALL_BASE: /// - the callee (IRP_FUNCTION), if known -/// - for IRP_CALL_SITE_RETURNED: +/// - for IRP_CALL_BASE_RETURNED: /// - the callee (IRP_RETURNED), if known -/// - the call site (IRP_FUNCTION) +/// - the call base (IRP_FUNCTION) /// - the callee (IRP_FUNCTION), if known -/// - for IRP_CALL_SITE_ARGUMENT: +/// - for IRP_CALL_BASE_ARGUMENT: /// - the argument of the callee (IRP_ARGUMENT), if known /// - the callee (IRP_FUNCTION), if known -/// - the position the call site argument is associated with if it is not -/// anchored to the call site, e.g., if it is an argument then the argument +/// - the position the call base argument is associated with if it is not +/// anchored to the call base, e.g., if it is an argument then the argument /// (IRP_ARGUMENT) class SubsumingPositionIterator { SmallVector IRPositions; @@ -901,7 +901,7 @@ FnScope->hasFnAttribute(Attribute::OptimizeNone); // Bootstrap the new attribute with an initial update to propagate - // information, e.g., function -> call site. If it is not on a given + // information, e.g., function -> call base. If it is not on a given // Allowed we will not perform updates at all. if (Invalidate) { AA.getState().indicatePessimisticFixpoint(); @@ -1147,10 +1147,10 @@ using CalleeRepairCBTy = std::function; - /// Abstract call site (ACS) repair callback type + /// Abstract call base (ACS) repair callback type /// - /// The abstract call site repair callback is invoked once on every abstract - /// call site of the replaced function (\see ReplacedFn). The callback needs + /// The abstract call base repair callback is invoked once on every abstract + /// call base of the replaced function (\see ReplacedFn). The callback needs /// to provide the operands for the call to the new replacement function. /// The number and type of the operands appended to the provided vector /// (second argument) is defined by the number and types determined through @@ -1176,7 +1176,7 @@ private: /// Constructor that takes the argument to be replaced, the types of - /// the replacement arguments, as well as callbacks to repair the call sites + /// the replacement arguments, as well as callbacks to repair the call bases /// and new function after the replacement happened. ArgumentReplacementInfo(Attributor &A, Argument &Arg, ArrayRef ReplacementTypes, @@ -1202,7 +1202,7 @@ /// Callee repair callback, see CalleeRepairCBTy. const CalleeRepairCBTy CalleeRepairCB; - /// Abstract call site (ACS) repair callback, see ACSRepairCBTy. + /// Abstract call base (ACS) repair callback, see ACSRepairCBTy. const ACSRepairCBTy ACSRepairCB; /// Allow access to the private members from the Attributor. @@ -1222,7 +1222,7 @@ /// Register a rewrite for a function signature. /// /// The argument \p Arg is replaced with new ones defined by the number, - /// order, and types in \p ReplacementTypes. The rewiring at the call sites is + /// order, and types in \p ReplacementTypes. The rewiring at the call bases is /// done through \p ACSRepairCB and at the callee site through /// \p CalleeRepairCB. /// @@ -1232,16 +1232,16 @@ ArgumentReplacementInfo::CalleeRepairCBTy &&CalleeRepairCB, ArgumentReplacementInfo::ACSRepairCBTy &&ACSRepairCB); - /// Check \p Pred on all function call sites. + /// Check \p Pred on all function call bases. /// - /// This method will evaluate \p Pred on call sites and return - /// true if \p Pred holds in every call sites. However, this is only possible - /// all call sites are known, hence the function has internal linkage. - /// If true is returned, \p AllCallSitesKnown is set if all possible call + /// This method will evaluate \p Pred on call bases and return + /// true if \p Pred holds in every call bases. However, this is only possible + /// all call bases are known, hence the function has internal linkage. + /// If true is returned, \p AllCallBasesKnown is set if all possible call /// sites of the function have been visited. - bool checkForAllCallSites(function_ref Pred, + bool checkForAllCallBases(function_ref Pred, const AbstractAttribute &QueryingAA, - bool RequireAllCallSites, bool &AllCallSitesKnown); + bool RequireAllCallBases, bool &AllCallBasesKnown); /// Check \p Pred on all values potentially returned by \p F. /// @@ -1319,17 +1319,17 @@ /// may trigger further updates. (\see DependenceStack) void rememberDependences(); - /// Check \p Pred on all call sites of \p Fn. + /// Check \p Pred on all call bases of \p Fn. /// - /// This method will evaluate \p Pred on call sites and return - /// true if \p Pred holds in every call sites. However, this is only possible - /// all call sites are known, hence the function has internal linkage. - /// If true is returned, \p AllCallSitesKnown is set if all possible call + /// This method will evaluate \p Pred on call bases and return + /// true if \p Pred holds in every call bases. However, this is only possible + /// all call bases are known, hence the function has internal linkage. + /// If true is returned, \p AllCallBasesKnown is set if all possible call /// sites of the function have been visited. - bool checkForAllCallSites(function_ref Pred, - const Function &Fn, bool RequireAllCallSites, + bool checkForAllCallBases(function_ref Pred, + const Function &Fn, bool RequireAllCallBases, const AbstractAttribute *QueryingAA, - bool &AllCallSitesKnown); + bool &AllCallBasesKnown); /// Apply all requested function signature rewrites /// (\see registerFunctionSignatureRewrite) and return Changed if the module @@ -1964,7 +1964,7 @@ /// /// If the manifestation of the "concrete attribute" deduced by the subclass /// differs from the "default" behavior, which is a (set of) LLVM-IR -/// attribute(s) for an argument, call site argument, function return value, or +/// attribute(s) for an argument, call base argument, function return value, or /// function, the `AbstractAttribute::manifest` method should be overloaded. /// /// NOTE: If the state obtained via getState() is INVALID, thus if @@ -1977,7 +1977,7 @@ /// only be used at positions that precede the origin of the information /// with regards to the program flow. More practically, information can /// *now* be propagated from instructions to their enclosing function, but -/// *not* from call sites to the called function. The mechanisms to allow +/// *not* from call bases to the called function. The mechanisms to allow /// both directions will be added in the future. /// NOTE: The mechanics of adding a new "concrete" abstract attribute are /// described in the file comment. Index: llvm/lib/Transforms/IPO/Attributor.cpp =================================================================== --- llvm/lib/Transforms/IPO/Attributor.cpp +++ llvm/lib/Transforms/IPO/Attributor.cpp @@ -65,9 +65,9 @@ cl::desc("Verify that max-iterations is a tight bound for a fixpoint"), cl::init(false)); -static cl::opt AnnotateDeclarationCallSites( +static cl::opt AnnotateDeclarationCallBases( "attributor-annotate-decl-cs", cl::Hidden, - cl::desc("Annotate call sites of function declarations."), cl::init(false)); + cl::desc("Annotate call bases of function declarations."), cl::init(false)); static cl::opt EnableHeapToStack("enable-heap-to-stack-conversion", cl::init(true), cl::Hidden); @@ -136,15 +136,15 @@ if (getPositionKind() == IRP_ARGUMENT) return cast(&getAnchorValue()); - // Not an Argument and no argument number means this is not a call site + // Not an Argument and no argument number means this is not a call base // argument, thus we cannot find a callback argument to return. int ArgNo = getArgNo(); if (ArgNo < 0) return nullptr; - // Use abstract call sites to make the connection between the call site + // Use abstract call bases to make the connection between the call base // values and the ones in callbacks. If a callback was found that makes use - // of the underlying call site operand, we want the corresponding callback + // of the underlying call base operand, we want the corresponding callback // callee argument and not the direct callee argument. Optional CBCandidateArg; SmallVector CallbackUses; @@ -158,7 +158,7 @@ for (unsigned u = 0, e = ACS.getNumArgOperands(); u < e; u++) { - // Test if the underlying call site operand is argument number u of the + // Test if the underlying call base operand is argument number u of the // callback callee. if (ACS.getCallArgOperandNo(u) != ArgNo) continue; @@ -177,7 +177,7 @@ if (CBCandidateArg.hasValue() && CBCandidateArg.getValue()) return CBCandidateArg.getValue(); - // If no callbacks were found, or none used the underlying call site operand + // If no callbacks were found, or none used the underlying call base operand // exclusively, use the direct callee argument if available. const Function *Callee = CB.getCalledFunction(); if (Callee && Callee->arg_size() > unsigned(ArgNo)) @@ -221,9 +221,9 @@ case IRPosition::IRP_RETURNED: Attrs = ScopeFn->getAttributes(); break; - case IRPosition::IRP_CALL_SITE: - case IRPosition::IRP_CALL_SITE_RETURNED: - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE: + case IRPosition::IRP_CALL_BASE_RETURNED: + case IRPosition::IRP_CALL_BASE_ARGUMENT: Attrs = cast(IRP.getAnchorValue()).getAttributes(); break; } @@ -246,9 +246,9 @@ case IRPosition::IRP_RETURNED: ScopeFn->setAttributes(Attrs); break; - case IRPosition::IRP_CALL_SITE: - case IRPosition::IRP_CALL_SITE_RETURNED: - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE: + case IRPosition::IRP_CALL_BASE_RETURNED: + case IRPosition::IRP_CALL_BASE_ARGUMENT: cast(IRP.getAnchorValue()).setAttributes(Attrs); break; case IRPosition::IRP_INVALID: @@ -276,16 +276,16 @@ case IRPosition::IRP_RETURNED: IRPositions.emplace_back(IRPosition::function(*IRP.getAnchorScope())); return; - case IRPosition::IRP_CALL_SITE: - assert(CB && "Expected call site!"); + case IRPosition::IRP_CALL_BASE: + assert(CB && "Expected call base!"); // TODO: We need to look at the operand bundles similar to the redirection // in CallBase. if (!CB->hasOperandBundles()) if (const Function *Callee = CB->getCalledFunction()) IRPositions.emplace_back(IRPosition::function(*Callee)); return; - case IRPosition::IRP_CALL_SITE_RETURNED: - assert(CB && "Expected call site!"); + case IRPosition::IRP_CALL_BASE_RETURNED: + assert(CB && "Expected call base!"); // TODO: We need to look at the operand bundles similar to the redirection // in CallBase. if (!CB->hasOperandBundles()) { @@ -295,18 +295,18 @@ for (const Argument &Arg : Callee->args()) if (Arg.hasReturnedAttr()) { IRPositions.emplace_back( - IRPosition::callsite_argument(*CB, Arg.getArgNo())); + IRPosition::callbase_argument(*CB, Arg.getArgNo())); IRPositions.emplace_back( IRPosition::value(*CB->getArgOperand(Arg.getArgNo()))); IRPositions.emplace_back(IRPosition::argument(Arg)); } } } - IRPositions.emplace_back(IRPosition::callsite_function(*CB)); + IRPositions.emplace_back(IRPosition::callbase_function(*CB)); return; - case IRPosition::IRP_CALL_SITE_ARGUMENT: { + case IRPosition::IRP_CALL_BASE_ARGUMENT: { int ArgNo = IRP.getArgNo(); - assert(CB && ArgNo >= 0 && "Expected call site!"); + assert(CB && ArgNo >= 0 && "Expected call base!"); // TODO: We need to look at the operand bundles similar to the redirection // in CallBase. if (!CB->hasOperandBundles()) { @@ -419,15 +419,15 @@ assert(getAsValuePtr() == &getAssociatedValue() && "Associated value mismatch!"); return; - case IRP_CALL_SITE_RETURNED: + case IRP_CALL_BASE_RETURNED: assert((isa(getAsValuePtr())) && - "Expected call base for 'call site returned' position!"); + "Expected call base for 'call base returned' position!"); assert(getAsValuePtr() == &getAssociatedValue() && "Associated value mismatch!"); return; - case IRP_CALL_SITE: + case IRP_CALL_BASE: assert((isa(getAsValuePtr())) && - "Expected call base for 'call site function' position!"); + "Expected call base for 'call base function' position!"); assert(getAsValuePtr() == &getAssociatedValue() && "Associated value mismatch!"); return; @@ -443,13 +443,13 @@ assert(getAsValuePtr() == &getAssociatedValue() && "Associated value mismatch!"); return; - case IRP_CALL_SITE_ARGUMENT: { + case IRP_CALL_BASE_ARGUMENT: { Use *U = getAsUsePtr(); - assert(U && "Expected use for a 'call site argument' position!"); + assert(U && "Expected use for a 'call base argument' position!"); assert(isa(U->getUser()) && - "Expected call base user for a 'call site argument' position!"); + "Expected call base user for a 'call base argument' position!"); assert(cast(U->getUser())->isArgOperand(U) && - "Expected call base argument operand for a 'call site argument' " + "Expected call base argument operand for a 'call base argument' " "position"); assert(cast(U->getUser())->getArgOperandNo(U) == unsigned(getArgNo()) && @@ -514,11 +514,11 @@ CheckBBLivenessOnly, DepClass); if (auto *CB = dyn_cast(UserI)) { - // For call site argument uses we can check if the argument is + // For call base argument uses we can check if the argument is // unused/dead. if (CB->isArgOperand(&U)) { const IRPosition &CSArgPos = - IRPosition::callsite_argument(*CB, CB->getArgOperandNo(&U)); + IRPosition::callbase_argument(*CB, CB->getArgOperandNo(&U)); return isAssumedDead(CSArgPos, QueryingAA, FnLivenessAA, CheckBBLivenessOnly, DepClass); } @@ -588,9 +588,9 @@ // If we haven't succeeded we query the specific liveness info for the IRP. const AAIsDead *IsDeadAA; - if (IRP.getPositionKind() == IRPosition::IRP_CALL_SITE) + if (IRP.getPositionKind() == IRPosition::IRP_CALL_BASE) IsDeadAA = &getOrCreateAAFor( - IRPosition::callsite_returned(cast(IRP.getAssociatedValue())), + IRPosition::callbase_returned(cast(IRP.getAssociatedValue())), QueryingAA, /* TrackDependence */ false); else IsDeadAA = &getOrCreateAAFor(IRP, QueryingAA, @@ -673,42 +673,42 @@ return true; } -bool Attributor::checkForAllCallSites(function_ref Pred, +bool Attributor::checkForAllCallBases(function_ref Pred, const AbstractAttribute &QueryingAA, - bool RequireAllCallSites, - bool &AllCallSitesKnown) { + bool RequireAllCallBases, + bool &AllCallBasesKnown) { // We can try to determine information from - // the call sites. However, this is only possible all call sites are known, + // the call bases. However, this is only possible all call bases are known, // hence the function has internal linkage. const IRPosition &IRP = QueryingAA.getIRPosition(); const Function *AssociatedFunction = IRP.getAssociatedFunction(); if (!AssociatedFunction) { LLVM_DEBUG(dbgs() << "[Attributor] No function associated with " << IRP << "\n"); - AllCallSitesKnown = false; + AllCallBasesKnown = false; return false; } - return checkForAllCallSites(Pred, *AssociatedFunction, RequireAllCallSites, - &QueryingAA, AllCallSitesKnown); + return checkForAllCallBases(Pred, *AssociatedFunction, RequireAllCallBases, + &QueryingAA, AllCallBasesKnown); } -bool Attributor::checkForAllCallSites(function_ref Pred, +bool Attributor::checkForAllCallBases(function_ref Pred, const Function &Fn, - bool RequireAllCallSites, + bool RequireAllCallBases, const AbstractAttribute *QueryingAA, - bool &AllCallSitesKnown) { - if (RequireAllCallSites && !Fn.hasLocalLinkage()) { + bool &AllCallBasesKnown) { + if (RequireAllCallBases && !Fn.hasLocalLinkage()) { LLVM_DEBUG( dbgs() << "[Attributor] Function " << Fn.getName() - << " has no internal linkage, hence not all call sites are known\n"); - AllCallSitesKnown = false; + << " has no internal linkage, hence not all call bases are known\n"); + AllCallBasesKnown = false; return false; } - // If we do not require all call sites we might not see all. - AllCallSitesKnown = RequireAllCallSites; + // If we do not require all call bases we might not see all. + AllCallBasesKnown = RequireAllCallBases; SmallVector Uses(make_pointer_range(Fn.uses())); for (unsigned u = 0; u < Uses.size(); ++u) { @@ -731,7 +731,7 @@ AbstractCallSite ACS(&U); if (!ACS) { LLVM_DEBUG(dbgs() << "[Attributor] Function " << Fn.getName() - << " has non call site use " << *U.get() << " in " + << " has non call base use " << *U.get() << " in " << *U.getUser() << "\n"); // BlockAddress users are allowed. if (isa(U.getUser())) @@ -742,14 +742,14 @@ const Use *EffectiveUse = ACS.isCallbackCall() ? &ACS.getCalleeUseForCallback() : &U; if (!ACS.isCallee(EffectiveUse)) { - if (!RequireAllCallSites) + if (!RequireAllCallBases) continue; LLVM_DEBUG(dbgs() << "[Attributor] User " << EffectiveUse->getUser() << " is an invalid use of " << Fn.getName() << "\n"); return false; } - // Make sure the arguments that can be matched between the call site and the + // Make sure the arguments that can be matched between the call base and the // callee argee on their type. It is unlikely they do not and it doesn't // make sense for all attributes to know/care about this. assert(&Fn == ACS.getCalledFunction() && "Expected known callee"); @@ -759,7 +759,7 @@ Value *CSArgOp = ACS.getCallArgOperand(u); if (CSArgOp && Fn.getArg(u)->getType() != CSArgOp->getType()) { LLVM_DEBUG( - dbgs() << "[Attributor] Call site / callee argument type mismatch [" + dbgs() << "[Attributor] Call base / callee argument type mismatch [" << u << "@" << Fn.getName() << ": " << *Fn.getArg(u)->getType() << " vs. " << *ACS.getCallArgOperand(u)->getType() << "\n"); @@ -770,7 +770,7 @@ if (Pred(ACS)) continue; - LLVM_DEBUG(dbgs() << "[Attributor] Call site callback failed for " + LLVM_DEBUG(dbgs() << "[Attributor] Call base callback failed for " << *ACS.getInstruction() << "\n"); return false; } @@ -789,9 +789,9 @@ if (!AssociatedFunction) return false; - // If this is a call site query we use the call site specific return values + // If this is a call base query we use the call base specific return values // and liveness information. - // TODO: use the function scope once we have call site AAReturnedValues. + // TODO: use the function scope once we have call base AAReturnedValues. const IRPosition &QueryIRP = IRPosition::function(*AssociatedFunction); const auto &AARetVal = getAAFor(QueryingAA, QueryIRP); if (!AARetVal.getState().isValidState()) @@ -808,7 +808,7 @@ if (!AssociatedFunction) return false; - // TODO: use the function scope once we have call site AAReturnedValues. + // TODO: use the function scope once we have call base AAReturnedValues. const IRPosition &QueryIRP = IRPosition::function(*AssociatedFunction); const auto &AARetVal = getAAFor(QueryingAA, QueryIRP); if (!AARetVal.getState().isValidState()) @@ -855,7 +855,7 @@ if (!AssociatedFunction) return false; - // TODO: use the function scope once we have call site AAReturnedValues. + // TODO: use the function scope once we have call base AAReturnedValues. const IRPosition &QueryIRP = IRPosition::function(*AssociatedFunction); const auto &LivenessAA = getAAFor(QueryingAA, QueryIRP, /* TrackDependence */ false); @@ -877,7 +877,7 @@ if (!AssociatedFunction) return false; - // TODO: use the function scope once we have call site AAReturnedValues. + // TODO: use the function scope once we have call base AAReturnedValues. const IRPosition &QueryIRP = IRPosition::function(*AssociatedFunction); const auto &LivenessAA = getAAFor(QueryingAA, QueryIRP, /* TrackDependence */ false); @@ -1212,13 +1212,13 @@ if (!F) continue; - bool AllCallSitesKnown; - if (!checkForAllCallSites( + bool AllCallBasesKnown; + if (!checkForAllCallBases( [this](AbstractCallSite ACS) { return ToBeDeletedFunctions.count( ACS.getInstruction()->getFunction()); }, - *F, true, nullptr, AllCallSitesKnown)) + *F, true, nullptr, AllCallBasesKnown)) continue; ToBeDeletedFunctions.insert(F); @@ -1350,9 +1350,9 @@ bool Attributor::isValidFunctionSignatureRewrite( Argument &Arg, ArrayRef ReplacementTypes) { - auto CallSiteCanBeChanged = [](AbstractCallSite ACS) { - // Forbid the call site to cast the function return type. If we need to - // rewrite these functions we need to re-create a cast for the new call site + auto CallBaseCanBeChanged = [](AbstractCallSite ACS) { + // Forbid the call base to cast the function return type. If we need to + // rewrite these functions we need to re-create a cast for the new call base // (if the old had uses). if (!ACS.getCalledFunction() || ACS.getInstruction()->getType() != @@ -1381,10 +1381,10 @@ } // Avoid callbacks for now. - bool AllCallSitesKnown; - if (!checkForAllCallSites(CallSiteCanBeChanged, *Fn, true, nullptr, - AllCallSitesKnown)) { - LLVM_DEBUG(dbgs() << "[Attributor] Cannot rewrite all call sites\n"); + bool AllCallBasesKnown; + if (!checkForAllCallBases(CallBaseCanBeChanged, *Fn, true, nullptr, + AllCallBasesKnown)) { + LLVM_DEBUG(dbgs() << "[Attributor] Cannot rewrite all call bases\n"); return false; } @@ -1525,14 +1525,14 @@ // Set of all "call-like" instructions that invoke the old function mapped // to their new replacements. - SmallVector, 8> CallSitePairs; + SmallVector, 8> CallBasePairs; // Callback to create a new "call-like" instruction for a given one. - auto CallSiteReplacementCreator = [&](AbstractCallSite ACS) { + auto CallBaseReplacementCreator = [&](AbstractCallSite ACS) { CallBase *OldCB = cast(ACS.getInstruction()); const AttributeList &OldCallAttributeList = OldCB->getAttributes(); - // Collect the new argument operands for the replacement call site. + // Collect the new argument operands for the replacement call base. SmallVector NewArgOperands; SmallVector NewArgOperandAttributes; for (unsigned OldArgNum = 0; OldArgNum < ARIs.size(); ++OldArgNum) { @@ -1585,16 +1585,16 @@ Ctx, OldCallAttributeList.getFnAttributes(), OldCallAttributeList.getRetAttributes(), NewArgOperandAttributes)); - CallSitePairs.push_back({OldCB, NewCB}); + CallBasePairs.push_back({OldCB, NewCB}); return true; }; - // Use the CallSiteReplacementCreator to create replacement call sites. - bool AllCallSitesKnown; - bool Success = checkForAllCallSites(CallSiteReplacementCreator, *OldFn, - true, nullptr, AllCallSitesKnown); + // Use the CallBaseReplacementCreator to create replacement call bases. + bool AllCallBasesKnown; + bool Success = checkForAllCallBases(CallBaseReplacementCreator, *OldFn, + true, nullptr, AllCallBasesKnown); (void)Success; - assert(Success && "Assumed call site replacement to succeed!"); + assert(Success && "Assumed call base replacement to succeed!"); // Rewire the arguments. auto OldFnArgIt = OldFn->arg_begin(); @@ -1614,11 +1614,11 @@ } // Eliminate the instructions *after* we visited all of them. - for (auto &CallSitePair : CallSitePairs) { - CallBase &OldCB = *CallSitePair.first; - CallBase &NewCB = *CallSitePair.second; + for (auto &CallBasePair : CallBasePairs) { + CallBase &OldCB = *CallBasePair.first; + CallBase &NewCB = *CallBasePair.second; assert(OldCB.getType() == NewCB.getType() && - "Cannot handle call sites with different types!"); + "Cannot handle call bases with different types!"); ModifiedFns.insert(OldCB.getFunction()); CGUpdater.replaceCallSite(OldCB, NewCB); OldCB.replaceAllUsesWith(&NewCB); @@ -1743,7 +1743,7 @@ if (F.isDeclaration()) return; - // In non-module runs we need to look at the call sites of a function to + // In non-module runs we need to look at the call bases of a function to // determine if it is part of a must-tail call edge. This will influence what // attributes we can derive. InformationCache::FunctionInfo &FI = InfoCache.getFunctionInfo(F); @@ -1861,11 +1861,11 @@ } } - auto CallSitePred = [&](Instruction &I) -> bool { + auto CallBasePred = [&](Instruction &I) -> bool { auto &CB = cast(I); - IRPosition CBRetPos = IRPosition::callsite_returned(CB); + IRPosition CBRetPos = IRPosition::callbase_returned(CB); - // Call sites might be dead if they do not have side effects and no live + // Call bases might be dead if they do not have side effects and no live // users. The return value might be dead if there are no live users. getOrCreateAAFor(CBRetPos); @@ -1875,54 +1875,54 @@ if (!Callee) return true; - // Skip declarations except if annotations on their call sites were + // Skip declarations except if annotations on their call bases were // explicitly requested. - if (!AnnotateDeclarationCallSites && Callee->isDeclaration() && + if (!AnnotateDeclarationCallBases && Callee->isDeclaration() && !Callee->hasMetadata(LLVMContext::MD_callback)) return true; if (!Callee->getReturnType()->isVoidTy() && !CB.use_empty()) { - IRPosition CBRetPos = IRPosition::callsite_returned(CB); + IRPosition CBRetPos = IRPosition::callbase_returned(CB); - // Call site return integer values might be limited by a constant range. + // Call base return integer values might be limited by a constant range. if (Callee->getReturnType()->isIntegerTy()) getOrCreateAAFor(CBRetPos); } for (int I = 0, E = CB.getNumArgOperands(); I < E; ++I) { - IRPosition CBArgPos = IRPosition::callsite_argument(CB, I); + IRPosition CBArgPos = IRPosition::callbase_argument(CB, I); - // Every call site argument might be dead. + // Every call base argument might be dead. getOrCreateAAFor(CBArgPos); - // Call site argument might be simplified. + // Call base argument might be simplified. getOrCreateAAFor(CBArgPos); if (!CB.getArgOperand(I)->getType()->isPointerTy()) continue; - // Call site argument attribute "non-null". + // Call base argument attribute "non-null". getOrCreateAAFor(CBArgPos); - // Call site argument attribute "nocapture". + // Call base argument attribute "nocapture". getOrCreateAAFor(CBArgPos); - // Call site argument attribute "no-alias". + // Call base argument attribute "no-alias". getOrCreateAAFor(CBArgPos); - // Call site argument attribute "dereferenceable". + // Call base argument attribute "dereferenceable". getOrCreateAAFor(CBArgPos); - // Call site argument attribute "align". + // Call base argument attribute "align". getOrCreateAAFor(CBArgPos); - // Call site argument attribute + // Call base argument attribute // "readnone/readonly/writeonly/..." getOrCreateAAFor(CBArgPos); - // Call site argument attribute "nofree". + // Call base argument attribute "nofree". getOrCreateAAFor(CBArgPos); } return true; @@ -1931,7 +1931,7 @@ auto &OpcodeInstMap = InfoCache.getOpcodeInstMapForFunction(F); bool Success; Success = checkForAllInstructionsImpl( - nullptr, OpcodeInstMap, CallSitePred, nullptr, nullptr, + nullptr, OpcodeInstMap, CallBasePred, nullptr, nullptr, {(unsigned)Instruction::Invoke, (unsigned)Instruction::CallBr, (unsigned)Instruction::Call}); (void)Success; @@ -1968,15 +1968,15 @@ return OS << "flt"; case IRPosition::IRP_RETURNED: return OS << "fn_ret"; - case IRPosition::IRP_CALL_SITE_RETURNED: + case IRPosition::IRP_CALL_BASE_RETURNED: return OS << "cs_ret"; case IRPosition::IRP_FUNCTION: return OS << "fn"; - case IRPosition::IRP_CALL_SITE: + case IRPosition::IRP_CALL_BASE: return OS << "cs"; case IRPosition::IRP_ARGUMENT: return OS << "arg"; - case IRPosition::IRP_CALL_SITE_ARGUMENT: + case IRPosition::IRP_CALL_BASE_ARGUMENT: return OS << "cs_arg"; } llvm_unreachable("Unknown attribute position!"); Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp =================================================================== --- llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -73,17 +73,17 @@ STATS_DECLTRACK(NAME, Arguments, BUILD_STAT_MSG_IR_ATTR(arguments, NAME)) #define STATS_DECLTRACK_CSARG_ATTR(NAME) \ STATS_DECLTRACK(NAME, CSArguments, \ - BUILD_STAT_MSG_IR_ATTR(call site arguments, NAME)) + BUILD_STAT_MSG_IR_ATTR(call base arguments, NAME)) #define STATS_DECLTRACK_FN_ATTR(NAME) \ STATS_DECLTRACK(NAME, Function, BUILD_STAT_MSG_IR_ATTR(functions, NAME)) #define STATS_DECLTRACK_CS_ATTR(NAME) \ - STATS_DECLTRACK(NAME, CS, BUILD_STAT_MSG_IR_ATTR(call site, NAME)) + STATS_DECLTRACK(NAME, CS, BUILD_STAT_MSG_IR_ATTR(call base, NAME)) #define STATS_DECLTRACK_FNRET_ATTR(NAME) \ STATS_DECLTRACK(NAME, FunctionReturn, \ BUILD_STAT_MSG_IR_ATTR(function returns, NAME)) #define STATS_DECLTRACK_CSRET_ATTR(NAME) \ STATS_DECLTRACK(NAME, CSReturn, \ - BUILD_STAT_MSG_IR_ATTR(call site returns, NAME)) + BUILD_STAT_MSG_IR_ATTR(call base returns, NAME)) #define STATS_DECLTRACK_FLOATING_ATTR(NAME) \ STATS_DECLTRACK(NAME, Floating, \ ("Number of floating values known to be '" #NAME "'")) @@ -421,7 +421,7 @@ assert((QueryingAA.getIRPosition().getPositionKind() == IRPosition::IRP_RETURNED || QueryingAA.getIRPosition().getPositionKind() == - IRPosition::IRP_CALL_SITE_RETURNED) && + IRPosition::IRP_CALL_BASE_RETURNED) && "Can only clamp returned value states for a function returned or call " "site returned position!"); @@ -468,27 +468,27 @@ } }; -/// Clamp the information known at all call sites for a given argument +/// Clamp the information known at all call bases for a given argument /// (identified by \p QueryingAA) into \p S. template -static void clampCallSiteArgumentStates(Attributor &A, const AAType &QueryingAA, +static void clampCallBaseArgumentStates(Attributor &A, const AAType &QueryingAA, StateType &S) { - LLVM_DEBUG(dbgs() << "[Attributor] Clamp call site argument states for " + LLVM_DEBUG(dbgs() << "[Attributor] Clamp call base argument states for " << QueryingAA << " into " << S << "\n"); assert(QueryingAA.getIRPosition().getPositionKind() == IRPosition::IRP_ARGUMENT && - "Can only clamp call site argument states for an argument position!"); + "Can only clamp call base argument states for an argument position!"); // Use an optional state as there might not be any return values and we want // to join (IntegerState::operator&) the state of all there are. Optional T; - // The argument number which is also the call site argument number. + // The argument number which is also the call base argument number. unsigned ArgNo = QueryingAA.getIRPosition().getArgNo(); - auto CallSiteCheck = [&](AbstractCallSite ACS) { - const IRPosition &ACSArgPos = IRPosition::callsite_argument(ACS, ArgNo); + auto CallBaseCheck = [&](AbstractCallSite ACS) { + const IRPosition &ACSArgPos = IRPosition::callbase_argument(ACS, ArgNo); // Check if a coresponding argument was found or if it is on not associated // (which can happen for callback calls). if (ACSArgPos.getPositionKind() == IRPosition::IRP_INVALID) @@ -507,25 +507,25 @@ return T->isValidState(); }; - bool AllCallSitesKnown; - if (!A.checkForAllCallSites(CallSiteCheck, QueryingAA, true, - AllCallSitesKnown)) + bool AllCallBasesKnown; + if (!A.checkForAllCallBases(CallBaseCheck, QueryingAA, true, + AllCallBasesKnown)) S.indicatePessimisticFixpoint(); else if (T.hasValue()) S ^= *T; } -/// Helper class for generic deduction: call site argument -> argument position. +/// Helper class for generic deduction: call base argument -> argument position. template -struct AAArgumentFromCallSiteArguments : public BaseType { - AAArgumentFromCallSiteArguments(const IRPosition &IRP, Attributor &A) +struct AAArgumentFromCallBaseArguments : public BaseType { + AAArgumentFromCallBaseArguments(const IRPosition &IRP, Attributor &A) : BaseType(IRP, A) {} /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { StateType S(StateType::getBestState(this->getState())); - clampCallSiteArgumentStates(A, *this, S); + clampCallBaseArgumentStates(A, *this, S); // TODO: If we know we visited all incoming values, thus no are assumed // dead, we can take the known information from the state T. return clampStateAndIndicateChange(this->getState(), S); @@ -535,15 +535,15 @@ /// Helper class for generic replication: function returned -> cs returned. template -struct AACallSiteReturnedFromReturned : public BaseType { - AACallSiteReturnedFromReturned(const IRPosition &IRP, Attributor &A) +struct AACallBaseReturnedFromReturned : public BaseType { + AACallBaseReturnedFromReturned(const IRPosition &IRP, Attributor &A) : BaseType(IRP, A) {} /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { assert(this->getIRPosition().getPositionKind() == - IRPosition::IRP_CALL_SITE_RETURNED && - "Can only wrap function returned positions for call site returned " + IRPosition::IRP_CALL_BASE_RETURNED && + "Can only wrap function returned positions for call base returned " "positions!"); auto &S = this->getState(); @@ -692,7 +692,7 @@ if (const auto *CB = dyn_cast(&I)) { const auto &NoUnwindAA = - A.getAAFor(*this, IRPosition::callsite_function(*CB)); + A.getAAFor(*this, IRPosition::callbase_function(*CB)); return NoUnwindAA.isAssumedNoUnwind(); } return false; @@ -713,9 +713,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nounwind) } }; -/// NoUnwind attribute deduction for a call sites. -struct AANoUnwindCallSite final : AANoUnwindImpl { - AANoUnwindCallSite(const IRPosition &IRP, Attributor &A) +/// NoUnwind attribute deduction for a call bases. +struct AANoUnwindCallBase final : AANoUnwindImpl { + AANoUnwindCallBase(const IRPosition &IRP, Attributor &A) : AANoUnwindImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -728,9 +728,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -757,7 +757,7 @@ /// return instructions that might return them. MapVector> ReturnedValues; - /// Mapping to remember the number of returned values for a call site such + /// Mapping to remember the number of returned values for a call base such /// that we can avoid updates if nothing changed. DenseMap NumReturnedValuesPerKnownAA; @@ -890,7 +890,7 @@ "Number of function with unique return"); // Callback to replace the uses of CB with the constant C. - auto ReplaceCallSiteUsersWith = [&A](CallBase &CB, Constant &C) { + auto ReplaceCallBaseUsersWith = [&A](CallBase &CB, Constant &C) { if (CB.use_empty()) return ChangeStatus::UNCHANGED; if (A.changeValueAfterManifest(CB, C)) @@ -916,7 +916,7 @@ CB->getType() == RVC->getType() ? RVC : ConstantExpr::getTruncOrBitCast(RVC, CB->getType()); - Changed = ReplaceCallSiteUsersWith(*CB, *RVCCast) | Changed; + Changed = ReplaceCallBaseUsersWith(*CB, *RVCCast) | Changed; } } else { assert(isa(AnchorValue) && @@ -925,7 +925,7 @@ AnchorValue.getType() == RVC->getType() ? RVC : ConstantExpr::getTruncOrBitCast(RVC, AnchorValue.getType()); - Changed = ReplaceCallSiteUsersWith(cast(AnchorValue), *RVCCast); + Changed = ReplaceCallBaseUsersWith(cast(AnchorValue), *RVCCast); } if (Changed == ChangeStatus::CHANGED) STATS_DECLTRACK(UniqueConstantReturnValue, FunctionReturn, @@ -979,7 +979,7 @@ if (!isValidState()) return false; - // Check all returned values but ignore call sites as long as we have not + // Check all returned values but ignore call bases as long as we have not // encountered an overdefined one during an update. for (auto &It : ReturnedValues) { Value *RV = It.first; @@ -1066,7 +1066,7 @@ return; } - // TODO: use the function scope once we have call site AAReturnedValues. + // TODO: use the function scope once we have call base AAReturnedValues. const auto &RetValAA = A.getAAFor( *this, IRPosition::function(*CB->getCalledFunction())); LLVM_DEBUG(dbgs() << "[AAReturnedValues] Found another AAReturnedValues: " @@ -1122,14 +1122,14 @@ for (auto &RetValAAIt : RetValAA.returned_values()) { Value *RetVal = RetValAAIt.first; if (Argument *Arg = dyn_cast(RetVal)) { - // Arguments are mapped to call site operands and we begin the traversal + // Arguments are mapped to call base operands and we begin the traversal // again. bool Unused = false; RVState RVS({NewRVsMap, Unused, RetValAAIt.second}); VisitReturnedValue(*CB->getArgOperand(Arg->getArgNo()), RVS, CB); continue; } else if (isa(RetVal)) { - // Call sites are resolved by the callee attribute over time, no need to + // Call bases are resolved by the callee attribute over time, no need to // do anything for us. continue; } else if (isa(RetVal)) { @@ -1176,19 +1176,19 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(returned) } }; -/// Returned values information for a call sites. -struct AAReturnedValuesCallSite final : AAReturnedValuesImpl { - AAReturnedValuesCallSite(const IRPosition &IRP, Attributor &A) +/// Returned values information for a call bases. +struct AAReturnedValuesCallBase final : AAReturnedValuesImpl { + AAReturnedValuesCallBase(const IRPosition &IRP, Attributor &A) : AAReturnedValuesImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). void initialize(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases instead of // redirecting requests to the callee. llvm_unreachable("Abstract attributes for returned values are not " - "supported for call sites yet!"); + "supported for call bases yet!"); } /// See AbstractAttribute::updateImpl(...). @@ -1327,7 +1327,7 @@ return true; const auto &NoSyncAA = - A.getAAFor(*this, IRPosition::callsite_function(*CB)); + A.getAAFor(*this, IRPosition::callbase_function(*CB)); if (NoSyncAA.isAssumedNoSync()) return true; return false; @@ -1364,9 +1364,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nosync) } }; -/// NoSync attribute deduction for a call sites. -struct AANoSyncCallSite final : AANoSyncImpl { - AANoSyncCallSite(const IRPosition &IRP, Attributor &A) +/// NoSync attribute deduction for a call bases. +struct AANoSyncCallBase final : AANoSyncImpl { + AANoSyncCallBase(const IRPosition &IRP, Attributor &A) : AANoSyncImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -1379,9 +1379,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -1407,7 +1407,7 @@ return true; const auto &NoFreeAA = - A.getAAFor(*this, IRPosition::callsite_function(CB)); + A.getAAFor(*this, IRPosition::callbase_function(CB)); return NoFreeAA.isAssumedNoFree(); }; @@ -1430,9 +1430,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nofree) } }; -/// NoFree attribute deduction for a call sites. -struct AANoFreeCallSite final : AANoFreeImpl { - AANoFreeCallSite(const IRPosition &IRP, Attributor &A) +/// NoFree attribute deduction for a call bases. +struct AANoFreeCallBase final : AANoFreeImpl { + AANoFreeCallBase(const IRPosition &IRP, Attributor &A) : AANoFreeImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -1445,9 +1445,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -1488,7 +1488,7 @@ unsigned ArgNo = CB->getArgOperandNo(&U); const auto &NoFreeArg = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo)); + *this, IRPosition::callbase_argument(*CB, ArgNo)); return NoFreeArg.isAssumedNoFree(); } @@ -1510,7 +1510,7 @@ } }; -/// NoFree attribute for a call site argument. +/// NoFree attribute for a call base argument. struct AANoFreeArgument final : AANoFreeFloating { AANoFreeArgument(const IRPosition &IRP, Attributor &A) : AANoFreeFloating(IRP, A) {} @@ -1519,16 +1519,16 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(nofree) } }; -/// NoFree attribute for call site arguments. -struct AANoFreeCallSiteArgument final : AANoFreeFloating { - AANoFreeCallSiteArgument(const IRPosition &IRP, Attributor &A) +/// NoFree attribute for call base arguments. +struct AANoFreeCallBaseArgument final : AANoFreeFloating { + AANoFreeCallBaseArgument(const IRPosition &IRP, Attributor &A) : AANoFreeFloating(IRP, A) {} /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Argument *Arg = getAssociatedArgument(); if (!Arg) @@ -1564,9 +1564,9 @@ void trackStatistics() const override {} }; -/// NoFree attribute deduction for a call site return value. -struct AANoFreeCallSiteReturned final : AANoFreeFloating { - AANoFreeCallSiteReturned(const IRPosition &IRP, Attributor &A) +/// NoFree attribute deduction for a call base return value. +struct AANoFreeCallBaseReturned final : AANoFreeFloating { + AANoFreeCallBaseReturned(const IRPosition &IRP, Attributor &A) : AANoFreeFloating(IRP, A) {} ChangeStatus manifest(Attributor &A) override { @@ -1608,7 +1608,7 @@ } unsigned ArgNo = CB->getArgOperandNo(U); - IRPosition IRP = IRPosition::callsite_argument(*CB, ArgNo); + IRPosition IRP = IRPosition::callbase_argument(*CB, ArgNo); // As long as we only use known information there is no need to track // dependences here. auto &DerefAA = A.getAAFor(QueryingAA, IRP, @@ -1773,27 +1773,27 @@ /// NonNull attribute for function argument. struct AANonNullArgument final - : AAArgumentFromCallSiteArguments { + : AAArgumentFromCallBaseArguments { AANonNullArgument(const IRPosition &IRP, Attributor &A) - : AAArgumentFromCallSiteArguments(IRP, A) {} + : AAArgumentFromCallBaseArguments(IRP, A) {} /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(nonnull) } }; -struct AANonNullCallSiteArgument final : AANonNullFloating { - AANonNullCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AANonNullCallBaseArgument final : AANonNullFloating { + AANonNullCallBaseArgument(const IRPosition &IRP, Attributor &A) : AANonNullFloating(IRP, A) {} /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { STATS_DECLTRACK_CSARG_ATTR(nonnull) } }; -/// NonNull attribute for a call site return position. -struct AANonNullCallSiteReturned final - : AACallSiteReturnedFromReturned { - AANonNullCallSiteReturned(const IRPosition &IRP, Attributor &A) - : AACallSiteReturnedFromReturned(IRP, A) {} +/// NonNull attribute for a call base return position. +struct AANonNullCallBaseReturned final + : AACallBaseReturnedFromReturned { + AANonNullCallBaseReturned(const IRPosition &IRP, Attributor &A) + : AACallBaseReturnedFromReturned(IRP, A) {} /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { STATS_DECLTRACK_CSRET_ATTR(nonnull) } @@ -1825,21 +1825,21 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // If all live call sites are known to be no-recurse, we are as well. - auto CallSitePred = [&](AbstractCallSite ACS) { + // If all live call bases are known to be no-recurse, we are as well. + auto CallBasePred = [&](AbstractCallSite ACS) { const auto &NoRecurseAA = A.getAAFor( *this, IRPosition::function(*ACS.getInstruction()->getFunction()), /* TrackDependence */ false, DepClassTy::OPTIONAL); return NoRecurseAA.isKnownNoRecurse(); }; - bool AllCallSitesKnown; - if (A.checkForAllCallSites(CallSitePred, *this, true, AllCallSitesKnown)) { - // If we know all call sites and all are known no-recurse, we are done. - // If all known call sites, which might not be all that exist, are known + bool AllCallBasesKnown; + if (A.checkForAllCallBases(CallBasePred, *this, true, AllCallBasesKnown)) { + // If we know all call bases and all are known no-recurse, we are done. + // If all known call bases, which might not be all that exist, are known // to be no-recurse, we are not done but we can continue to assume - // no-recurse. If one of the call sites we have not visited will become + // no-recurse. If one of the call bases we have not visited will become // live, another update is triggered. - if (AllCallSitesKnown) + if (AllCallBasesKnown) indicateOptimisticFixpoint(); return ChangeStatus::UNCHANGED; } @@ -1851,7 +1851,7 @@ return true; const auto &NoRecurseAA = - A.getAAFor(*this, IRPosition::callsite_function(CB)); + A.getAAFor(*this, IRPosition::callbase_function(CB)); if (!NoRecurseAA.isAssumedNoRecurse()) return false; @@ -1870,9 +1870,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(norecurse) } }; -/// NoRecurse attribute deduction for a call sites. -struct AANoRecurseCallSite final : AANoRecurseImpl { - AANoRecurseCallSite(const IRPosition &IRP, Attributor &A) +/// NoRecurse attribute deduction for a call bases. +struct AANoRecurseCallBase final : AANoRecurseImpl { + AANoRecurseCallBase(const IRPosition &IRP, Attributor &A) : AANoRecurseImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -1885,9 +1885,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -2160,7 +2160,7 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { auto CheckForWillReturn = [&](Instruction &I) { - IRPosition IPos = IRPosition::callsite_function(cast(I)); + IRPosition IPos = IRPosition::callbase_function(cast(I)); const auto &WillReturnAA = A.getAAFor(*this, IPos); if (WillReturnAA.isKnownWillReturn()) return true; @@ -2190,9 +2190,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(willreturn) } }; -/// WillReturn attribute deduction for a call sites. -struct AAWillReturnCallSite final : AAWillReturnImpl { - AAWillReturnCallSite(const IRPosition &IRP, Attributor &A) +/// WillReturn attribute deduction for a call bases. +struct AAWillReturnCallBase final : AAWillReturnImpl { + AAWillReturnCallBase(const IRPosition &IRP, Attributor &A) : AAWillReturnImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -2205,9 +2205,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -2314,8 +2314,8 @@ /// NoAlias attribute for an argument. struct AANoAliasArgument final - : AAArgumentFromCallSiteArguments { - using Base = AAArgumentFromCallSiteArguments; + : AAArgumentFromCallBaseArguments { + using Base = AAArgumentFromCallBaseArguments; AANoAliasArgument(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -2347,10 +2347,10 @@ // If the argument is never passed through callbacks, no-alias cannot break // synchronization. - bool AllCallSitesKnown; - if (A.checkForAllCallSites( + bool AllCallBasesKnown; + if (A.checkForAllCallBases( [](AbstractCallSite ACS) { return !ACS.isCallbackCall(); }, *this, - true, AllCallSitesKnown)) + true, AllCallBasesKnown)) return Base::updateImpl(A); // TODO: add no-alias but make sure it doesn't break synchronization by @@ -2366,8 +2366,8 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(noalias) } }; -struct AANoAliasCallSiteArgument final : AANoAliasImpl { - AANoAliasCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AANoAliasCallBaseArgument final : AANoAliasImpl { + AANoAliasCallBaseArgument(const IRPosition &IRP, Attributor &A) : AANoAliasImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -2383,8 +2383,8 @@ indicateOptimisticFixpoint(); } - /// Determine if the underlying value may alias with the call site argument - /// \p OtherArgNo of \p ICS (= the underlying call site). + /// Determine if the underlying value may alias with the call base argument + /// \p OtherArgNo of \p ICS (= the underlying call base). bool mayAliasWithArgument(Attributor &A, AAResults *&AAR, const AAMemoryBehavior &MemBehaviorAA, const CallBase &CB, unsigned OtherArgNo) { @@ -2398,7 +2398,7 @@ return false; auto &CBArgMemBehaviorAA = A.getAAFor( - *this, IRPosition::callsite_argument(CB, OtherArgNo), + *this, IRPosition::callbase_argument(CB, OtherArgNo), /* TrackDependence */ false); // If the argument is readnone, there is no read-write aliasing. @@ -2420,7 +2420,7 @@ if (!AAR) AAR = A.getInfoCache().getAAResultsForFunction(*getAnchorScope()); - // Try to rule it out at the call site. + // Try to rule it out at the call base. bool IsAliasing = !AAR || !AAR->isNoAlias(&getAssociatedValue(), ArgOp); LLVM_DEBUG(dbgs() << "[NoAliasCSArg] Check alias between " "callsite arguments: " @@ -2477,7 +2477,7 @@ unsigned ArgNo = CB->getArgOperandNo(&U); const auto &NoCaptureAA = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo)); + *this, IRPosition::callbase_argument(*CB, ArgNo)); if (NoCaptureAA.isAssumedNoCapture()) return true; @@ -2507,7 +2507,7 @@ A.recordDependence(NoCaptureAA, *this, DepClassTy::OPTIONAL); // Check there is no other pointer argument which could alias with the - // value passed at this call site. + // value passed at this call base. // TODO: AbstractCallSite const auto &CB = cast(getAnchorValue()); for (unsigned OtherArgNo = 0; OtherArgNo < CB.getNumArgOperands(); @@ -2562,7 +2562,7 @@ if (C->isNullValue() || isa(C)) return true; - /// For now, we can only deduce noalias if we have call sites. + /// For now, we can only deduce noalias if we have call bases. /// FIXME: add more support. if (!isa(&RV)) return false; @@ -2586,9 +2586,9 @@ void trackStatistics() const override { STATS_DECLTRACK_FNRET_ATTR(noalias) } }; -/// NoAlias attribute deduction for a call site return value. -struct AANoAliasCallSiteReturned final : AANoAliasImpl { - AANoAliasCallSiteReturned(const IRPosition &IRP, Attributor &A) +/// NoAlias attribute deduction for a call base return value. +struct AANoAliasCallBaseReturned final : AANoAliasImpl { + AANoAliasCallBaseReturned(const IRPosition &IRP, Attributor &A) : AANoAliasImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -2601,9 +2601,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::returned(*F); @@ -2667,7 +2667,7 @@ if (!CB || isa(CB)) return false; - const IRPosition &CallIRP = IRPosition::callsite_function(*CB); + const IRPosition &CallIRP = IRPosition::callbase_function(*CB); const auto &NoUnwindAA = A.getAndUpdateAAFor( *this, CallIRP, /* TrackDependence */ false); if (!NoUnwindAA.isAssumedNoUnwind()) @@ -2778,8 +2778,8 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(IsDead) } }; -struct AAIsDeadCallSiteArgument : public AAIsDeadValueImpl { - AAIsDeadCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AAIsDeadCallBaseArgument : public AAIsDeadValueImpl { + AAIsDeadCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAIsDeadValueImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -2790,9 +2790,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Argument *Arg = getAssociatedArgument(); if (!Arg) @@ -2819,8 +2819,8 @@ void trackStatistics() const override { STATS_DECLTRACK_CSARG_ATTR(IsDead) } }; -struct AAIsDeadCallSiteReturned : public AAIsDeadFloating { - AAIsDeadCallSiteReturned(const IRPosition &IRP, Attributor &A) +struct AAIsDeadCallBaseReturned : public AAIsDeadFloating { + AAIsDeadCallBaseReturned(const IRPosition &IRP, Attributor &A) : AAIsDeadFloating(IRP, A), IsAssumedSideEffectFree(true) {} /// See AAIsDead::isAssumedDead(). @@ -2881,15 +2881,15 @@ A.checkForAllInstructions([](Instruction &) { return true; }, *this, {Instruction::Ret}); - auto PredForCallSite = [&](AbstractCallSite ACS) { + auto PredForCallBase = [&](AbstractCallSite ACS) { if (ACS.isCallbackCall() || !ACS.getInstruction()) return false; return areAllUsesAssumedDead(A, *ACS.getInstruction()); }; - bool AllCallSitesKnown; - if (!A.checkForAllCallSites(PredForCallSite, *this, true, - AllCallSitesKnown)) + bool AllCallBasesKnown; + if (!A.checkForAllCallBases(PredForCallBase, *this, true, + AllCallBasesKnown)) return indicatePessimisticFixpoint(); return ChangeStatus::UNCHANGED; @@ -2958,7 +2958,7 @@ if (!CB) continue; const auto &NoReturnAA = A.getAndUpdateAAFor( - *this, IRPosition::callsite_function(*CB), /* TrackDependence */ true, + *this, IRPosition::callbase_function(*CB), /* TrackDependence */ true, DepClassTy::OPTIONAL); bool MayReturn = !NoReturnAA.isAssumedNoReturn(); if (MayReturn && (!Invoke2CallAllowed || !isa(CB))) @@ -3070,7 +3070,7 @@ identifyAliveSuccessors(Attributor &A, const CallBase &CB, AbstractAttribute &AA, SmallVectorImpl &AliveSuccessors) { - const IRPosition &IPos = IRPosition::callsite_function(CB); + const IRPosition &IPos = IRPosition::callbase_function(CB); const auto &NoReturnAA = A.getAndUpdateAAFor( AA, IPos, /* TrackDependence */ true, DepClassTy::OPTIONAL); @@ -3096,7 +3096,7 @@ if (AAIsDeadFunction::mayCatchAsynchronousExceptions(*II.getFunction())) { AliveSuccessors.push_back(&II.getUnwindDest()->front()); } else { - const IRPosition &IPos = IRPosition::callsite_function(II); + const IRPosition &IPos = IRPosition::callbase_function(II); const auto &AANoUnw = A.getAndUpdateAAFor( AA, IPos, /* TrackDependence */ true, DepClassTy::OPTIONAL); if (AANoUnw.isAssumedNoUnwind()) { @@ -3250,19 +3250,19 @@ return Change; } -/// Liveness information for a call sites. -struct AAIsDeadCallSite final : AAIsDeadFunction { - AAIsDeadCallSite(const IRPosition &IRP, Attributor &A) +/// Liveness information for a call bases. +struct AAIsDeadCallBase final : AAIsDeadFunction { + AAIsDeadCallBase(const IRPosition &IRP, Attributor &A) : AAIsDeadFunction(IRP, A) {} /// See AbstractAttribute::initialize(...). void initialize(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases instead of // redirecting requests to the callee. llvm_unreachable("Abstract attributes for liveness are not " - "supported for call sites yet!"); + "supported for call bases yet!"); } /// See AbstractAttribute::updateImpl(...). @@ -3484,10 +3484,10 @@ /// Dereferenceable attribute for an argument struct AADereferenceableArgument final - : AAArgumentFromCallSiteArguments { using Base = - AAArgumentFromCallSiteArguments; + AAArgumentFromCallBaseArguments; AADereferenceableArgument(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} @@ -3497,9 +3497,9 @@ } }; -/// Dereferenceable attribute for a call site argument. -struct AADereferenceableCallSiteArgument final : AADereferenceableFloating { - AADereferenceableCallSiteArgument(const IRPosition &IRP, Attributor &A) +/// Dereferenceable attribute for a call base argument. +struct AADereferenceableCallBaseArgument final : AADereferenceableFloating { + AADereferenceableCallBaseArgument(const IRPosition &IRP, Attributor &A) : AADereferenceableFloating(IRP, A) {} /// See AbstractAttribute::trackStatistics() @@ -3508,12 +3508,12 @@ } }; -/// Dereferenceable attribute deduction for a call site return value. -struct AADereferenceableCallSiteReturned final - : AACallSiteReturnedFromReturned { +/// Dereferenceable attribute deduction for a call base return value. +struct AADereferenceableCallBaseReturned final + : AACallBaseReturnedFromReturned { using Base = - AACallSiteReturnedFromReturned; - AADereferenceableCallSiteReturned(const IRPosition &IRP, Attributor &A) + AACallBaseReturnedFromReturned; + AADereferenceableCallBaseReturned(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} /// See AbstractAttribute::trackStatistics() @@ -3548,7 +3548,7 @@ return 0; unsigned ArgNo = CB->getArgOperandNo(U); - IRPosition IRP = IRPosition::callsite_argument(*CB, ArgNo); + IRPosition IRP = IRPosition::callbase_argument(*CB, ArgNo); // As long as we only use known information there is no need to track // dependences here. auto &AlignAA = A.getAAFor(QueryingAA, IRP, @@ -3736,8 +3736,8 @@ /// Align attribute for function argument. struct AAAlignArgument final - : AAArgumentFromCallSiteArguments { - using Base = AAArgumentFromCallSiteArguments; + : AAArgumentFromCallBaseArguments { + using Base = AAArgumentFromCallBaseArguments; AAAlignArgument(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} /// See AbstractAttribute::manifest(...). @@ -3754,8 +3754,8 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(aligned) } }; -struct AAAlignCallSiteArgument final : AAAlignFloating { - AAAlignCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AAAlignCallBaseArgument final : AAAlignFloating { + AAAlignCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAAlignFloating(IRP, A) {} /// See AbstractAttribute::manifest(...). @@ -3791,11 +3791,11 @@ void trackStatistics() const override { STATS_DECLTRACK_CSARG_ATTR(aligned) } }; -/// Align attribute deduction for a call site return value. -struct AAAlignCallSiteReturned final - : AACallSiteReturnedFromReturned { - using Base = AACallSiteReturnedFromReturned; - AAAlignCallSiteReturned(const IRPosition &IRP, Attributor &A) +/// Align attribute deduction for a call base return value. +struct AAAlignCallBaseReturned final + : AACallBaseReturnedFromReturned { + using Base = AACallBaseReturnedFromReturned; + AAAlignCallBaseReturned(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -3845,16 +3845,16 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(noreturn) } }; -/// NoReturn attribute deduction for a call sites. -struct AANoReturnCallSite final : AANoReturnImpl { - AANoReturnCallSite(const IRPosition &IRP, Attributor &A) +/// NoReturn attribute deduction for a call bases. +struct AANoReturnCallBase final : AANoReturnImpl { + AANoReturnCallBase(const IRPosition &IRP, Attributor &A) : AANoReturnImpl(IRP, A) {} /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -4051,7 +4051,7 @@ return isCapturedIn(/* Memory */ false, /* Integer */ false, /* Return */ true); - // For now we only use special logic for call sites. However, the tracker + // For now we only use special logic for call bases. However, the tracker // itself knows about a lot of other non-capturing cases already. auto *CB = dyn_cast(UInst); if (!CB || !CB->isArgOperand(U)) @@ -4059,7 +4059,7 @@ /* Return */ true); unsigned ArgNo = CB->getArgOperandNo(U); - const IRPosition &CSArgPos = IRPosition::callsite_argument(*CB, ArgNo); + const IRPosition &CSArgPos = IRPosition::callbase_argument(*CB, ArgNo); // If we have a abstract no-capture attribute for the argument we can use // it to justify a non-capture attribute here. This allows recursion! auto &ArgNoCaptureAA = A.getAAFor(NoCaptureAA, CSArgPos); @@ -4224,9 +4224,9 @@ void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(nocapture) } }; -/// NoCapture attribute for call site arguments. -struct AANoCaptureCallSiteArgument final : AANoCaptureImpl { - AANoCaptureCallSiteArgument(const IRPosition &IRP, Attributor &A) +/// NoCapture attribute for call base arguments. +struct AANoCaptureCallBaseArgument final : AANoCaptureImpl { + AANoCaptureCallBaseArgument(const IRPosition &IRP, Attributor &A) : AANoCaptureImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -4239,9 +4239,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Argument *Arg = getAssociatedArgument(); if (!Arg) @@ -4289,9 +4289,9 @@ void trackStatistics() const override {} }; -/// NoCapture attribute deduction for a call site return value. -struct AANoCaptureCallSiteReturned final : AANoCaptureImpl { - AANoCaptureCallSiteReturned(const IRPosition &IRP, Attributor &A) +/// NoCapture attribute deduction for a call base return value. +struct AANoCaptureCallBaseReturned final : AANoCaptureImpl { + AANoCaptureCallBaseReturned(const IRPosition &IRP, Attributor &A) : AANoCaptureImpl(IRP, A) {} /// See AbstractAttribute::trackStatistics() @@ -4466,16 +4466,16 @@ bool HasValueBefore = SimplifiedAssociatedValue.hasValue(); - auto PredForCallSite = [&](AbstractCallSite ACS) { + auto PredForCallBase = [&](AbstractCallSite ACS) { const IRPosition &ACSArgPos = - IRPosition::callsite_argument(ACS, getArgNo()); + IRPosition::callbase_argument(ACS, getArgNo()); // Check if a coresponding argument was found or if it is on not // associated (which can happen for callback calls). if (ACSArgPos.getPositionKind() == IRPosition::IRP_INVALID) return false; // We can only propagate thread independent values through callbacks. - // This is different to direct/indirect call sites because for them we + // This is different to direct/indirect call bases because for them we // know the thread executing the caller and callee is the same. For // callbacks this is not guaranteed, thus a thread dependent value could // be different for the caller and callee, making it invalid to propagate. @@ -4487,9 +4487,9 @@ return checkAndUpdate(A, *this, ArgOp, SimplifiedAssociatedValue); }; - bool AllCallSitesKnown; - if (!A.checkForAllCallSites(PredForCallSite, *this, true, - AllCallSitesKnown)) + bool AllCallBasesKnown; + if (!A.checkForAllCallBases(PredForCallBase, *this, true, + AllCallBasesKnown)) if (!askSimplifiedValueForAAValueConstantRange(A)) return indicatePessimisticFixpoint(); @@ -4636,7 +4636,7 @@ /// See AbstractAttribute::initialize(...). ChangeStatus updateImpl(Attributor &A) override { llvm_unreachable( - "AAValueSimplify(Function|CallSite)::updateImpl will not be called"); + "AAValueSimplify(Function|CallBase)::updateImpl will not be called"); } /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { @@ -4644,8 +4644,8 @@ } }; -struct AAValueSimplifyCallSite : AAValueSimplifyFunction { - AAValueSimplifyCallSite(const IRPosition &IRP, Attributor &A) +struct AAValueSimplifyCallBase : AAValueSimplifyFunction { + AAValueSimplifyCallBase(const IRPosition &IRP, Attributor &A) : AAValueSimplifyFunction(IRP, A) {} /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { @@ -4653,8 +4653,8 @@ } }; -struct AAValueSimplifyCallSiteReturned : AAValueSimplifyReturned { - AAValueSimplifyCallSiteReturned(const IRPosition &IRP, Attributor &A) +struct AAValueSimplifyCallBaseReturned : AAValueSimplifyReturned { + AAValueSimplifyCallBaseReturned(const IRPosition &IRP, Attributor &A) : AAValueSimplifyReturned(IRP, A) {} /// See AbstractAttribute::manifest(...). @@ -4666,8 +4666,8 @@ STATS_DECLTRACK_CSRET_ATTR(value_simplify) } }; -struct AAValueSimplifyCallSiteArgument : AAValueSimplifyFloating { - AAValueSimplifyCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AAValueSimplifyCallBaseArgument : AAValueSimplifyFloating { + AAValueSimplifyCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAValueSimplifyFloating(IRP, A) {} void trackStatistics() const override { @@ -4824,11 +4824,11 @@ unsigned ArgNo = CB->getArgOperandNo(&U); const auto &NoCaptureAA = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo)); + *this, IRPosition::callbase_argument(*CB, ArgNo)); // If a callsite argument use is nofree, we are fine. const auto &ArgNoFreeAA = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo)); + *this, IRPosition::callbase_argument(*CB, ArgNo)); if (!NoCaptureAA.isAssumedNoCapture() || !ArgNoFreeAA.isAssumedNoFree()) { @@ -4961,7 +4961,7 @@ Optional PrivatizableType; }; -// TODO: Do this for call site arguments (probably also other values) as well. +// TODO: Do this for call base arguments (probably also other values) as well. struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl { AAPrivatizablePtrArgument(const IRPosition &IRP, Attributor &A) @@ -4969,31 +4969,31 @@ /// See AAPrivatizablePtrImpl::identifyPrivatizableType(...) Optional identifyPrivatizableType(Attributor &A) override { - // If this is a byval argument and we know all the call sites (so we can + // If this is a byval argument and we know all the call bases (so we can // rewrite them), there is no need to check them explicitly. - bool AllCallSitesKnown; + bool AllCallBasesKnown; if (getIRPosition().hasAttr(Attribute::ByVal) && - A.checkForAllCallSites([](AbstractCallSite ACS) { return true; }, *this, - true, AllCallSitesKnown)) + A.checkForAllCallBases([](AbstractCallSite ACS) { return true; }, *this, + true, AllCallBasesKnown)) return getAssociatedValue().getType()->getPointerElementType(); Optional Ty; unsigned ArgNo = getIRPosition().getArgNo(); - // Make sure the associated call site argument has the same type at all call + // Make sure the associated call base argument has the same type at all call // sites and it is an allocation we know is safe to privatize, for now that // means we only allow alloca instructions. // TODO: We can additionally analyze the accesses in the callee to create // the type from that information instead. That is a little more // involved and will be done in a follow up patch. - auto CallSiteCheck = [&](AbstractCallSite ACS) { - IRPosition ACSArgPos = IRPosition::callsite_argument(ACS, ArgNo); + auto CallBaseCheck = [&](AbstractCallSite ACS) { + IRPosition ACSArgPos = IRPosition::callbase_argument(ACS, ArgNo); // Check if a coresponding argument was found or if it is one not // associated (which can happen for callback calls). if (ACSArgPos.getPositionKind() == IRPosition::IRP_INVALID) return false; - // Check that all call sites agree on a type. + // Check that all call bases agree on a type. auto &PrivCSArgAA = A.getAAFor(*this, ACSArgPos); Optional CSTy = PrivCSArgAA.getPrivatizableType(); @@ -5023,7 +5023,7 @@ return !Ty.hasValue() || Ty.getValue(); }; - if (!A.checkForAllCallSites(CallSiteCheck, *this, true, AllCallSitesKnown)) + if (!A.checkForAllCallBases(CallBaseCheck, *this, true, AllCallBasesKnown)) return nullptr; return Ty; } @@ -5083,7 +5083,7 @@ unsigned ArgNo = Arg->getArgNo(); - // Helper to check if for the given call site the associated argument is + // Helper to check if for the given call base the associated argument is // passed to a callback where the privatization would be different. auto IsCompatiblePrivArgOfCallback = [&](CallBase &CB) { SmallVector CallbackUses; @@ -5137,7 +5137,7 @@ return true; }; - // Helper to check if for the given call site the associated argument is + // Helper to check if for the given call base the associated argument is // passed to a direct call where the privatization would be different. auto IsCompatiblePrivArgOfDirectCS = [&](AbstractCallSite ACS) { CallBase *DC = cast(ACS.getInstruction()); @@ -5182,9 +5182,9 @@ }; // Helper to check if the associated argument is used at the given abstract - // call site in a way that is incompatible with the privatization assumed + // call base in a way that is incompatible with the privatization assumed // here. - auto IsCompatiblePrivArgOfOtherCallSite = [&](AbstractCallSite ACS) { + auto IsCompatiblePrivArgOfOtherCallBase = [&](AbstractCallSite ACS) { if (ACS.isDirectCall()) return IsCompatiblePrivArgOfCallback(*ACS.getInstruction()); if (ACS.isCallbackCall()) @@ -5192,9 +5192,9 @@ return false; }; - bool AllCallSitesKnown; - if (!A.checkForAllCallSites(IsCompatiblePrivArgOfOtherCallSite, *this, true, - AllCallSitesKnown)) + bool AllCallBasesKnown; + if (!A.checkForAllCallBases(IsCompatiblePrivArgOfOtherCallBase, *this, true, + AllCallBasesKnown)) return indicatePessimisticFixpoint(); return ChangeStatus::UNCHANGED; @@ -5342,7 +5342,7 @@ CI->setTailCall(false); }; - // Callback to repair a call site of the associated function. The elements + // Callback to repair a call base of the associated function. The elements // of the privatizable type are loaded prior to the call and passed to the // new function version. Attributor::ArgumentReplacementInfo::ACSRepairCBTy ACSRepairCB = @@ -5388,7 +5388,7 @@ } ChangeStatus updateImpl(Attributor &A) override { - llvm_unreachable("AAPrivatizablePtr(Floating|Returned|CallSiteReturned)::" + llvm_unreachable("AAPrivatizablePtr(Floating|Returned|CallBaseReturned)::" "updateImpl will not be called"); } @@ -5424,9 +5424,9 @@ } }; -struct AAPrivatizablePtrCallSiteArgument final +struct AAPrivatizablePtrCallBaseArgument final : public AAPrivatizablePtrFloating { - AAPrivatizablePtrCallSiteArgument(const IRPosition &IRP, Attributor &A) + AAPrivatizablePtrCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAPrivatizablePtrFloating(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -5471,9 +5471,9 @@ } }; -struct AAPrivatizablePtrCallSiteReturned final +struct AAPrivatizablePtrCallBaseReturned final : public AAPrivatizablePtrFloating { - AAPrivatizablePtrCallSiteReturned(const IRPosition &IRP, Attributor &A) + AAPrivatizablePtrCallBaseReturned(const IRPosition &IRP, Attributor &A) : AAPrivatizablePtrFloating(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -5695,8 +5695,8 @@ } }; -struct AAMemoryBehaviorCallSiteArgument final : AAMemoryBehaviorArgument { - AAMemoryBehaviorCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AAMemoryBehaviorCallBaseArgument final : AAMemoryBehaviorArgument { + AAMemoryBehaviorCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAMemoryBehaviorArgument(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -5713,9 +5713,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Argument *Arg = getAssociatedArgument(); const IRPosition &ArgPos = IRPosition::argument(*Arg); @@ -5736,9 +5736,9 @@ } }; -/// Memory behavior attribute for a call site return position. -struct AAMemoryBehaviorCallSiteReturned final : AAMemoryBehaviorFloating { - AAMemoryBehaviorCallSiteReturned(const IRPosition &IRP, Attributor &A) +/// Memory behavior attribute for a call base return position. +struct AAMemoryBehaviorCallBaseReturned final : AAMemoryBehaviorFloating { + AAMemoryBehaviorCallBaseReturned(const IRPosition &IRP, Attributor &A) : AAMemoryBehaviorFloating(IRP, A) {} /// See AbstractAttribute::manifest(...). @@ -5781,9 +5781,9 @@ } }; -/// AAMemoryBehavior attribute for call sites. -struct AAMemoryBehaviorCallSite final : AAMemoryBehaviorImpl { - AAMemoryBehaviorCallSite(const IRPosition &IRP, Attributor &A) +/// AAMemoryBehavior attribute for call bases. +struct AAMemoryBehaviorCallBase final : AAMemoryBehaviorImpl { + AAMemoryBehaviorCallBase(const IRPosition &IRP, Attributor &A) : AAMemoryBehaviorImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -5798,9 +5798,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -5832,7 +5832,7 @@ // state is as optimistic as it gets. if (const auto *CB = dyn_cast(&I)) { const auto &MemBehaviorAA = A.getAAFor( - *this, IRPosition::callsite_function(*CB)); + *this, IRPosition::callbase_function(*CB)); intersectAssumedBits(MemBehaviorAA.getAssumed()); return !isAtFixpoint(); } @@ -5888,7 +5888,7 @@ auto AssumedState = S.getAssumed(); // Liveness information to exclude dead users. - // TODO: Take the FnPos once we have call site specific liveness information. + // TODO: Take the FnPos once we have call base specific liveness information. const auto &LivenessAA = A.getAAFor( *this, IRPosition::function(*IRP.getAssociatedFunction()), /* TrackDependence */ false); @@ -5929,7 +5929,7 @@ return false; // By default we follow all uses assuming UserI might leak information on U, - // we have special handling for call sites operands though. + // we have special handling for call bases operands though. const auto *CB = dyn_cast(UserI); if (!CB || !CB->isArgOperand(U)) return true; @@ -5943,7 +5943,7 @@ if (U->get()->getType()->isPointerTy()) { unsigned ArgNo = CB->getArgOperandNo(U); const auto &ArgNoCaptureAA = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo), + *this, IRPosition::callbase_argument(*CB, ArgNo), /* TrackDependence */ true, DepClassTy::OPTIONAL); return !ArgNoCaptureAA.isAssumedNoCapture(); } @@ -5975,7 +5975,7 @@ case Instruction::Call: case Instruction::CallBr: case Instruction::Invoke: { - // For call sites we look at the argument memory behavior attribute (this + // For call bases we look at the argument memory behavior attribute (this // could be recursive!) in order to restrict our own state. const auto *CB = cast(UserI); @@ -5996,9 +5996,9 @@ // argument. IRPosition Pos; if (U->get()->getType()->isPointerTy()) - Pos = IRPosition::callsite_argument(*CB, CB->getArgOperandNo(U)); + Pos = IRPosition::callbase_argument(*CB, CB->getArgOperandNo(U)); else - Pos = IRPosition::callsite_function(*CB); + Pos = IRPosition::callbase_function(*CB); const auto &MemBehaviorAA = A.getAAFor( *this, Pos, /* TrackDependence */ true, DepClassTy::OPTIONAL); @@ -6322,7 +6322,7 @@ MLK = NO_LOCAL_MEM; } else if (const auto *CB = dyn_cast(&V)) { const auto &NoAliasAA = - A.getAAFor(*this, IRPosition::callsite_returned(*CB)); + A.getAAFor(*this, IRPosition::callbase_returned(*CB)); if (NoAliasAA.isAssumedNoAlias()) MLK = NO_MALLOCED_MEM; else @@ -6369,8 +6369,8 @@ // First check if we assume any memory is access is visible. const auto &CBMemLocationAA = - A.getAAFor(*this, IRPosition::callsite_function(*CB)); - LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Categorize call site: " << I + A.getAAFor(*this, IRPosition::callbase_function(*CB)); + LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Categorize call base: " << I << " [" << CBMemLocationAA << "]\n"); if (CBMemLocationAA.isAssumedReadNone()) @@ -6427,7 +6427,7 @@ continue; // Skip readnone arguments. - const IRPosition &ArgOpIRP = IRPosition::callsite_argument(*CB, ArgNo); + const IRPosition &ArgOpIRP = IRPosition::callbase_argument(*CB, ArgNo); const auto &ArgOpMemLocationAA = A.getAAFor( *this, ArgOpIRP, /* TrackDependence */ true, DepClassTy::OPTIONAL); @@ -6513,9 +6513,9 @@ } }; -/// AAMemoryLocation attribute for call sites. -struct AAMemoryLocationCallSite final : AAMemoryLocationImpl { - AAMemoryLocationCallSite(const IRPosition &IRP, Attributor &A) +/// AAMemoryLocation attribute for call bases. +struct AAMemoryLocationCallBase final : AAMemoryLocationImpl { + AAMemoryLocationCallBase(const IRPosition &IRP, Attributor &A) : AAMemoryLocationImpl(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -6530,9 +6530,9 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { - // TODO: Once we have call site specific value information we can provide - // call site specific liveness liveness information and then it makes - // sense to specialize attributes for call sites arguments instead of + // TODO: Once we have call base specific value information we can provide + // call base specific liveness liveness information and then it makes + // sense to specialize attributes for call bases arguments instead of // redirecting requests to the callee argument. Function *F = getAssociatedFunction(); const IRPosition &FnPos = IRPosition::function(*F); @@ -6746,9 +6746,9 @@ }; struct AAValueConstantRangeArgument final - : AAArgumentFromCallSiteArguments< + : AAArgumentFromCallBaseArguments< AAValueConstantRange, AAValueConstantRangeImpl, IntegerRangeState> { - using Base = AAArgumentFromCallSiteArguments< + using Base = AAArgumentFromCallBaseArguments< AAValueConstantRange, AAValueConstantRangeImpl, IntegerRangeState>; AAValueConstantRangeArgument(const IRPosition &IRP, Attributor &A) : Base(IRP, A) {} @@ -7002,7 +7002,7 @@ /// See AbstractAttribute::initialize(...). ChangeStatus updateImpl(Attributor &A) override { - llvm_unreachable("AAValueConstantRange(Function|CallSite)::updateImpl will " + llvm_unreachable("AAValueConstantRange(Function|CallBase)::updateImpl will " "not be called"); } @@ -7010,19 +7010,19 @@ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(value_range) } }; -struct AAValueConstantRangeCallSite : AAValueConstantRangeFunction { - AAValueConstantRangeCallSite(const IRPosition &IRP, Attributor &A) +struct AAValueConstantRangeCallBase : AAValueConstantRangeFunction { + AAValueConstantRangeCallBase(const IRPosition &IRP, Attributor &A) : AAValueConstantRangeFunction(IRP, A) {} /// See AbstractAttribute::trackStatistics() void trackStatistics() const override { STATS_DECLTRACK_CS_ATTR(value_range) } }; -struct AAValueConstantRangeCallSiteReturned - : AACallSiteReturnedFromReturned { - AAValueConstantRangeCallSiteReturned(const IRPosition &IRP, Attributor &A) - : AACallSiteReturnedFromReturned(IRP, A) {} /// See AbstractAttribute::initialize(...). @@ -7040,8 +7040,8 @@ STATS_DECLTRACK_CSRET_ATTR(value_range) } }; -struct AAValueConstantRangeCallSiteArgument : AAValueConstantRangeFloating { - AAValueConstantRangeCallSiteArgument(const IRPosition &IRP, Attributor &A) +struct AAValueConstantRangeCallBaseArgument : AAValueConstantRangeFloating { + AAValueConstantRangeCallBaseArgument(const IRPosition &IRP, Attributor &A) : AAValueConstantRangeFloating(IRP, A) {} /// See AbstractAttribute::trackStatistics() @@ -7094,10 +7094,10 @@ SWITCH_PK_INV(CLASS, IRP_FLOAT, "floating") \ SWITCH_PK_INV(CLASS, IRP_ARGUMENT, "argument") \ SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE_RETURNED, "call site returned") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE_ARGUMENT, "call site argument") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE_RETURNED, "call base returned") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE_ARGUMENT, "call base argument") \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE, CallBase) \ } \ return *AA; \ } @@ -7108,12 +7108,12 @@ switch (IRP.getPositionKind()) { \ SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \ SWITCH_PK_INV(CLASS, IRP_FUNCTION, "function") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE, "call site") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE, "call base") \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_RETURNED, Returned) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_RETURNED, CallBaseReturned) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_ARGUMENT, CallBaseArgument) \ } \ return *AA; \ } @@ -7124,12 +7124,12 @@ switch (IRP.getPositionKind()) { \ SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE, CallBase) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_RETURNED, Returned) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_RETURNED, CallBaseReturned) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_ARGUMENT, CallBaseArgument) \ } \ return *AA; \ } @@ -7142,9 +7142,9 @@ SWITCH_PK_INV(CLASS, IRP_ARGUMENT, "argument") \ SWITCH_PK_INV(CLASS, IRP_FLOAT, "floating") \ SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE_RETURNED, "call site returned") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE_ARGUMENT, "call site argument") \ - SWITCH_PK_INV(CLASS, IRP_CALL_SITE, "call site") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE_RETURNED, "call base returned") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE_ARGUMENT, "call base argument") \ + SWITCH_PK_INV(CLASS, IRP_CALL_BASE, "call base") \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \ } \ return *AA; \ @@ -7157,11 +7157,11 @@ SWITCH_PK_INV(CLASS, IRP_INVALID, "invalid") \ SWITCH_PK_INV(CLASS, IRP_RETURNED, "returned") \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FUNCTION, Function) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE, CallSite) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE, CallBase) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_FLOAT, Floating) \ SWITCH_PK_CREATE(CLASS, IRP, IRP_ARGUMENT, Argument) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_RETURNED, CallSiteReturned) \ - SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_SITE_ARGUMENT, CallSiteArgument) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_RETURNED, CallBaseReturned) \ + SWITCH_PK_CREATE(CLASS, IRP, IRP_CALL_BASE_ARGUMENT, CallBaseArgument) \ } \ return *AA; \ }