Index: llvm/include/llvm/Transforms/IPO/Attributor.h =================================================================== --- llvm/include/llvm/Transforms/IPO/Attributor.h +++ llvm/include/llvm/Transforms/IPO/Attributor.h @@ -115,6 +115,8 @@ #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/IR/AbstractCallSite.h" +#include "llvm/IR/Argument.h" +#include "llvm/IR/Attributes.h" #include "llvm/IR/ConstantRange.h" #include "llvm/IR/Constants.h" #include "llvm/IR/InstIterator.h" @@ -127,13 +129,16 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/DOTGraphTraits.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/ModRef.h" #include "llvm/Support/TimeProfiler.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Triple.h" #include "llvm/Transforms/Utils/CallGraphUpdater.h" #include #include #include +#include namespace llvm { @@ -4342,202 +4347,359 @@ static const char ID; }; -/// An abstract interface for memory access kind related attributes -/// (readnone/readonly/writeonly). -struct AAMemoryBehavior - : public IRAttribute< - Attribute::ReadNone, - StateWrapper, AbstractAttribute>> { - AAMemoryBehavior(const IRPosition &IRP, Attributor &A) : IRAttribute(IRP) {} +namespace AA { +/// The different locations tracked by the AAMemoryLocation attribute. +enum Location { + ArgMem = IRMemoryEffects::Location::ArgMem, + InaccessibleMem, + Other, + GlobalInternal, + GlobalExternal, + Malloced, + Local, + Const, + + First = ArgMem, + Last = Const, + LastObservable = Malloced, +}; +// Verify we do not diverge for the bits shared between Location and +// IRMemoryEffects::Location. +static_assert(int(Location::ArgMem) == int(IRMemoryEffects::Location::ArgMem), + "Enums diverged"); +static_assert(int(Location::InaccessibleMem) == + int(IRMemoryEffects::Location::InaccessibleMem), + "Enums diverged"); +static_assert(int(Location::Other) == int(IRMemoryEffects::Location::Other), + "Enums diverged"); +static_assert(int(Location::Other) == int(IRMemoryEffects::Location::Last), + "Enums diverged"); + +/// The memory effects tracked by the AAMemoryLocation attribute. +struct MemoryEffects : public MemoryEffectsBase { + using Base = MemoryEffectsBase; + using IRLocTy = IRMemoryEffects::Location; + using LLVMMemoryEffects = llvm::MemoryEffects; + + MemoryEffects(const Base &Other) + : Base(Base::createFromIntValue(Other.toIntValue())) {} + + /// Create MemoryEffects that can access only the given location with the + /// given ModRefInfo. + MemoryEffects(Location Loc, ModRefInfo MR) : Base(Loc, MR) {} + + /// Create MemoryEffects that can access any location with the given + /// ModRefInfo. + explicit MemoryEffects(ModRefInfo MR) : Base(MR) {} + + /// Convert LLVM-IR MemoryEffects into Attributor MemoryEffects + MemoryEffects(LLVMMemoryEffects ME) + : Base(Base::createFromIntValue(ME.toIntValue())) {} + + /// Returns iterator over all observable location kinds. + static auto observableLocations() { + return enum_seq_inclusive(AA::Location::First, AA::Location::LastObservable, + force_iteration_on_noniterable_enum); + } + + LLVMMemoryEffects getAsIRMemoryEffects() { + LLVMMemoryEffects ME = LLVMMemoryEffects::none(); + for (AA::Location Loc : observableLocations()) { + IRLocTy IRLoc = std::min(IRLocTy(Loc), IRLocTy::Other); + ME |= LLVMMemoryEffects(IRLoc, getModRef(Loc)); + } + return ME; + } - /// State encoding bits. A set bit in the state means the property holds. - /// BEST_STATE is the best possible state, 0 the worst possible state. - enum { - NO_READS = 1 << 0, - NO_WRITES = 1 << 1, - NO_ACCESSES = NO_READS | NO_WRITES, + static MemoryEffects constantMemOnly(ModRefInfo MR = ModRefInfo::ModRef) { + return MemoryEffects(Location::Const, MR); + } + static MemoryEffects anyObservableMem(ModRefInfo MR = ModRefInfo::ModRef) { + return MemoryEffects(MR) - nonObservableMem(MR); + } + static MemoryEffects nonObservableMem(ModRefInfo MR = ModRefInfo::ModRef) { + return MemoryEffects(Location::Const, MR) | + MemoryEffects(Location::Local, MR); + } + static MemoryEffects globalMemOnly(ModRefInfo MR = ModRefInfo::ModRef) { + return MemoryEffects(Location::GlobalInternal, MR) | + MemoryEffects(Location::GlobalExternal, MR); + } +}; - BEST_STATE = NO_ACCESSES, - }; - static_assert(BEST_STATE == getBestState(), "Unexpected BEST_STATE value"); +} // namespace AA - /// Return true if we know that the underlying value is not read or accessed - /// in its respective scope. - bool isKnownReadNone() const { return isKnown(NO_ACCESSES); } +raw_ostream &operator<<(raw_ostream &OS, AA::Location Loc); +raw_ostream &operator<<(raw_ostream &OS, AA::MemoryEffects AAME); - /// Return true if we assume that the underlying value is not read or accessed - /// in its respective scope. - bool isAssumedReadNone() const { return isAssumed(NO_ACCESSES); } +struct MemoryEffectsState : public AbstractState { - /// Return true if we know that the underlying value is not accessed - /// (=written) in its respective scope. - bool isKnownReadOnly() const { return isKnown(NO_WRITES); } + MemoryEffectsState(const IRPosition &IRP) { + // Function information. + AssumedEffects.push_back(AA::MemoryEffects::none()); + KnownEffects.push_back(AA::MemoryEffects::unknown()); - /// Return true if we assume that the underlying value is not accessed - /// (=written) in its respective scope. - bool isAssumedReadOnly() const { return isAssumed(NO_WRITES); } + // Argument information. + for (unsigned ArgNo = 0, NA = IRP.getNumArgs(); ArgNo != NA; ++ArgNo) { + ArgMapping.push_back(AssumedEffects.size()); + // Not a pointer, skip. + if (!IRP.getArg(ArgNo)->getType()->isPointerTy()) + continue; + AssumedEffects.push_back(AA::MemoryEffects::none()); + KnownEffects.push_back(AA::MemoryEffects::unknown()); + }; - /// Return true if we know that the underlying value is not read in its - /// respective scope. - bool isKnownWriteOnly() const { return isKnown(NO_READS); } + ValidMemoryEffects = AssumedEffects.size(); + NonFixMemoryEffects = AssumedEffects.size(); + } - /// Return true if we assume that the underlying value is not read in its - /// respective scope. - bool isAssumedWriteOnly() const { return isAssumed(NO_READS); } + /// See AbstractState::isValidState(...) + bool isValidState() const override { return ValidMemoryEffects; } - /// Create an abstract attribute view for the position \p IRP. - static AAMemoryBehavior &createForPosition(const IRPosition &IRP, - Attributor &A); + /// See AbstractState::isAtFixpoint(...) + bool isAtFixpoint() const override { return !NonFixMemoryEffects; } - /// See AbstractAttribute::getName() - const std::string getName() const override { return "AAMemoryBehavior"; } + bool isAtFixpoint(IRPosition::Kind IRPKind, unsigned ArgNo = 0) const { + unsigned Idx = getIndex(IRPKind, ArgNo); + const AA::MemoryEffects &Assumed = AssumedEffects[Idx]; + const AA::MemoryEffects &Known = KnownEffects[Idx]; + return Assumed == Known; + } - /// See AbstractAttribute::getIdAddr() - const char *getIdAddr() const override { return &ID; } + /// See AbstractState::indicateOptimisticFixpoint(...) + ChangeStatus indicateOptimisticFixpoint() override { + NonFixMemoryEffects = 0; + for (auto [AE, KE] : zip(AssumedEffects, KnownEffects)) + KE = AE; + for (auto [AE, KE] : zip(AssumedEffects, KnownEffects)) + assert(KE == AE); + return ChangeStatus::UNCHANGED; + } - /// This function should return true if the type of the \p AA is - /// AAMemoryBehavior - static bool classof(const AbstractAttribute *AA) { - return (AA->getIdAddr() == &ID); + ChangeStatus indicatePessimisticFixpoint(IRPosition::Kind IRPKind, + unsigned ArgNo = 0) { + unsigned Idx = getIndex(IRPKind, ArgNo); + AA::MemoryEffects &Assumed = AssumedEffects[Idx]; + AA::MemoryEffects &Known = KnownEffects[Idx]; + if (Assumed == Known) + return ChangeStatus::UNCHANGED; + --NonFixMemoryEffects; + Assumed = Known; + AA::MemoryEffects WorstState = AA::MemoryEffects::unknown(); + if (Assumed == WorstState) + --ValidMemoryEffects; + return ChangeStatus::CHANGED; } - /// Unique ID (due to the unique address) - static const char ID; + /// See AbstractState::indicatePessimisticFixpoint(...) + ChangeStatus indicatePessimisticFixpoint() override { + NonFixMemoryEffects = 0; + AA::MemoryEffects WorstState = AA::MemoryEffects::unknown(); + for (auto [AE, KE] : zip(AssumedEffects, KnownEffects)) { + if (AE == KE) + continue; + if (KE == WorstState) + --ValidMemoryEffects; + AE = KE; + } + for (auto [AE, KE] : zip(AssumedEffects, KnownEffects)) + assert(KE == AE); + return ChangeStatus::CHANGED; + } + + ChangeStatus restrictAssume(IRPosition::Kind IRPKind, AA::MemoryEffects AAME, + unsigned ArgNo = 0) { + unsigned Idx = getIndex(IRPKind, ArgNo); + + AA::MemoryEffects &Assumed = AssumedEffects[Idx]; + AA::MemoryEffects After = Assumed | AAME; + if (Assumed == After) + return ChangeStatus::UNCHANGED; + + Assumed = After; + + AA::MemoryEffects WorstState = AA::MemoryEffects::unknown(); + if (After == WorstState) + --ValidMemoryEffects; + + if (After == KnownEffects[Idx]) + --NonFixMemoryEffects; + + return ChangeStatus::CHANGED; + } + + ChangeStatus expandKnown(IRPosition::Kind IRPKind, AA::MemoryEffects AAME, + unsigned ArgNo = 0) { + unsigned Idx = getIndex(IRPKind, ArgNo); + + AA::MemoryEffects &Known = KnownEffects[Idx]; + AA::MemoryEffects After = Known & AAME; + if (Known == After) + return ChangeStatus::UNCHANGED; + + Known = After; + + if (After == AssumedEffects[Idx]) + --NonFixMemoryEffects; + + return ChangeStatus::CHANGED; + } + + AA::MemoryEffects getAssumed(IRPosition::Kind IRPKind, + unsigned ArgNo = 0) const { + return AssumedEffects[getIndex(IRPKind, ArgNo)]; + } + AA::MemoryEffects getKnown(IRPosition::Kind IRPKind, + unsigned ArgNo = 0) const { + return KnownEffects[getIndex(IRPKind, ArgNo)]; + } + + bool isAssumed(IRPosition::Kind IRPKind, AA::MemoryEffects AAME, + unsigned ArgNo = 0) const { + unsigned Idx = getIndex(IRPKind, ArgNo); + AA::MemoryEffects Assumed = AssumedEffects[Idx]; + return (Assumed | AAME) == AAME; + } + bool isKnown(IRPosition::Kind IRPKind, AA::MemoryEffects AAME, + unsigned ArgNo = 0) const { + unsigned Idx = getIndex(IRPKind, ArgNo); + AA::MemoryEffects Known = KnownEffects[Idx]; + return (Known | AAME) == AAME; + } + + bool hasPtrArgs() const { return AssumedEffects.size() > 1; } + +private: + unsigned getIndex(IRPosition::Kind IRPKind, unsigned ArgNo) const { + switch (IRPKind) { + case IRPosition::IRP_FUNCTION: + case IRPosition::IRP_CALL_SITE: + return 0; + case IRPosition::IRP_ARGUMENT: + case IRPosition::IRP_CALL_SITE_ARGUMENT: + return ArgMapping[ArgNo]; + default: + llvm_unreachable("Unexpected IRPosition kind"); + } + } + + unsigned ValidMemoryEffects; + unsigned NonFixMemoryEffects; + SmallVector ArgMapping; + SmallVector AssumedEffects, KnownEffects; }; -/// An abstract interface for all memory location attributes -/// (readnone/argmemonly/inaccessiblememonly/inaccessibleorargmemonly). +/// An abstract interface for all memory location and behavior attributes, thus +/// the cross product of the locations +/// (argmemonly/inaccessiblememonly/inaccessibleorargmemonly/...) with the +/// behaviors (readnone, readonly, writeonly). The information is deduced on a +/// per function basis for the function and the arguments. struct AAMemoryLocation - : public IRAttribute< - Attribute::ReadNone, - StateWrapper, AbstractAttribute>> { - using MemoryLocationsKind = StateType::base_t; + : public StateWrapper { + using Base = + StateWrapper; - AAMemoryLocation(const IRPosition &IRP, Attributor &A) : IRAttribute(IRP) {} - - /// Encoding of different locations that could be accessed by a memory - /// access. - enum { - ALL_LOCATIONS = 0, - NO_LOCAL_MEM = 1 << 0, - NO_CONST_MEM = 1 << 1, - NO_GLOBAL_INTERNAL_MEM = 1 << 2, - NO_GLOBAL_EXTERNAL_MEM = 1 << 3, - NO_GLOBAL_MEM = NO_GLOBAL_INTERNAL_MEM | NO_GLOBAL_EXTERNAL_MEM, - NO_ARGUMENT_MEM = 1 << 4, - NO_INACCESSIBLE_MEM = 1 << 5, - NO_MALLOCED_MEM = 1 << 6, - NO_UNKOWN_MEM = 1 << 7, - NO_LOCATIONS = NO_LOCAL_MEM | NO_CONST_MEM | NO_GLOBAL_INTERNAL_MEM | - NO_GLOBAL_EXTERNAL_MEM | NO_ARGUMENT_MEM | - NO_INACCESSIBLE_MEM | NO_MALLOCED_MEM | NO_UNKOWN_MEM, - - // Helper bit to track if we gave up or not. - VALID_STATE = NO_LOCATIONS + 1, - - BEST_STATE = NO_LOCATIONS | VALID_STATE, - }; - static_assert(BEST_STATE == getBestState(), "Unexpected BEST_STATE value"); + AAMemoryLocation(const IRPosition &IRP, Attributor &A) : Base(IRP, IRP) {} /// Return true if we know that the associated functions has no observable /// accesses. - bool isKnownReadNone() const { return isKnown(NO_LOCATIONS); } + bool isKnownReadNone(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getKnown(IRPKind, ArgNo) & AA::MemoryEffects::anyObservableMem()) + .doesNotAccessMemory(); + } - /// Return true if we assume that the associated functions has no observable + /// Return true if we assume that the associated \p IRPKind has no observable /// accesses. - bool isAssumedReadNone() const { - return isAssumed(NO_LOCATIONS) || isAssumedStackOnly(); + bool isAssumedReadNone(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getAssumed(IRPKind, ArgNo) & AA::MemoryEffects::anyObservableMem()) + .doesNotAccessMemory(); } - /// Return true if we know that the associated functions has at most - /// local/stack accesses. - bool isKnowStackOnly() const { - return isKnown(inverseLocation(NO_LOCAL_MEM, true, true)); + /// Return true if we know that the associated functions only reads + /// (observable memory). + bool isKnownReadOnly(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getKnown(IRPKind, ArgNo) & AA::MemoryEffects::anyObservableMem()) + .onlyReadsMemory(); } - /// Return true if we assume that the associated functions has at most - /// local/stack accesses. - bool isAssumedStackOnly() const { - return isAssumed(inverseLocation(NO_LOCAL_MEM, true, true)); + /// Return true if we assume that the associated \p IRPKind only reads + /// (observable memory). + bool isAssumedReadOnly(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getAssumed(IRPKind, ArgNo) & AA::MemoryEffects::anyObservableMem()) + .onlyReadsMemory(); + } + + /// Return true if we know that the associated functions only writes + /// (observable memory). + bool isKnownWriteOnly(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getKnown(IRPKind, ArgNo) & AA::MemoryEffects::nonObservableMem()) + .onlyWritesMemory(); + } + + /// Return true if we assume that the associated functions only writes + /// (observable memory). + bool isAssumedWriteOnly(IRPosition::Kind IRPKind = IRP_FUNCTION, + unsigned ArgNo = 0) const { + return (getAssumed(IRPKind, ArgNo) & AA::MemoryEffects::nonObservableMem()) + .onlyWritesMemory(); } /// Return true if we know that the underlying value will only access /// inaccesible memory only (see Attribute::InaccessibleMemOnly). bool isKnownInaccessibleMemOnly() const { - return isKnown(inverseLocation(NO_INACCESSIBLE_MEM, true, true)); + return isKnown(IRP_FUNCTION, AA::MemoryEffects::inaccessibleMemOnly()); } /// Return true if we assume that the underlying value will only access /// inaccesible memory only (see Attribute::InaccessibleMemOnly). bool isAssumedInaccessibleMemOnly() const { - return isAssumed(inverseLocation(NO_INACCESSIBLE_MEM, true, true)); + return isAssumed(IRP_FUNCTION, AA::MemoryEffects::inaccessibleMemOnly()); } /// Return true if we know that the underlying value will only access /// argument pointees (see Attribute::ArgMemOnly). bool isKnownArgMemOnly() const { - return isKnown(inverseLocation(NO_ARGUMENT_MEM, true, true)); + return isKnown(IRP_FUNCTION, AA::MemoryEffects::argMemOnly()); } /// Return true if we assume that the underlying value will only access /// argument pointees (see Attribute::ArgMemOnly). bool isAssumedArgMemOnly() const { - return isAssumed(inverseLocation(NO_ARGUMENT_MEM, true, true)); + return isAssumed(IRP_FUNCTION, AA::MemoryEffects::argMemOnly()); } /// Return true if we know that the underlying value will only access /// inaccesible memory or argument pointees (see /// Attribute::InaccessibleOrArgMemOnly). bool isKnownInaccessibleOrArgMemOnly() const { - return isKnown( - inverseLocation(NO_INACCESSIBLE_MEM | NO_ARGUMENT_MEM, true, true)); + return isKnown(IRP_FUNCTION, AA::MemoryEffects::inaccessibleOrArgMemOnly()); } /// Return true if we assume that the underlying value will only access /// inaccesible memory or argument pointees (see /// Attribute::InaccessibleOrArgMemOnly). bool isAssumedInaccessibleOrArgMemOnly() const { - return isAssumed( - inverseLocation(NO_INACCESSIBLE_MEM | NO_ARGUMENT_MEM, true, true)); + return isAssumed(IRP_FUNCTION, + AA::MemoryEffects::inaccessibleOrArgMemOnly()); } - /// Return true if the underlying value may access memory through arguement - /// pointers of the associated function, if any. - bool mayAccessArgMem() const { return !isAssumed(NO_ARGUMENT_MEM); } - - /// Return true if only the memory locations specififed by \p MLK are assumed - /// to be accessed by the associated function. - bool isAssumedSpecifiedMemOnly(MemoryLocationsKind MLK) const { - return isAssumed(MLK); + /// Return the locations that are known to be not accessed by the associated + /// function, if any. + AA::MemoryEffects getKnownAccessedLocation() const { + return getKnown(IRP_FUNCTION); } /// Return the locations that are assumed to be not accessed by the associated /// function, if any. - MemoryLocationsKind getAssumedNotAccessedLocation() const { - return getAssumed(); - } - - /// Return the inverse of location \p Loc, thus for NO_XXX the return - /// describes ONLY_XXX. The flags \p AndLocalMem and \p AndConstMem determine - /// if local (=stack) and constant memory are allowed as well. Most of the - /// time we do want them to be included, e.g., argmemonly allows accesses via - /// argument pointers or local or constant memory accesses. - static MemoryLocationsKind - inverseLocation(MemoryLocationsKind Loc, bool AndLocalMem, bool AndConstMem) { - return NO_LOCATIONS & ~(Loc | (AndLocalMem ? NO_LOCAL_MEM : 0) | - (AndConstMem ? NO_CONST_MEM : 0)); - }; - - /// Return the locations encoded by \p MLK as a readable string. - static std::string getMemoryLocationsAsStr(MemoryLocationsKind MLK); - - /// Simple enum to distinguish read/write/read-write accesses. - enum AccessKind { - NONE = 0, - READ = 1 << 0, - WRITE = 1 << 1, - READ_WRITE = READ | WRITE, - }; + AA::MemoryEffects getAssumedAccessedLocation() const { + return getAssumed(IRP_FUNCTION); + } /// Check \p Pred on all accesses to the memory kinds specified by \p MLK. /// @@ -4545,10 +4707,9 @@ /// underlying accessed memory pointer) and it will return true if \p Pred /// holds every time. virtual bool checkForAllAccessesToMemoryKind( - function_ref + function_ref Pred, - MemoryLocationsKind MLK) const = 0; + AA::MemoryEffects) const = 0; /// Create an abstract attribute view for the position \p IRP. static AAMemoryLocation &createForPosition(const IRPosition &IRP, @@ -4556,7 +4717,21 @@ /// See AbstractState::getAsStr(). const std::string getAsStr() const override { - return getMemoryLocationsAsStr(getAssumedNotAccessedLocation()); + std::string S; + llvm::raw_string_ostream OS(S); + OS << "known[" << getKnownAccessedLocation() << "] assumed[" + << getAssumedAccessedLocation() << "]"; + for (unsigned ArgNo = 0, NA = getNumArgs(); ArgNo != NA; ++ArgNo) { + // Not a pointer, skip. + if (!getArg(ArgNo)->getType()->isPointerTy()) + continue; + OS << ", arg(" << ArgNo << ") known[" + << getKnown(IRP_ARGUMENT, ArgNo).getModRef(AA::Location::ArgMem) + << "] assumed[" + << getAssumed(IRP_ARGUMENT, ArgNo).getModRef(AA::Location::ArgMem) + << "]"; + } + return S; } /// See AbstractAttribute::getName() @@ -4575,6 +4750,9 @@ static const char ID; }; +raw_ostream &operator<<(raw_ostream &OS, AA::Location Loc); +raw_ostream &operator<<(raw_ostream &OS, AA::MemoryEffects AAME); + /// An abstract interface for range value analysis. struct AAValueConstantRange : public StateWrapper { Index: llvm/lib/Transforms/IPO/Attributor.cpp =================================================================== --- llvm/lib/Transforms/IPO/Attributor.cpp +++ llvm/lib/Transforms/IPO/Attributor.cpp @@ -564,25 +564,26 @@ bool RequireReadNone, bool &IsKnown) { IRPosition::Kind Kind = IRP.getPositionKind(); - if (Kind == IRPosition::IRP_FUNCTION || Kind == IRPosition::IRP_CALL_SITE) { - const auto &MemLocAA = - A.getAAFor(QueryingAA, IRP, DepClassTy::NONE); - if (MemLocAA.isAssumedReadNone()) { - IsKnown = MemLocAA.isKnownReadNone(); - if (!IsKnown) - A.recordDependence(MemLocAA, QueryingAA, DepClassTy::OPTIONAL); - return true; - } + IRPosition FnIRP = IRPosition::function_scope(IRP); + const auto &MemLocAA = + A.getAAFor(QueryingAA, FnIRP, DepClassTy::NONE); + + unsigned ArgNo = -1; + if (Kind == IRPosition::IRP_ARGUMENT) + ArgNo = IRP.getCalleeArgNo(); + else if (Kind == IRPosition::IRP_CALL_SITE_ARGUMENT) + ArgNo = IRP.getCallSiteArgNo(); + + if (MemLocAA.isAssumedReadNone(Kind, ArgNo)) { + IsKnown = MemLocAA.isKnownReadNone(Kind, ArgNo); + if (!IsKnown) + A.recordDependence(MemLocAA, QueryingAA, DepClassTy::OPTIONAL); + return true; } - - const auto &MemBehaviorAA = - A.getAAFor(QueryingAA, IRP, DepClassTy::NONE); - if (MemBehaviorAA.isAssumedReadNone() || - (!RequireReadNone && MemBehaviorAA.isAssumedReadOnly())) { - IsKnown = RequireReadNone ? MemBehaviorAA.isKnownReadNone() - : MemBehaviorAA.isKnownReadOnly(); + if (!RequireReadNone && MemLocAA.isAssumedReadOnly(Kind, ArgNo)) { + IsKnown = MemLocAA.isKnownReadOnly(Kind, ArgNo); if (!IsKnown) - A.recordDependence(MemBehaviorAA, QueryingAA, DepClassTy::OPTIONAL); + A.recordDependence(MemLocAA, QueryingAA, DepClassTy::OPTIONAL); return true; } @@ -3177,10 +3178,8 @@ if (F.hasFnAttribute(Attribute::Convergent)) getOrCreateAAFor(FPos); - // Every function might be "readnone/readonly/writeonly/...". - getOrCreateAAFor(FPos); - // Every function can be "readnone/argmemonly/inaccessiblememonly/...". + // Every function might be "readnone/readonly/writeonly/...". getOrCreateAAFor(FPos); // Every function can track active assumptions. @@ -3261,10 +3260,6 @@ // Every argument with pointer type might be marked nocapture. getOrCreateAAFor(ArgPos); - // Every argument with pointer type might be marked - // "readnone/readonly/writeonly/..." - getOrCreateAAFor(ArgPos); - // Every argument with pointer type might be marked nofree. getOrCreateAAFor(ArgPos); @@ -3350,10 +3345,6 @@ // Call site argument attribute "align". getOrCreateAAFor(CBArgPos); - // Call site argument attribute - // "readnone/readonly/writeonly/..." - getOrCreateAAFor(CBArgPos); - // Call site argument attribute "nofree". getOrCreateAAFor(CBArgPos); } Index: llvm/lib/Transforms/IPO/AttributorAttributes.cpp =================================================================== --- llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -24,6 +24,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AssumeBundleQueries.h" #include "llvm/Analysis/AssumptionCache.h" @@ -38,6 +39,7 @@ #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Assumptions.h" +#include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" @@ -52,7 +54,9 @@ #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/IntrinsicsAMDGPU.h" #include "llvm/IR/IntrinsicsNVPTX.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/NoFolder.h" +#include "llvm/IR/Use.h" #include "llvm/IR/Value.h" #include "llvm/IR/ValueHandle.h" #include "llvm/Support/Alignment.h" @@ -61,6 +65,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/GraphWriter.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/ModRef.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Transforms/Utils/ValueMapper.h" @@ -171,7 +176,6 @@ PIPE_OPERATOR(AANoFree) PIPE_OPERATOR(AAHeapToStack) PIPE_OPERATOR(AAIntraFnReachability) -PIPE_OPERATOR(AAMemoryBehavior) PIPE_OPERATOR(AAMemoryLocation) PIPE_OPERATOR(AAValueConstantRange) PIPE_OPERATOR(AAPrivatizablePtr) @@ -3985,7 +3989,7 @@ /// Determine if the underlying value may alias with the call site argument /// \p OtherArgNo of \p ICS (= the underlying call site). bool mayAliasWithArgument(Attributor &A, AAResults *&AAR, - const AAMemoryBehavior &MemBehaviorAA, + const AAMemoryLocation &MemBehaviorAA, const CallBase &CB, unsigned OtherArgNo) { // We do not need to worry about aliasing with the underlying IRP. if (this->getCalleeArgNo() == (int)OtherArgNo) @@ -3996,21 +4000,22 @@ if (!ArgOp->getType()->isPtrOrPtrVectorTy()) return false; - auto &CBArgMemBehaviorAA = A.getAAFor( - *this, IRPosition::callsite_argument(CB, OtherArgNo), DepClassTy::NONE); + auto &CBMemBehaviorAA = A.getAAFor( + *this, IRPosition::callsite_function(CB), DepClassTy::NONE); // If the argument is readnone, there is no read-write aliasing. - if (CBArgMemBehaviorAA.isAssumedReadNone()) { - A.recordDependence(CBArgMemBehaviorAA, *this, DepClassTy::OPTIONAL); + if (CBMemBehaviorAA.isAssumedReadNone(IRP_CALL_SITE_ARGUMENT, OtherArgNo)) { + A.recordDependence(CBMemBehaviorAA, *this, DepClassTy::OPTIONAL); return false; } // If the argument is readonly and the underlying value is readonly, there // is no read-write aliasing. bool IsReadOnly = MemBehaviorAA.isAssumedReadOnly(); - if (CBArgMemBehaviorAA.isAssumedReadOnly() && IsReadOnly) { + if (CBMemBehaviorAA.isAssumedReadOnly(IRP_CALL_SITE_ARGUMENT, OtherArgNo) && + IsReadOnly) { A.recordDependence(MemBehaviorAA, *this, DepClassTy::OPTIONAL); - A.recordDependence(CBArgMemBehaviorAA, *this, DepClassTy::OPTIONAL); + A.recordDependence(CBMemBehaviorAA, *this, DepClassTy::OPTIONAL); return false; } @@ -4030,7 +4035,7 @@ bool isKnownNoAliasDueToNoAliasPreservation(Attributor &A, AAResults *&AAR, - const AAMemoryBehavior &MemBehaviorAA, + const AAMemoryLocation &MemBehaviorAA, const AANoAlias &NoAliasAA) { // We can deduce "noalias" if the following conditions hold. // (i) Associated value is assumed to be noalias in the definition. @@ -4131,11 +4136,13 @@ /// See AbstractAttribute::updateImpl(...). ChangeStatus updateImpl(Attributor &A) override { + const auto &CB = cast(getAnchorValue()); + unsigned ArgNo = getIRPosition().getCallSiteArgNo(); // If the argument is readnone we are done as there are no accesses via the // argument. - auto &MemBehaviorAA = - A.getAAFor(*this, getIRPosition(), DepClassTy::NONE); - if (MemBehaviorAA.isAssumedReadNone()) { + auto &MemBehaviorAA = A.getAAFor( + *this, IRPosition::callsite_function(CB), DepClassTy::NONE); + if (MemBehaviorAA.isAssumedReadNone(IRP_CALL_SITE_ARGUMENT, ArgNo)) { A.recordDependence(MemBehaviorAA, *this, DepClassTy::OPTIONAL); return ChangeStatus::UNCHANGED; } @@ -7925,761 +7932,258 @@ }; } // namespace -/// -------------------- Memory Behavior Attributes ---------------------------- -/// Includes read-none, read-only, and write-only. -/// ---------------------------------------------------------------------------- -namespace { -struct AAMemoryBehaviorImpl : public AAMemoryBehavior { - AAMemoryBehaviorImpl(const IRPosition &IRP, Attributor &A) - : AAMemoryBehavior(IRP, A) {} - - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - intersectAssumedBits(BEST_STATE); - getKnownStateFromValue(getIRPosition(), getState()); - AAMemoryBehavior::initialize(A); - } - - /// Return the memory behavior information encoded in the IR for \p IRP. - static void getKnownStateFromValue(const IRPosition &IRP, - BitIntegerState &State, - bool IgnoreSubsumingPositions = false) { - SmallVector Attrs; - IRP.getAttrs(AttrKinds, Attrs, IgnoreSubsumingPositions); - for (const Attribute &Attr : Attrs) { - switch (Attr.getKindAsEnum()) { - case Attribute::ReadNone: - State.addKnownBits(NO_ACCESSES); - break; - case Attribute::ReadOnly: - State.addKnownBits(NO_WRITES); - break; - case Attribute::WriteOnly: - State.addKnownBits(NO_READS); - break; - default: - llvm_unreachable("Unexpected attribute!"); - } - } - - if (auto *I = dyn_cast(&IRP.getAnchorValue())) { - if (!I->mayReadFromMemory()) - State.addKnownBits(NO_READS); - if (!I->mayWriteToMemory()) - State.addKnownBits(NO_WRITES); - } - } - - /// See AbstractAttribute::getDeducedAttributes(...). - void getDeducedAttributes(LLVMContext &Ctx, - SmallVectorImpl &Attrs) const override { - assert(Attrs.size() == 0); - if (isAssumedReadNone()) - Attrs.push_back(Attribute::get(Ctx, Attribute::ReadNone)); - else if (isAssumedReadOnly()) - Attrs.push_back(Attribute::get(Ctx, Attribute::ReadOnly)); - else if (isAssumedWriteOnly()) - Attrs.push_back(Attribute::get(Ctx, Attribute::WriteOnly)); - assert(Attrs.size() <= 1); - } - - /// See AbstractAttribute::manifest(...). - ChangeStatus manifest(Attributor &A) override { - if (hasAttr(Attribute::ReadNone, /* IgnoreSubsumingPositions */ true)) - return ChangeStatus::UNCHANGED; - - const IRPosition &IRP = getIRPosition(); - - // Check if we would improve the existing attributes first. - SmallVector DeducedAttrs; - getDeducedAttributes(IRP.getAnchorValue().getContext(), DeducedAttrs); - if (llvm::all_of(DeducedAttrs, [&](const Attribute &Attr) { - return IRP.hasAttr(Attr.getKindAsEnum(), - /* IgnoreSubsumingPositions */ true); - })) - return ChangeStatus::UNCHANGED; - - // Clear existing attributes. - IRP.removeAttrs(AttrKinds); - - // Use the generic manifest method. - return IRAttribute::manifest(A); - } - - /// See AbstractState::getAsStr(). - const std::string getAsStr() const override { - if (isAssumedReadNone()) - return "readnone"; - if (isAssumedReadOnly()) - return "readonly"; - if (isAssumedWriteOnly()) - return "writeonly"; - return "may-read/write"; - } - - /// The set of IR attributes AAMemoryBehavior deals with. - static const Attribute::AttrKind AttrKinds[3]; -}; - -const Attribute::AttrKind AAMemoryBehaviorImpl::AttrKinds[] = { - Attribute::ReadNone, Attribute::ReadOnly, Attribute::WriteOnly}; - -/// Memory behavior attribute for a floating value. -struct AAMemoryBehaviorFloating : AAMemoryBehaviorImpl { - AAMemoryBehaviorFloating(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorImpl(IRP, A) {} - - /// See AbstractAttribute::updateImpl(...). - ChangeStatus updateImpl(Attributor &A) override; - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_FLOATING_ATTR(readnone) - else if (isAssumedReadOnly()) - STATS_DECLTRACK_FLOATING_ATTR(readonly) - else if (isAssumedWriteOnly()) - STATS_DECLTRACK_FLOATING_ATTR(writeonly) - } - -private: - /// Return true if users of \p UserI might access the underlying - /// variable/location described by \p U and should therefore be analyzed. - bool followUsersOfUseIn(Attributor &A, const Use &U, - const Instruction *UserI); - - /// Update the state according to the effect of use \p U in \p UserI. - void analyzeUseIn(Attributor &A, const Use &U, const Instruction *UserI); -}; - -/// Memory behavior attribute for function argument. -struct AAMemoryBehaviorArgument : AAMemoryBehaviorFloating { - AAMemoryBehaviorArgument(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorFloating(IRP, A) {} - - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - intersectAssumedBits(BEST_STATE); - const IRPosition &IRP = getIRPosition(); - // TODO: Make IgnoreSubsumingPositions a property of an IRAttribute so we - // can query it when we use has/getAttr. That would allow us to reuse the - // initialize of the base class here. - bool HasByVal = - IRP.hasAttr({Attribute::ByVal}, /* IgnoreSubsumingPositions */ true); - getKnownStateFromValue(IRP, getState(), - /* IgnoreSubsumingPositions */ HasByVal); - - // Initialize the use vector with all direct uses of the associated value. - Argument *Arg = getAssociatedArgument(); - if (!Arg || !A.isFunctionIPOAmendable(*(Arg->getParent()))) - indicatePessimisticFixpoint(); - } - - ChangeStatus manifest(Attributor &A) override { - // TODO: Pointer arguments are not supported on vectors of pointers yet. - if (!getAssociatedValue().getType()->isPointerTy()) - return ChangeStatus::UNCHANGED; - - // TODO: From readattrs.ll: "inalloca parameters are always - // considered written" - if (hasAttr({Attribute::InAlloca, Attribute::Preallocated})) { - removeKnownBits(NO_WRITES); - removeAssumedBits(NO_WRITES); - } - return AAMemoryBehaviorFloating::manifest(A); - } - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_ARG_ATTR(readnone) - else if (isAssumedReadOnly()) - STATS_DECLTRACK_ARG_ATTR(readonly) - else if (isAssumedWriteOnly()) - STATS_DECLTRACK_ARG_ATTR(writeonly) - } -}; - -struct AAMemoryBehaviorCallSiteArgument final : AAMemoryBehaviorArgument { - AAMemoryBehaviorCallSiteArgument(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorArgument(IRP, A) {} - - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - // If we don't have an associated attribute this is either a variadic call - // or an indirect call, either way, nothing to do here. - Argument *Arg = getAssociatedArgument(); - if (!Arg) { - indicatePessimisticFixpoint(); - return; - } - if (Arg->hasByValAttr()) { - addKnownBits(NO_WRITES); - removeKnownBits(NO_READS); - removeAssumedBits(NO_READS); - } - AAMemoryBehaviorArgument::initialize(A); - if (getAssociatedFunction()->isDeclaration()) - indicatePessimisticFixpoint(); - } - - /// 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 - // redirecting requests to the callee argument. - Argument *Arg = getAssociatedArgument(); - const IRPosition &ArgPos = IRPosition::argument(*Arg); - auto &ArgAA = - A.getAAFor(*this, ArgPos, DepClassTy::REQUIRED); - return clampStateAndIndicateChange(getState(), ArgAA.getState()); - } - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_CSARG_ATTR(readnone) - else if (isAssumedReadOnly()) - STATS_DECLTRACK_CSARG_ATTR(readonly) - else if (isAssumedWriteOnly()) - STATS_DECLTRACK_CSARG_ATTR(writeonly) - } -}; - -/// Memory behavior attribute for a call site return position. -struct AAMemoryBehaviorCallSiteReturned final : AAMemoryBehaviorFloating { - AAMemoryBehaviorCallSiteReturned(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorFloating(IRP, A) {} - - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - AAMemoryBehaviorImpl::initialize(A); - Function *F = getAssociatedFunction(); - if (!F || F->isDeclaration()) - indicatePessimisticFixpoint(); - } - - /// See AbstractAttribute::manifest(...). - ChangeStatus manifest(Attributor &A) override { - // We do not annotate returned values. - return ChangeStatus::UNCHANGED; - } - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override {} -}; - -/// An AA to represent the memory behavior function attributes. -struct AAMemoryBehaviorFunction final : public AAMemoryBehaviorImpl { - AAMemoryBehaviorFunction(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorImpl(IRP, A) {} - - /// See AbstractAttribute::updateImpl(Attributor &A). - ChangeStatus updateImpl(Attributor &A) override; - - /// See AbstractAttribute::manifest(...). - ChangeStatus manifest(Attributor &A) override { - // TODO: It would be better to merge this with AAMemoryLocation, so that - // we could determine read/write per location. This would also have the - // benefit of only one place trying to manifest the memory attribute. - Function &F = cast(getAnchorValue()); - MemoryEffects ME = MemoryEffects::unknown(); - if (isAssumedReadNone()) - ME = MemoryEffects::none(); - else if (isAssumedReadOnly()) - ME = MemoryEffects::readOnly(); - else if (isAssumedWriteOnly()) - ME = MemoryEffects::writeOnly(); - - // Intersect with existing memory attribute, as we currently deduce the - // location and modref portion separately. - MemoryEffects ExistingME = F.getMemoryEffects(); - ME &= ExistingME; - if (ME == ExistingME) - return ChangeStatus::UNCHANGED; - - return IRAttributeManifest::manifestAttrs( - A, getIRPosition(), Attribute::getWithMemoryEffects(F.getContext(), ME), - /*ForceReplace*/ true); - } - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_FN_ATTR(readnone) - else if (isAssumedReadOnly()) - STATS_DECLTRACK_FN_ATTR(readonly) - else if (isAssumedWriteOnly()) - STATS_DECLTRACK_FN_ATTR(writeonly) - } -}; - -/// AAMemoryBehavior attribute for call sites. -struct AAMemoryBehaviorCallSite final : AAMemoryBehaviorImpl { - AAMemoryBehaviorCallSite(const IRPosition &IRP, Attributor &A) - : AAMemoryBehaviorImpl(IRP, A) {} - - /// See AbstractAttribute::initialize(...). - void initialize(Attributor &A) override { - AAMemoryBehaviorImpl::initialize(A); - Function *F = getAssociatedFunction(); - if (!F || F->isDeclaration()) - indicatePessimisticFixpoint(); - } - - /// 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 - // redirecting requests to the callee argument. - Function *F = getAssociatedFunction(); - const IRPosition &FnPos = IRPosition::function(*F); - auto &FnAA = - A.getAAFor(*this, FnPos, DepClassTy::REQUIRED); - return clampStateAndIndicateChange(getState(), FnAA.getState()); - } - - /// See AbstractAttribute::manifest(...). - ChangeStatus manifest(Attributor &A) override { - // TODO: Deduplicate this with AAMemoryBehaviorFunction. - CallBase &CB = cast(getAnchorValue()); - MemoryEffects ME = MemoryEffects::unknown(); - if (isAssumedReadNone()) - ME = MemoryEffects::none(); - else if (isAssumedReadOnly()) - ME = MemoryEffects::readOnly(); - else if (isAssumedWriteOnly()) - ME = MemoryEffects::writeOnly(); - - // Intersect with existing memory attribute, as we currently deduce the - // location and modref portion separately. - MemoryEffects ExistingME = CB.getMemoryEffects(); - ME &= ExistingME; - if (ME == ExistingME) - return ChangeStatus::UNCHANGED; - - return IRAttributeManifest::manifestAttrs( - A, getIRPosition(), - Attribute::getWithMemoryEffects(CB.getContext(), ME), - /*ForceReplace*/ true); - } - - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_CS_ATTR(readnone) - else if (isAssumedReadOnly()) - STATS_DECLTRACK_CS_ATTR(readonly) - else if (isAssumedWriteOnly()) - STATS_DECLTRACK_CS_ATTR(writeonly) - } -}; - -ChangeStatus AAMemoryBehaviorFunction::updateImpl(Attributor &A) { - - // The current assumed state used to determine a change. - auto AssumedState = getAssumed(); - - auto CheckRWInst = [&](Instruction &I) { - // If the instruction has an own memory behavior state, use it to restrict - // the local state. No further analysis is required as the other memory - // state is as optimistic as it gets. - if (const auto *CB = dyn_cast(&I)) { - const auto &MemBehaviorAA = A.getAAFor( - *this, IRPosition::callsite_function(*CB), DepClassTy::REQUIRED); - intersectAssumedBits(MemBehaviorAA.getAssumed()); - return !isAtFixpoint(); - } - - // Remove access kind modifiers if necessary. - if (I.mayReadFromMemory()) - removeAssumedBits(NO_READS); - if (I.mayWriteToMemory()) - removeAssumedBits(NO_WRITES); - return !isAtFixpoint(); - }; - - bool UsedAssumedInformation = false; - if (!A.checkForAllReadWriteInstructions(CheckRWInst, *this, - UsedAssumedInformation)) - return indicatePessimisticFixpoint(); - - return (AssumedState != getAssumed()) ? ChangeStatus::CHANGED - : ChangeStatus::UNCHANGED; +raw_ostream &llvm::operator<<(raw_ostream &OS, AA::Location Loc) { + switch (Loc) { + case AA::ArgMem: + return OS << "argmem"; + case AA::InaccessibleMem: + return OS << "inaccesiblemem"; + case AA::Other: + return OS << "other"; + case AA::Local: + return OS << "local"; + case AA::Const: + return OS << "constant"; + case AA::GlobalInternal: + return OS << "global_int"; + case AA::GlobalExternal: + return OS << "global_ext"; + case AA::Malloced: + return OS << "malloced"; + } + llvm_unreachable("Unexpected location!"); } -ChangeStatus AAMemoryBehaviorFloating::updateImpl(Attributor &A) { - - const IRPosition &IRP = getIRPosition(); - const IRPosition &FnPos = IRPosition::function_scope(IRP); - AAMemoryBehavior::StateType &S = getState(); - - // First, check the function scope. We take the known information and we avoid - // work if the assumed information implies the current assumed information for - // this attribute. This is a valid for all but byval arguments. - Argument *Arg = IRP.getAssociatedArgument(); - AAMemoryBehavior::base_t FnMemAssumedState = - AAMemoryBehavior::StateType::getWorstState(); - if (!Arg || !Arg->hasByValAttr()) { - const auto &FnMemAA = - A.getAAFor(*this, FnPos, DepClassTy::OPTIONAL); - FnMemAssumedState = FnMemAA.getAssumed(); - S.addKnownBits(FnMemAA.getKnown()); - if ((S.getAssumed() & FnMemAA.getAssumed()) == S.getAssumed()) - return ChangeStatus::UNCHANGED; - } - - // The current assumed state used to determine a change. - auto AssumedState = S.getAssumed(); - - // Make sure the value is not captured (except through "return"), if - // it is, any information derived would be irrelevant anyway as we cannot - // check the potential aliases introduced by the capture. However, no need - // to fall back to anythign less optimistic than the function state. - const auto &ArgNoCaptureAA = - A.getAAFor(*this, IRP, DepClassTy::OPTIONAL); - if (!ArgNoCaptureAA.isAssumedNoCaptureMaybeReturned()) { - S.intersectAssumedBits(FnMemAssumedState); - return (AssumedState != getAssumed()) ? ChangeStatus::CHANGED - : ChangeStatus::UNCHANGED; - } - - // Visit and expand uses until all are analyzed or a fixpoint is reached. - auto UsePred = [&](const Use &U, bool &Follow) -> bool { - Instruction *UserI = cast(U.getUser()); - LLVM_DEBUG(dbgs() << "[AAMemoryBehavior] Use: " << *U << " in " << *UserI - << " \n"); - - // Droppable users, e.g., llvm::assume does not actually perform any action. - if (UserI->isDroppable()) - return true; - - // Check if the users of UserI should also be visited. - Follow = followUsersOfUseIn(A, U, UserI); - - // If UserI might touch memory we analyze the use in detail. - if (UserI->mayReadOrWriteMemory()) - analyzeUseIn(A, U, UserI); - - return !isAtFixpoint(); +raw_ostream &llvm::operator<<(raw_ostream &OS, AA::MemoryEffects AAME) { + OS << "memory("; + auto HandleModRef = [&](ModRefInfo MRI) -> raw_ostream & { + switch (MRI) { + case ModRefInfo::NoModRef: + return OS << "none"; + case ModRefInfo::ModRef: + return OS << "readwrite"; + case ModRefInfo::Ref: + return OS << "read"; + case ModRefInfo::Mod: + return OS << "write"; + }; }; - if (!A.checkForAllUses(UsePred, *this, getAssociatedValue())) - return indicatePessimisticFixpoint(); - - return (AssumedState != getAssumed()) ? ChangeStatus::CHANGED - : ChangeStatus::UNCHANGED; -} - -bool AAMemoryBehaviorFloating::followUsersOfUseIn(Attributor &A, const Use &U, - const Instruction *UserI) { - // The loaded value is unrelated to the pointer argument, no need to - // follow the users of the load. - if (isa(UserI) || isa(UserI)) - return false; - - // By default we follow all uses assuming UserI might leak information on U, - // we have special handling for call sites operands though. - const auto *CB = dyn_cast(UserI); - if (!CB || !CB->isArgOperand(&U)) - return true; - - // If the use is a call argument known not to be captured, the users of - // the call do not need to be visited because they have to be unrelated to - // the input. Note that this check is not trivial even though we disallow - // general capturing of the underlying argument. The reason is that the - // call might the argument "through return", which we allow and for which we - // need to check call users. - if (U.get()->getType()->isPointerTy()) { - unsigned ArgNo = CB->getArgOperandNo(&U); - const auto &ArgNoCaptureAA = A.getAAFor( - *this, IRPosition::callsite_argument(*CB, ArgNo), DepClassTy::OPTIONAL); - return !ArgNoCaptureAA.isAssumedNoCapture(); - } - - return true; -} - -void AAMemoryBehaviorFloating::analyzeUseIn(Attributor &A, const Use &U, - const Instruction *UserI) { - assert(UserI->mayReadOrWriteMemory()); - - switch (UserI->getOpcode()) { - default: - // TODO: Handle all atomics and other side-effect operations we know of. - break; - case Instruction::Load: - // Loads cause the NO_READS property to disappear. - removeAssumedBits(NO_READS); - return; - - case Instruction::Store: - // Stores cause the NO_WRITES property to disappear if the use is the - // pointer operand. Note that while capturing was taken care of somewhere - // else we need to deal with stores of the value that is not looked through. - if (cast(UserI)->getPointerOperand() == U.get()) - removeAssumedBits(NO_WRITES); - else - indicatePessimisticFixpoint(); - return; - - case Instruction::Call: - case Instruction::CallBr: - case Instruction::Invoke: { - // For call sites we look at the argument memory behavior attribute (this - // could be recursive!) in order to restrict our own state. - const auto *CB = cast(UserI); - - // Give up on operand bundles. - if (CB->isBundleOperand(&U)) { - indicatePessimisticFixpoint(); + ModRefInfo OtherModRef = AAME.getModRef(AA::Location::Other); + auto HandleLoc = [&](AA::Location Loc) { + if (Loc == AA::Location::Other) return; - } - - // Calling a function does read the function pointer, maybe write it if the - // function is self-modifying. - if (CB->isCallee(&U)) { - removeAssumedBits(NO_READS); - break; - } - - // Adjust the possible access behavior based on the information on the - // argument. - IRPosition Pos; - if (U.get()->getType()->isPointerTy()) - Pos = IRPosition::callsite_argument(*CB, CB->getArgOperandNo(&U)); - else - Pos = IRPosition::callsite_function(*CB); - const auto &MemBehaviorAA = - A.getAAFor(*this, Pos, DepClassTy::OPTIONAL); - // "assumed" has at most the same bits as the MemBehaviorAA assumed - // and at least "known". - intersectAssumedBits(MemBehaviorAA.getAssumed()); - return; - } + ModRefInfo LocModRef = AAME.getModRef(Loc); + if (LocModRef == OtherModRef) + return; + OS << ", " << Loc << ": "; + HandleModRef(LocModRef); }; - // Generally, look at the "may-properties" and adjust the assumed state if we - // did not trigger special handling before. - if (UserI->mayReadFromMemory()) - removeAssumedBits(NO_READS); - if (UserI->mayWriteToMemory()) - removeAssumedBits(NO_WRITES); -} -} // namespace + HandleModRef(OtherModRef); + for (AA::Location Loc : AAME.locations()) + HandleLoc(Loc); -/// -------------------- Memory Locations Attributes --------------------------- -/// Includes read-none, argmemonly, inaccessiblememonly, -/// inaccessiblememorargmemonly -/// ---------------------------------------------------------------------------- - -std::string AAMemoryLocation::getMemoryLocationsAsStr( - AAMemoryLocation::MemoryLocationsKind MLK) { - if (0 == (MLK & AAMemoryLocation::NO_LOCATIONS)) - return "all memory"; - if (MLK == AAMemoryLocation::NO_LOCATIONS) - return "no memory"; - std::string S = "memory:"; - if (0 == (MLK & AAMemoryLocation::NO_LOCAL_MEM)) - S += "stack,"; - if (0 == (MLK & AAMemoryLocation::NO_CONST_MEM)) - S += "constant,"; - if (0 == (MLK & AAMemoryLocation::NO_GLOBAL_INTERNAL_MEM)) - S += "internal global,"; - if (0 == (MLK & AAMemoryLocation::NO_GLOBAL_EXTERNAL_MEM)) - S += "external global,"; - if (0 == (MLK & AAMemoryLocation::NO_ARGUMENT_MEM)) - S += "argument,"; - if (0 == (MLK & AAMemoryLocation::NO_INACCESSIBLE_MEM)) - S += "inaccessible,"; - if (0 == (MLK & AAMemoryLocation::NO_MALLOCED_MEM)) - S += "malloced,"; - if (0 == (MLK & AAMemoryLocation::NO_UNKOWN_MEM)) - S += "unknown,"; - S.pop_back(); - return S; + return OS << ")"; } namespace { struct AAMemoryLocationImpl : public AAMemoryLocation { AAMemoryLocationImpl(const IRPosition &IRP, Attributor &A) - : AAMemoryLocation(IRP, A), Allocator(A.Allocator) { - AccessKind2Accesses.fill(nullptr); - } - - ~AAMemoryLocationImpl() { - // The AccessSets are allocated via a BumpPtrAllocator, we call - // the destructor manually. - for (AccessSet *AS : AccessKind2Accesses) - if (AS) - AS->~AccessSet(); - } + : AAMemoryLocation(IRP, A) {} /// See AbstractAttribute::initialize(...). void initialize(Attributor &A) override { - intersectAssumedBits(BEST_STATE); getKnownStateFromValue(A, getIRPosition(), getState()); - AAMemoryLocation::initialize(A); + } + + static bool useArgMemOnly(Attributor &A, const IRPosition &IRP) { + Function *Fn = IRP.getAssociatedFunction(); + if (Fn && !Fn->isDeclaration() && A.isRunOn(*Fn)) + return !Fn->hasLocalLinkage(); + return true; } /// Return the memory behavior information encoded in the IR for \p IRP. static void getKnownStateFromValue(Attributor &A, const IRPosition &IRP, - BitIntegerState &State, + MemoryEffectsState &State, bool IgnoreSubsumingPositions = false) { - // For internal functions we ignore `argmemonly` and + // For internal functions we weaken `argmemonly` and // `inaccessiblememorargmemonly` as we might break it via interprocedural - // constant propagation. It is unclear if this is the best way but it is - // unlikely this will cause real performance problems. If we are deriving - // attributes for the anchor function we even remove the attribute in - // addition to ignoring it. - // TODO: A better way to handle this would be to add ~NO_GLOBAL_MEM / - // MemoryEffects::Other as a possible location. - bool UseArgMemOnly = true; - Function *AnchorFn = IRP.getAnchorScope(); - if (AnchorFn && A.isRunOn(*AnchorFn)) - UseArgMemOnly = !AnchorFn->hasLocalLinkage(); + // constant propagation. Effectively, we add "global" and "constant" memory + // to the potentially accessed list too. + bool UseArgMemOnly = useArgMemOnly(A, IRP); + + auto GetMEFromAttr = [](const Attribute &Attr) { + switch (Attr.getKindAsEnum()) { + case Attribute::Memory: + return Attr.getMemoryEffects(); + case Attribute::ReadNone: + return MemoryEffects::none(); + case Attribute::ReadOnly: + return MemoryEffects::readOnly(); + break; + case Attribute::WriteOnly: + return MemoryEffects::writeOnly(); + default: + llvm_unreachable("Unexpected attribute kind"); + }; + }; + LLVMContext &Ctx = IRP.getAssociatedValue().getContext(); + AA::MemoryEffects AAME = AA::MemoryEffects::unknown(); + SmallVector AttrKinds{ + Attribute::ReadNone, Attribute::ReadOnly, Attribute::WriteOnly, + Attribute::Memory}; SmallVector Attrs; - IRP.getAttrs({Attribute::Memory}, Attrs, IgnoreSubsumingPositions); + IRP.getAttrs(AttrKinds, Attrs, IgnoreSubsumingPositions); for (const Attribute &Attr : Attrs) { - // TODO: We can map MemoryEffects to Attributor locations more precisely. - MemoryEffects ME = Attr.getMemoryEffects(); - if (ME.doesNotAccessMemory()) { - State.addKnownBits(NO_LOCAL_MEM | NO_CONST_MEM); - continue; - } - if (ME.onlyAccessesInaccessibleMem()) { - State.addKnownBits(inverseLocation(NO_INACCESSIBLE_MEM, true, true)); - continue; - } - if (ME.onlyAccessesArgPointees()) { - if (UseArgMemOnly) - State.addKnownBits(inverseLocation(NO_ARGUMENT_MEM, true, true)); - else { - // Remove location information, only keep read/write info. - ME = MemoryEffects(ME.getModRef()); + MemoryEffects ME = GetMEFromAttr(Attr); + if (!UseArgMemOnly && + (ME & MemoryEffects::argMemOnly()) != MemoryEffects::none()) { + ME |= MemoryEffects(IRMemoryEffects::Location::Other, + ME.getModRef(IRMemoryEffects::Location::ArgMem)); + // Only remove the argmem flag from functions and call sites. + if (IRP.getPositionKind() == IRP_CALL_SITE || + IRP.getPositionKind() == IRP_FUNCTION) IRAttributeManifest::manifestAttrs( - A, IRP, - Attribute::getWithMemoryEffects(IRP.getAnchorValue().getContext(), - ME), + A, IRP, Attribute::getWithMemoryEffects(Ctx, ME), /*ForceReplace*/ true); - } - continue; } - if (ME.onlyAccessesInaccessibleOrArgMem()) { - if (UseArgMemOnly) - State.addKnownBits(inverseLocation( - NO_INACCESSIBLE_MEM | NO_ARGUMENT_MEM, true, true)); - else { - // Remove location information, only keep read/write info. - ME = MemoryEffects(ME.getModRef()); - IRAttributeManifest::manifestAttrs( - A, IRP, - Attribute::getWithMemoryEffects(IRP.getAnchorValue().getContext(), - ME), - /*ForceReplace*/ true); - } + AA::MemoryEffects AttrAAME(ME); + AAME &= AttrAAME; + } + State.expandKnown(IRP.getPositionKind(), AAME, IRP.getCalleeArgNo()); + } + + ChangeStatus manifestArgs(Attributor &A, AttributeList &AttrList) { + const IRPosition &IRP = getIRPosition(); + ChangeStatus Changed = ChangeStatus::UNCHANGED; + + AttributeMask MemBehaviorAttrs; + MemBehaviorAttrs.addAttribute(Attribute::ReadNone); + MemBehaviorAttrs.addAttribute(Attribute::ReadOnly); + MemBehaviorAttrs.addAttribute(Attribute::WriteOnly); + + LLVMContext &Ctx = IRP.getAnchorValue().getContext(); + + for (unsigned ArgNo = 0, NumArgs = IRP.getNumArgs(); ArgNo != NumArgs; + ++ArgNo) { + // Not a pointer, skip. + if (!IRP.getArg(ArgNo)->getType()->isPointerTy()) continue; - } + // As good as it gets, skip. + if (AttrList.hasParamAttr(ArgNo, Attribute::ReadNone)) + continue; + ModRefInfo ArgMRI = + getAssumed(IRP_ARGUMENT, ArgNo).getModRef(AA::Location::ArgMem); + Attribute::AttrKind Kind = Attribute::None; + switch (ArgMRI) { + case ModRefInfo::ModRef: + continue; + case ModRefInfo::Ref: + Kind = Attribute::ReadOnly; + break; + case ModRefInfo::Mod: + Kind = Attribute::WriteOnly; + break; + case ModRefInfo::NoModRef: + Kind = Attribute::ReadNone; + break; + }; + AttrList = AttrList.removeParamAttributes(Ctx, ArgNo, MemBehaviorAttrs); + AttrList = AttrList.addParamAttribute(Ctx, ArgNo, Kind); + Changed = ChangeStatus::CHANGED; } + + return Changed; } - /// See AbstractAttribute::getDeducedAttributes(...). - void getDeducedAttributes(LLVMContext &Ctx, - SmallVectorImpl &Attrs) const override { - // TODO: We can map Attributor locations to MemoryEffects more precisely. - assert(Attrs.size() == 0); - if (getIRPosition().getPositionKind() == IRPosition::IRP_FUNCTION) { - if (isAssumedReadNone()) - Attrs.push_back( - Attribute::getWithMemoryEffects(Ctx, MemoryEffects::none())); - else if (isAssumedInaccessibleMemOnly()) - Attrs.push_back(Attribute::getWithMemoryEffects( - Ctx, MemoryEffects::inaccessibleMemOnly())); - else if (isAssumedArgMemOnly()) - Attrs.push_back( - Attribute::getWithMemoryEffects(Ctx, MemoryEffects::argMemOnly())); - else if (isAssumedInaccessibleOrArgMemOnly()) - Attrs.push_back(Attribute::getWithMemoryEffects( - Ctx, MemoryEffects::inaccessibleOrArgMemOnly())); - } - assert(Attrs.size() <= 1); + ChangeStatus manifestFunction(Attributor &A, AttributeList &AttrList, + AttributeList &FnAttrListPtr) { + const IRPosition IRP = getIRPosition(); + + AA::MemoryEffects AAME = getAssumed(IRP.getPositionKind()); + llvm::MemoryEffects ME = AAME.getAsIRMemoryEffects(); + + // Intersect with existing memory attribute and see if we improved things. + Attribute ExistingAttr = AttrList.getFnAttr(Attribute::Memory); + llvm::MemoryEffects ExistingME = llvm::MemoryEffects::unknown(); + if (ExistingAttr.isValid()) + ExistingME &= ExistingAttr.getMemoryEffects(); + // For call sites avoid manifesting attributes we know at the callee + // declaration. + if (!FnAttrListPtr.isEmpty()) { + Attribute ExistingFnAttr = FnAttrListPtr.getFnAttr(Attribute::Memory); + if (ExistingFnAttr.isValid()) + ExistingME &= ExistingFnAttr.getMemoryEffects(); + } + + if (!hasPtrArgs()) + ME |= + llvm::MemoryEffects::argMemOnly(ME.getModRef(IRMemoryEffects::Other)); + + ME &= ExistingME; + if (ME == ExistingME) + return ChangeStatus::UNCHANGED; + + LLVMContext &Ctx = IRP.getAssociatedValue().getContext(); + AttrList = + AttrList.addFnAttribute(Ctx, Attribute::getWithMemoryEffects(Ctx, ME)); + return ChangeStatus::CHANGED; } /// See AbstractAttribute::manifest(...). ChangeStatus manifest(Attributor &A) override { - // TODO: If AAMemoryLocation and AAMemoryBehavior are merged, we could - // provide per-location modref information here. const IRPosition &IRP = getIRPosition(); + ChangeStatus Changed = ChangeStatus::UNCHANGED; + AttributeList AttrList = IRP.getAttrList(); + AttributeList FnAttrListPtr; + if (IRP.getPositionKind() == IRP_CALL_SITE) + if (auto *Fn = getAssociatedFunction()) + FnAttrListPtr = IRPosition::function(*Fn).getAttrList(); + + if (hasPtrArgs()) + Changed |= AAMemoryLocationImpl::manifestArgs(A, AttrList); + Changed |= + AAMemoryLocationImpl::manifestFunction(A, AttrList, FnAttrListPtr); + if (Changed == ChangeStatus::CHANGED) + IRP.setAttrList(AttrList); - SmallVector DeducedAttrs; - getDeducedAttributes(IRP.getAnchorValue().getContext(), DeducedAttrs); - if (DeducedAttrs.size() != 1) - return ChangeStatus::UNCHANGED; - MemoryEffects ME = DeducedAttrs[0].getMemoryEffects(); - - // Intersect with existing memory attribute, as we currently deduce the - // location and modref portion separately. - SmallVector ExistingAttrs; - IRP.getAttrs({Attribute::Memory}, ExistingAttrs, - /* IgnoreSubsumingPositions */ true); - if (ExistingAttrs.size() == 1) { - MemoryEffects ExistingME = ExistingAttrs[0].getMemoryEffects(); - ME &= ExistingME; - if (ME == ExistingME) - return ChangeStatus::UNCHANGED; - } - - return IRAttributeManifest::manifestAttrs( - A, IRP, - Attribute::getWithMemoryEffects(IRP.getAnchorValue().getContext(), ME), - /*ForceReplace*/ true); + return Changed; } /// See AAMemoryLocation::checkForAllAccessesToMemoryKind(...). bool checkForAllAccessesToMemoryKind( - function_ref + function_ref Pred, - MemoryLocationsKind RequestedMLK) const override { + AA::MemoryEffects AAME) const override { if (!isValidState()) return false; - MemoryLocationsKind AssumedMLK = getAssumedNotAccessedLocation(); - if (AssumedMLK == NO_LOCATIONS) + AA::MemoryEffects AssumedME = getAssumedAccessedLocation(); + if ((AssumedME & AAME) == AA::MemoryEffects::none()) return true; - unsigned Idx = 0; - for (MemoryLocationsKind CurMLK = 1; CurMLK < NO_LOCATIONS; - CurMLK *= 2, ++Idx) { - if (CurMLK & RequestedMLK) - continue; - - if (const AccessSet *Accesses = AccessKind2Accesses[Idx]) - for (const AccessInfo &AI : *Accesses) - if (!Pred(AI.I, AI.Ptr, AI.Kind, CurMLK)) - return false; - } + for (const AccessInfo &AI : AccessInfoVec) + if ((AI.AAME & AAME) != AA::MemoryEffects::none()) + if (!Pred(AI.I, AI.Ptr, AI.AAME)) + return false; return true; } - ChangeStatus indicatePessimisticFixpoint() override { - // If we give up and indicate a pessimistic fixpoint this instruction will - // become an access for all potential access kinds: - // TODO: Add pointers for argmemonly and globals to improve the results of - // checkForAllAccessesToMemoryKind. - bool Changed = false; - MemoryLocationsKind KnownMLK = getKnown(); - Instruction *I = dyn_cast(&getAssociatedValue()); - for (MemoryLocationsKind CurMLK = 1; CurMLK < NO_LOCATIONS; CurMLK *= 2) - if (!(CurMLK & KnownMLK)) - updateStateAndAccessesMap(getState(), CurMLK, I, nullptr, Changed, - getAccessKindFromInst(I)); - return AAMemoryLocation::indicatePessimisticFixpoint(); + /// See AbstractAttribute::trackStatistics() + void trackStatistics() const override { + if (isAssumedReadNone()) + STATS_DECLTRACK_FN_ATTR(readnone) + else if (isAssumedArgMemOnly()) + STATS_DECLTRACK_FN_ATTR(argmemonly) + else if (isAssumedInaccessibleMemOnly()) + STATS_DECLTRACK_FN_ATTR(inaccessiblememonly) + else if (isAssumedInaccessibleOrArgMemOnly()) + STATS_DECLTRACK_FN_ATTR(inaccessiblememorargmemonly) } protected: @@ -8693,193 +8197,149 @@ /// The base pointer that is accessed, or null if unknown. const Value *Ptr; - /// The kind of access (read/write/read+write). - AccessKind Kind; + /// The effects of this access (read/write/read+write + locations). + AA::MemoryEffects AAME; bool operator==(const AccessInfo &RHS) const { - return I == RHS.I && Ptr == RHS.Ptr && Kind == RHS.Kind; + return I == RHS.I && Ptr == RHS.Ptr && AAME == RHS.AAME; } bool operator()(const AccessInfo &LHS, const AccessInfo &RHS) const { if (LHS.I != RHS.I) return LHS.I < RHS.I; if (LHS.Ptr != RHS.Ptr) return LHS.Ptr < RHS.Ptr; - if (LHS.Kind != RHS.Kind) - return LHS.Kind < RHS.Kind; + if (LHS.AAME != RHS.AAME) + return LHS.AAME.toIntValue() < RHS.AAME.toIntValue(); return false; } }; - /// Mapping from *single* memory location kinds, e.g., LOCAL_MEM with the - /// value of NO_LOCAL_MEM, to the accesses encountered for this memory kind. - using AccessSet = SmallSet; - std::array()> AccessKind2Accesses; - - /// Categorize the pointer arguments of CB that might access memory in - /// AccessedLoc and update the state and access map accordingly. - void - categorizeArgumentPointerLocations(Attributor &A, CallBase &CB, - AAMemoryLocation::StateType &AccessedLocs, - bool &Changed); + SmallVector AccessInfoVec; /// Return the kind(s) of location that may be accessed by \p V. - AAMemoryLocation::MemoryLocationsKind - categorizeAccessedLocations(Attributor &A, Instruction &I, bool &Changed); + AA::MemoryEffects categorizeAccessedLocations(Attributor &A, Instruction &I, + ChangeStatus &Changed); /// Return the access kind as determined by \p I. - AccessKind getAccessKindFromInst(const Instruction *I) { - AccessKind AK = READ_WRITE; - if (I) { - AK = I->mayReadFromMemory() ? READ : NONE; - AK = AccessKind(AK | (I->mayWriteToMemory() ? WRITE : NONE)); - } - return AK; - } - - /// Update the state \p State and the AccessKind2Accesses given that \p I is - /// an access of kind \p AK to a \p MLK memory location with the access - /// pointer \p Ptr. - void updateStateAndAccessesMap(AAMemoryLocation::StateType &State, - MemoryLocationsKind MLK, const Instruction *I, - const Value *Ptr, bool &Changed, - AccessKind AK = READ_WRITE) { - - assert(isPowerOf2_32(MLK) && "Expected a single location set!"); - auto *&Accesses = AccessKind2Accesses[llvm::Log2_32(MLK)]; - if (!Accesses) - Accesses = new (Allocator) AccessSet(); - Changed |= Accesses->insert(AccessInfo{I, Ptr, AK}).second; - if (MLK == NO_UNKOWN_MEM) - MLK = NO_LOCATIONS; - State.removeAssumedBits(MLK); + ModRefInfo getAccessKindFromInst(const Instruction *I) const { + if (!I) + return ModRefInfo::ModRef; + ModRefInfo MRI = ModRefInfo::NoModRef; + if (I->mayReadFromMemory()) + MRI |= ModRefInfo::Ref; + if (I->mayWriteToMemory()) + MRI |= ModRefInfo::Mod; + return MRI; } /// Determine the underlying locations kinds for \p Ptr, e.g., globals or /// arguments, and update the state and access map accordingly. - void categorizePtrValue(Attributor &A, const Instruction &I, const Value &Ptr, - AAMemoryLocation::StateType &State, bool &Changed, - unsigned AccessAS = 0); - - /// Used to allocate access sets. - BumpPtrAllocator &Allocator; + AA::MemoryEffects categorizePtrValue(Attributor &A, const Instruction &I, + const Value &Ptr, ModRefInfo MRI, + ChangeStatus &Changed, + unsigned AccessAS = 0); }; -void AAMemoryLocationImpl::categorizePtrValue( - Attributor &A, const Instruction &I, const Value &Ptr, - AAMemoryLocation::StateType &State, bool &Changed, unsigned AccessAS) { +AA::MemoryEffects AAMemoryLocationImpl::categorizePtrValue( + Attributor &A, const Instruction &I, const Value &Ptr, ModRefInfo MRI, + ChangeStatus &Changed, unsigned AccessAS) { LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Categorize pointer locations for " - << Ptr << " [" - << getMemoryLocationsAsStr(State.getAssumed()) << "]\n"); + << Ptr << "\n"); + + AA::MemoryEffects AAME = AA::MemoryEffects::none(); + AAResults *AAR = A.getInfoCache().getAAResultsForFunction(*getAnchorScope()); auto Pred = [&](Value &Obj) { - unsigned ObjectAS = Obj.getType()->getPointerAddressSpace(); - // TODO: recognize the TBAA used for constant accesses. - MemoryLocationsKind MLK = NO_LOCATIONS; + if (isa(&Obj)) + return true; + if (isa(&Obj) && + !NullPointerIsDefined(getAssociatedFunction(), AccessAS)) { + return true; + } + + if (AAR && AAR->pointsToConstantMemory(&Obj)) { + AAME = AA::MemoryEffects(AA::Location::Const, MRI); + return true; + } + unsigned ObjectAS = Obj.getType()->getPointerAddressSpace(); // Filter accesses to constant (GPU) memory if we have an AS at the access // site or the object is known to actually have the associated AS. if ((AccessAS == (unsigned)AA::GPUAddressSpace::Constant || (ObjectAS == (unsigned)AA::GPUAddressSpace::Constant && isIdentifiedObject(&Obj))) && - AA::isGPU(*I.getModule())) + AA::isGPU(*I.getModule())) { + AAME = AA::MemoryEffects(AA::Location::Const, MRI); return true; + } - if (isa(&Obj)) - return true; - if (isa(&Obj)) { + if (auto *Arg = dyn_cast(&Obj)) { // TODO: For now we do not treat byval arguments as local copies performed // on the call edge, though, we should. To make that happen we need to // teach various passes, e.g., DSE, about the copy effect of a byval. That // would also allow us to mark functions only accessing byval arguments as // readnone again, arguably their accesses have no effect outside of the // function, like accesses to allocas. - MLK = NO_ARGUMENT_MEM; - } else if (auto *GV = dyn_cast(&Obj)) { - // Reading constant memory is not treated as a read "effect" by the - // function attr pass so we won't neither. Constants defined by TBAA are - // similar. (We know we do not write it because it is constant.) + AA::MemoryEffects ArgAAME = AA::MemoryEffects::argMemOnly(MRI); + // Record the effect on the argument as well. + Changed |= restrictAssume(IRP_ARGUMENT, ArgAAME, Arg->getArgNo()); + AAME |= ArgAAME; + return true; + } + + if (auto *GV = dyn_cast(&Obj)) { if (auto *GVar = dyn_cast(GV)) - if (GVar->isConstant()) + if (GVar->isConstant()) { + AAME = AA::MemoryEffects(AA::Location::Const, MRI); return true; + } if (GV->hasLocalLinkage()) - MLK = NO_GLOBAL_INTERNAL_MEM; + AAME = AA::MemoryEffects(AA::Location::GlobalInternal, MRI); else - MLK = NO_GLOBAL_EXTERNAL_MEM; - } else if (isa(&Obj) && - (!NullPointerIsDefined(getAssociatedFunction(), AccessAS) || - !NullPointerIsDefined(getAssociatedFunction(), ObjectAS))) { + AAME = AA::MemoryEffects(AA::Location::GlobalExternal, MRI); + return true; + } + + if (isa(&Obj)) { + AAME = AA::MemoryEffects(AA::Location::Local, MRI); return true; - } else if (isa(&Obj)) { - MLK = NO_LOCAL_MEM; - } else if (const auto *CB = dyn_cast(&Obj)) { + } + if (const auto *CB = dyn_cast(&Obj)) { const auto &NoAliasAA = A.getAAFor( *this, IRPosition::callsite_returned(*CB), DepClassTy::OPTIONAL); - if (NoAliasAA.isAssumedNoAlias()) - MLK = NO_MALLOCED_MEM; - else - MLK = NO_UNKOWN_MEM; - } else { - MLK = NO_UNKOWN_MEM; + if (NoAliasAA.isAssumedNoAlias()) { + AAME = AA::MemoryEffects(AA::Location::Malloced, MRI); + return true; + } } - assert(MLK != NO_LOCATIONS && "No location specified!"); - LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Ptr value can be categorized: " - << Obj << " -> " << getMemoryLocationsAsStr(MLK) << "\n"); - updateStateAndAccessesMap(State, MLK, &I, &Obj, Changed, - getAccessKindFromInst(&I)); - - return true; + LLVM_DEBUG(dbgs() << "Could not categorize underlying pointer: " << Obj + << "\n"); + return false; }; const auto &AA = A.getAAFor( *this, IRPosition::value(Ptr), DepClassTy::OPTIONAL); if (!AA.forallUnderlyingObjects(Pred, AA::Intraprocedural)) { - LLVM_DEBUG( - dbgs() << "[AAMemoryLocation] Pointer locations not categorized\n"); - updateStateAndAccessesMap(State, NO_UNKOWN_MEM, &I, nullptr, Changed, - getAccessKindFromInst(&I)); - return; + LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Not all pointer locations " + "categorized, giving up on " + << I << "\n"); + AAME = AA::MemoryEffects(MRI); } LLVM_DEBUG( dbgs() << "[AAMemoryLocation] Accessed locations with pointer locations: " - << getMemoryLocationsAsStr(State.getAssumed()) << "\n"); + << AAME << "\n"); + return AAME; } -void AAMemoryLocationImpl::categorizeArgumentPointerLocations( - Attributor &A, CallBase &CB, AAMemoryLocation::StateType &AccessedLocs, - bool &Changed) { - for (unsigned ArgNo = 0, E = CB.arg_size(); ArgNo < E; ++ArgNo) { - - // Skip non-pointer arguments. - const Value *ArgOp = CB.getArgOperand(ArgNo); - if (!ArgOp->getType()->isPtrOrPtrVectorTy()) - continue; - - // Skip readnone arguments. - const IRPosition &ArgOpIRP = IRPosition::callsite_argument(CB, ArgNo); - const auto &ArgOpMemLocationAA = - A.getAAFor(*this, ArgOpIRP, DepClassTy::OPTIONAL); - - if (ArgOpMemLocationAA.isAssumedReadNone()) - continue; - - // Categorize potentially accessed pointer arguments as if there was an - // access instruction with them as pointer. - categorizePtrValue(A, CB, *ArgOp, AccessedLocs, Changed); - } -} - -AAMemoryLocation::MemoryLocationsKind +AA::MemoryEffects AAMemoryLocationImpl::categorizeAccessedLocations(Attributor &A, Instruction &I, - bool &Changed) { + ChangeStatus &Changed) { LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Categorize accessed locations for " << I << "\n"); - AAMemoryLocation::StateType AccessedLocs; - AccessedLocs.intersectAssumedBits(NO_LOCATIONS); - if (auto *CB = dyn_cast(&I)) { // First check if we assume any memory is access is visible. @@ -8889,73 +8349,55 @@ << " [" << CBMemLocationAA << "]\n"); if (CBMemLocationAA.isAssumedReadNone()) - return NO_LOCATIONS; + return AA::MemoryEffects::none(); - if (CBMemLocationAA.isAssumedInaccessibleMemOnly()) { - updateStateAndAccessesMap(AccessedLocs, NO_INACCESSIBLE_MEM, &I, nullptr, - Changed, getAccessKindFromInst(&I)); - return AccessedLocs.getAssumed(); - } + // Take the effects but remove local (to the callee) memory. + AA::MemoryEffects AAME = + CBMemLocationAA.getAssumedAccessedLocation() - + AA::MemoryEffects(AA::Location::Local, ModRefInfo::ModRef); - uint32_t CBAssumedNotAccessedLocs = - CBMemLocationAA.getAssumedNotAccessedLocation(); + if ((AAME & AA::MemoryEffects::argMemOnly()) != AA::MemoryEffects::none()) { + AAME -= AA::MemoryEffects::argMemOnly(); - // Set the argmemonly and global bit as we handle them separately below. - uint32_t CBAssumedNotAccessedLocsNoArgMem = - CBAssumedNotAccessedLocs | NO_ARGUMENT_MEM | NO_GLOBAL_MEM; + for (unsigned ArgNo = 0, E = CB->arg_size(); ArgNo < E; ++ArgNo) { - for (MemoryLocationsKind CurMLK = 1; CurMLK < NO_LOCATIONS; CurMLK *= 2) { - if (CBAssumedNotAccessedLocsNoArgMem & CurMLK) - continue; - updateStateAndAccessesMap(AccessedLocs, CurMLK, &I, nullptr, Changed, - getAccessKindFromInst(&I)); - } - - // Now handle global memory if it might be accessed. This is slightly tricky - // as NO_GLOBAL_MEM has multiple bits set. - bool HasGlobalAccesses = ((~CBAssumedNotAccessedLocs) & NO_GLOBAL_MEM); - if (HasGlobalAccesses) { - auto AccessPred = [&](const Instruction *, const Value *Ptr, - AccessKind Kind, MemoryLocationsKind MLK) { - updateStateAndAccessesMap(AccessedLocs, MLK, &I, Ptr, Changed, - getAccessKindFromInst(&I)); - return true; - }; - if (!CBMemLocationAA.checkForAllAccessesToMemoryKind( - AccessPred, inverseLocation(NO_GLOBAL_MEM, false, false))) - return AccessedLocs.getWorstState(); - } - - LLVM_DEBUG( - dbgs() << "[AAMemoryLocation] Accessed state before argument handling: " - << getMemoryLocationsAsStr(AccessedLocs.getAssumed()) << "\n"); + // Skip non-pointer arguments. + const Value *ArgOp = CB->getArgOperand(ArgNo); + if (!ArgOp->getType()->isPointerTy()) + continue; - // Now handle argument memory if it might be accessed. - bool HasArgAccesses = ((~CBAssumedNotAccessedLocs) & NO_ARGUMENT_MEM); - if (HasArgAccesses) - categorizeArgumentPointerLocations(A, *CB, AccessedLocs, Changed); + AA::MemoryEffects CBArgAAME = + CBMemLocationAA.getAssumed(IRP_ARGUMENT, ArgNo); + ModRefInfo CBArgMRI = CBArgAAME.getModRef(AA::Location::ArgMem); + if (CBArgMRI == ModRefInfo::NoModRef) + continue; - LLVM_DEBUG( - dbgs() << "[AAMemoryLocation] Accessed state after argument handling: " - << getMemoryLocationsAsStr(AccessedLocs.getAssumed()) << "\n"); + AA::MemoryEffects ArgAAME = + categorizePtrValue(A, I, *ArgOp, CBArgMRI, Changed, + ArgOp->getType()->getPointerAddressSpace()); + AccessInfoVec.push_back(AccessInfo{&I, ArgOp, ArgAAME}); + AAME |= ArgAAME; + } + } - return AccessedLocs.getAssumed(); + AccessInfoVec.push_back(AccessInfo{&I, nullptr, AAME}); + return AAME; } if (const Value *Ptr = getPointerOperand(&I, /* AllowVolatile */ true)) { LLVM_DEBUG( dbgs() << "[AAMemoryLocation] Categorize memory access with pointer: " << I << " [" << *Ptr << "]\n"); - categorizePtrValue(A, I, *Ptr, AccessedLocs, Changed, - Ptr->getType()->getPointerAddressSpace()); - return AccessedLocs.getAssumed(); + AA::MemoryEffects AAME = + categorizePtrValue(A, I, *Ptr, getAccessKindFromInst(&I), Changed, + Ptr->getType()->getPointerAddressSpace()); + AccessInfoVec.push_back(AccessInfo{&I, Ptr, AAME}); + return AAME; } LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Failed to categorize instruction: " << I << "\n"); - updateStateAndAccessesMap(AccessedLocs, NO_UNKOWN_MEM, &I, nullptr, Changed, - getAccessKindFromInst(&I)); - return AccessedLocs.getAssumed(); + return AA::MemoryEffects::unknown(); } /// An AA to represent the memory behavior function attributes. @@ -8963,54 +8405,210 @@ AAMemoryLocationFunction(const IRPosition &IRP, Attributor &A) : AAMemoryLocationImpl(IRP, A) {} - /// See AbstractAttribute::updateImpl(Attributor &A). - ChangeStatus updateImpl(Attributor &A) override { - - const auto &MemBehaviorAA = - A.getAAFor(*this, getIRPosition(), DepClassTy::NONE); - if (MemBehaviorAA.isAssumedReadNone()) { - if (MemBehaviorAA.isKnownReadNone()) - return indicateOptimisticFixpoint(); - assert(isAssumedReadNone() && - "AAMemoryLocation was not read-none but AAMemoryBehavior was!"); - A.recordDependence(MemBehaviorAA, *this, DepClassTy::OPTIONAL); - return ChangeStatus::UNCHANGED; + void initialize(Attributor &A) override { + AAMemoryLocationImpl::initialize(A); + Function *F = getAssociatedFunction(); + if (hasPtrArgs()) { + for (Argument &Arg : F->args()) { + if (Arg.getType()->isPointerTy()) { + // Be conservative for now. + if (Arg.hasPointeeInMemoryValueAttr()) + indicatePessimisticFixpoint(IRP_ARGUMENT, Arg.getArgNo()); + else + getKnownStateFromValue(A, IRPosition::argument(Arg), getState()); + } + } } + if (F->isDeclaration() || !A.isFunctionIPOAmendable(*F)) + indicatePessimisticFixpoint(); + } - // The current assumed state used to determine a change. - auto AssumedState = getAssumed(); - bool Changed = false; + /// See AbstractAttribute::updateImpl(Attributor &A). + ChangeStatus updateImpl(Attributor &A) override { + ChangeStatus Changed = ChangeStatus::UNCHANGED; auto CheckRWInst = [&](Instruction &I) { - MemoryLocationsKind MLK = categorizeAccessedLocations(A, I, Changed); + AA::MemoryEffects AAME = categorizeAccessedLocations(A, I, Changed); LLVM_DEBUG(dbgs() << "[AAMemoryLocation] Accessed locations for " << I - << ": " << getMemoryLocationsAsStr(MLK) << "\n"); - removeAssumedBits(inverseLocation(MLK, false, false)); - // Stop once only the valid bit set in the *not assumed location*, thus - // once we don't actually exclude any memory locations in the state. - return getAssumedNotAccessedLocation() != VALID_STATE; + << ": " << AAME << "\n"); + + // If we access something unknown we need to look at the arguments + // explicitly. + CheckArgumentsExplicitly |= + AAME.getModRef(AA::Location::Other) != ModRefInfo::NoModRef; + Changed |= restrictAssume(IRP_FUNCTION, AAME); + + return true; }; bool UsedAssumedInformation = false; - if (!A.checkForAllReadWriteInstructions(CheckRWInst, *this, - UsedAssumedInformation)) - return indicatePessimisticFixpoint(); + if ((!CheckArgumentsExplicitly && hasPtrArgs()) || + !isAtFixpoint(IRP_FUNCTION)) { + if (!A.checkForAllReadWriteInstructions(CheckRWInst, *this, + UsedAssumedInformation)) { + indicatePessimisticFixpoint(IRP_FUNCTION); + CheckArgumentsExplicitly = true; + Changed = ChangeStatus::CHANGED; + } + } - Changed |= AssumedState != getAssumed(); - return Changed ? ChangeStatus::CHANGED : ChangeStatus::UNCHANGED; + if (!CheckArgumentsExplicitly || !hasPtrArgs()) + return Changed; + + AA::MemoryEffects FnAAME = getAssumedAccessedLocation(); + ModRefInfo FnArgMRI = FnAAME.getModRef(AA::Location::ArgMem); + Function *F = getAssociatedFunction(); + for (Argument &Arg : F->args()) { + if (!Arg.getType()->isPointerTy()) + continue; + AA::MemoryEffects ArgAAME = updateArgument(A, Arg, FnAAME); + Changed |= restrictAssume(IRP_ARGUMENT, ArgAAME, Arg.getArgNo()); + + // Also update the argmem information of the function. + ModRefInfo ArgMRI = ArgAAME.getModRef(AA::Location::ArgMem); + FnArgMRI |= ArgMRI; + } + + AA::MemoryEffects NewFnAAME = + FnAAME.getWithModRef(AA::Location::ArgMem, FnArgMRI); + if (NewFnAAME != FnAAME) + Changed |= restrictAssume(IRP_FUNCTION, NewFnAAME); + return Changed; } - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_FN_ATTR(readnone) - else if (isAssumedArgMemOnly()) - STATS_DECLTRACK_FN_ATTR(argmemonly) - else if (isAssumedInaccessibleMemOnly()) - STATS_DECLTRACK_FN_ATTR(inaccessiblememonly) - else if (isAssumedInaccessibleOrArgMemOnly()) - STATS_DECLTRACK_FN_ATTR(inaccessiblememorargmemonly) +private: + AA::MemoryEffects updateArgument(Attributor &A, Argument &Arg, + AA::MemoryEffects FnAAME) { + + unsigned ArgNo = Arg.getArgNo(); + AA::MemoryEffects AAME = getAssumed(IRP_ARGUMENT, ArgNo); + + // First, check the function scope. We avoid work if the assumed information + // implies the current assumed information for this attribute. This is a + // valid for all but byval arguments. + if (!Arg.hasByValAttr()) { + AAME &= FnAAME; + if (AAME == FnAAME) + return AAME; + } + + AA::MemoryEffects Known = getKnown(IRP_ARGUMENT, ArgNo); + + // Visit and expand uses until all are analyzed or a fixpoint is reached. + auto UsePred = [&](const Use &U, bool &Follow) -> bool { + Instruction *UserI = cast(U.getUser()); + LLVM_DEBUG(dbgs() << "[AAMemoryBehavior] Use: " << *U << " in " << *UserI + << " \n"); + + // Droppable users, e.g., llvm::assume does not actually perform any + // action. + if (UserI->isDroppable()) + return true; + + // Check if the users of UserI should also be visited. + Follow = followUsersOfUseIn(A, U, UserI); + + // If UserI might touch memory we analyze the use in detail. + if (UserI->mayReadOrWriteMemory()) + AAME |= analyzeUseIn(A, U, UserI); + + return AAME != Known; + }; + + if (!A.checkForAllUses(UsePred, *this, Arg)) + return AA::MemoryEffects::unknown(); + + return AAME; + } + + bool followUsersOfUseIn(Attributor &A, const Use &U, + const Instruction *UserI) const { + // The loaded value is unrelated to the pointer argument, no need to + // follow the users of the load. + if (isa(UserI) || isa(UserI)) + return false; + + // By default we follow all uses assuming UserI might leak information on U, + // we have special handling for call sites operands though. + const auto *CB = dyn_cast(UserI); + if (!CB || !CB->isArgOperand(&U)) + return true; + + // If the use is a call argument known not to be captured, the users of + // the call do not need to be visited because they have to be unrelated to + // the input. + if (U.get()->getType()->isPointerTy()) { + unsigned ArgNo = CB->getArgOperandNo(&U); + const auto &ArgNoCaptureAA = A.getAAFor( + *this, IRPosition::callsite_argument(*CB, ArgNo), + DepClassTy::OPTIONAL); + return !ArgNoCaptureAA.isAssumedNoCapture(); + } + + return true; } + + AA::MemoryEffects analyzeUseIn(Attributor &A, const Use &U, + const Instruction *UserI) const { + assert(UserI->mayReadOrWriteMemory()); + + switch (UserI->getOpcode()) { + default: + // TODO: Handle all atomics and other side-effect operations we know of. + break; + case Instruction::Load: + return AA::MemoryEffects::readOnly(); + + case Instruction::Store: { + // Stores cause the NO_WRITES property to disappear if the use is the + // pointer operand. Note that while capturing was taken care of somewhere + // else we need to deal with stores of the value that is not looked + // through. + auto *SI = cast(UserI); + if (&SI->getOperandUse(SI->getPointerOperandIndex()) == &U) + return AA::MemoryEffects::writeOnly(); + return AA::MemoryEffects::unknown(); + } + + case Instruction::Call: + case Instruction::CallBr: + case Instruction::Invoke: { + // For call sites we look at the argument memory behavior attribute (this + // could be recursive!) in order to restrict our own state. + const auto *CB = cast(UserI); + + // Give up on operand bundles. + if (CB->isBundleOperand(&U)) + return AA::MemoryEffects::unknown(); + + // Calling a function does not read the function pointer, this is to match + // the FunctionAttrs pass. + if (CB->isCallee(&U)) + return AA::MemoryEffects::none(); + + if (U->getType()->isPointerTy()) { + const auto &MemBehaviorAA = A.getAAFor( + *this, IRPosition::callsite_function(*CB), DepClassTy::OPTIONAL); + return MemBehaviorAA.getAssumed(IRP_CALL_SITE_ARGUMENT, + CB->getArgOperandNo(&U)); + } + } + }; + + // Generally, look at the "may-properties" and adjust the assumed state if + // we did not trigger special handling before. + AA::MemoryEffects AAME = AA::MemoryEffects::none(); + if (UserI->mayReadFromMemory()) + AAME |= AA::MemoryEffects::readOnly(); + if (UserI->mayWriteToMemory()) + AAME |= AA::MemoryEffects::writeOnly(); + return AAME; + } + + /// Flag to indicate if we require explicit use traversals for the arguments + /// or if we can just rely on the accesses collected for the function scope + /// traversal. + bool CheckArgumentsExplicitly = false; }; /// AAMemoryLocation attribute for call sites. @@ -9020,10 +8618,31 @@ /// See AbstractAttribute::initialize(...). void initialize(Attributor &A) override { - AAMemoryLocationImpl::initialize(A); + CallBase &CB = cast(getAnchorValue()); + getKnownStateFromValue(A, getIRPosition(), getState(), + /* IgnoreSubsumingPositions */ true); + Function *Callee = CB.getCalledFunction(); + if (Callee) + getKnownStateFromValue(A, IRPosition::function(*Callee), getState(), + /* IgnoreSubsumingPositions */ false); + if (hasPtrArgs()) { + CallBase &CB = cast(getAnchorValue()); + for (unsigned ArgNo = 0, NA = CB.arg_size(); ArgNo != NA; ++ArgNo) { + if (!CB.getArgOperand(ArgNo)->getType()->isPointerTy()) + continue; + getKnownStateFromValue(A, IRPosition::callsite_argument(CB, ArgNo), + getState()); + if (Callee && Callee->arg_size() > ArgNo) + getKnownStateFromValue( + A, IRPosition::argument(*Callee->getArg(ArgNo)), getState(), + /* IgnoreSubsumingPositions */ false); + } + } Function *F = getAssociatedFunction(); - if (!F || F->isDeclaration()) + if (!F || F->isDeclaration() || !A.isFunctionIPOAmendable(*F)) indicatePessimisticFixpoint(); + AccessInfoVec.push_back( + AccessInfo{getCtxI(), nullptr, getAssumedAccessedLocation()}); } /// See AbstractAttribute::updateImpl(...). @@ -9036,22 +8655,28 @@ const IRPosition &FnPos = IRPosition::function(*F); auto &FnAA = A.getAAFor(*this, FnPos, DepClassTy::REQUIRED); - bool Changed = false; - auto AccessPred = [&](const Instruction *I, const Value *Ptr, - AccessKind Kind, MemoryLocationsKind MLK) { - updateStateAndAccessesMap(getState(), MLK, I, Ptr, Changed, - getAccessKindFromInst(I)); - return true; - }; - if (!FnAA.checkForAllAccessesToMemoryKind(AccessPred, ALL_LOCATIONS)) - return indicatePessimisticFixpoint(); - return Changed ? ChangeStatus::CHANGED : ChangeStatus::UNCHANGED; - } - /// See AbstractAttribute::trackStatistics() - void trackStatistics() const override { - if (isAssumedReadNone()) - STATS_DECLTRACK_CS_ATTR(readnone) + ChangeStatus Changed = + restrictAssume(IRP_FUNCTION, FnAA.getAssumedAccessedLocation()); + AccessInfoVec.back() = + AccessInfo{getCtxI(), nullptr, getAssumedAccessedLocation()}; + if (!hasPtrArgs()) + return Changed; + + CallBase &CB = cast(getAnchorValue()); + unsigned NumCBArgs = CB.arg_size(); + unsigned NumFnArgs = F->arg_size(); + for (unsigned ArgNo = 0; ArgNo != NumCBArgs; ++ArgNo) { + if (!CB.getArgOperand(ArgNo)->getType()->isPointerTy()) + continue; + if (ArgNo >= NumFnArgs) { + indicatePessimisticFixpoint(IRP_CALL_SITE_ARGUMENT, ArgNo); + continue; + } + Changed |= restrictAssume(IRP_CALL_SITE_ARGUMENT, + FnAA.getAssumed(IRP_ARGUMENT, ArgNo), ArgNo); + } + return Changed; } }; } // namespace @@ -11968,7 +11593,7 @@ AAUnderlyingObjectsFunction(const IRPosition &IRP, Attributor &A) : AAUnderlyingObjectsImpl(IRP, A) {} }; -} +} // namespace const char AAReturnedValues::ID = 0; const char AANoUnwind::ID = 0; @@ -11991,7 +11616,6 @@ const char AAValueSimplify::ID = 0; const char AAHeapToStack::ID = 0; const char AAPrivatizablePtr::ID = 0; -const char AAMemoryBehavior::ID = 0; const char AAMemoryLocation::ID = 0; const char AAValueConstantRange::ID = 0; const char AAPotentialConstantValues::ID = 0; @@ -12133,8 +11757,6 @@ CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION(AAIntraFnReachability) CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION(AAInterFnReachability) -CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION(AAMemoryBehavior) - #undef CREATE_FUNCTION_ONLY_ABSTRACT_ATTRIBUTE_FOR_POSITION #undef CREATE_FUNCTION_ABSTRACT_ATTRIBUTE_FOR_POSITION #undef CREATE_NON_RET_ABSTRACT_ATTRIBUTE_FOR_POSITION Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp =================================================================== --- llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -3103,13 +3103,12 @@ *this, IRPosition::callsite_function(*CB), DepClassTy::OPTIONAL); auto AccessPred = [&](const Instruction *I, const Value *Ptr, - AAMemoryLocation::AccessKind, - AAMemoryLocation::MemoryLocationsKind) { + AA::MemoryEffects AAME) { return !AA::isPotentiallyAffectedByBarrier(A, {Ptr}, *this, I); }; if (MemAA.getState().isValidState() && MemAA.checkForAllAccessesToMemoryKind( - AccessPred, AAMemoryLocation::ALL_LOCATIONS)) + AccessPred, AA::MemoryEffects::anyObservableMem())) continue; } Index: llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll @@ -22,26 +22,26 @@ } define void @no_promote(ptr %arg) #1 { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@no_promote ; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; TUNIT-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR5:[0-9]+]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32 ; TUNIT-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@no_promote ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3:[0-9]+]] -; CGSCC-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: call fastcc void @no_promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 32 dereferenceable(32) [[TMP]]) #[[ATTR5:[0-9]+]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32 ; CGSCC-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -74,28 +74,28 @@ } define void @promote(ptr %arg) #0 { -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@promote -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR4]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[TMP]], align 32 -; TUNIT-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] +; TUNIT-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR5]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32 ; TUNIT-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@promote -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(32) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <4 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR3]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR4]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <4 x i64>, ptr [[TMP]], align 32 -; CGSCC-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR4]] +; CGSCC-NEXT: call fastcc void @promote_avx2(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(32) [[TMP2]], <4 x i64> [[TMP0]]) #[[ATTR5]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32 ; CGSCC-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -118,14 +118,16 @@ attributes #2 = { argmemonly nounwind } ;. ; TUNIT: attributes #[[ATTR0]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "target-features"="+avx2" } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; TUNIT: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR3]] = { willreturn } -; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable } +; TUNIT: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "target-features"="+avx2" } +; TUNIT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR4]] = { willreturn } +; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn memory(argmem: readwrite) } ;. ; CGSCC: attributes #[[ATTR0]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "target-features"="+avx2" } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR3]] = { willreturn } -; CGSCC: attributes #[[ATTR4]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) uwtable } +; CGSCC: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR4]] = { willreturn } +; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll @@ -27,28 +27,28 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %arg) #0 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9:[0-9]+]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10:[0-9]+]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer512 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9:[0-9]+]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10:[0-9]+]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -68,7 +68,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64 @@ -84,28 +84,28 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %arg) #1 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -125,7 +125,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64 @@ -141,28 +141,28 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %arg) #0 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer512_call_avx512_legal512_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -198,28 +198,28 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %arg) #1 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal512_prefer512 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -239,7 +239,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1]], align 64 ; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64 @@ -253,26 +253,26 @@ define void @avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr %arg) #2 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] -; TUNIT-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal256_prefer256_call_avx512_legal512_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] -; CGSCC-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -292,7 +292,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[ARG1:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[TMP:%.*]] = load <8 x i64>, ptr [[ARG1]], align 64 ; CHECK-NEXT: store <8 x i64> [[TMP]], ptr [[ARG]], align 64 @@ -306,26 +306,26 @@ define void @avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr %arg) #1 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] -; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] +; TUNIT-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx512_legal512_prefer256_call_avx512_legal256_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] -; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR6]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] +; CGSCC-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(64) [[TMP]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -345,7 +345,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64 @@ -361,28 +361,28 @@ define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %arg) #4 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; TUNIT-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx2_legal256_prefer256_call_avx2_legal512_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -402,7 +402,7 @@ ; ; CHECK: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[ARG:%.*]], <8 x i64> [[TMP0:%.*]]) #[[ATTR6]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[ARG1_PRIV:%.*]] = alloca <8 x i64>, align 64 ; CHECK-NEXT: store <8 x i64> [[TMP0]], ptr [[ARG1_PRIV]], align 64 @@ -418,28 +418,28 @@ define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %arg) #3 { ; -; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[ARG:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; TUNIT-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; TUNIT-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 32 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; TUNIT-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; TUNIT-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; TUNIT-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; TUNIT-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@avx2_legal512_prefer256_call_avx2_legal256_prefer256 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 2 dereferenceable(64) [[ARG:%.*]]) #[[ATTR7]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca <8 x i64>, align 32 ; CGSCC-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32 -; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: call void @llvm.memset.p0.i64(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP]], i8 noundef 0, i64 noundef 32, i1 noundef false) #[[ATTR9]] ; CGSCC-NEXT: [[TMP0:%.*]] = load <8 x i64>, ptr [[TMP]], align 64 -; CGSCC-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR6]] +; CGSCC-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr noalias nocapture nofree noundef nonnull writeonly align 64 dereferenceable(64) [[TMP2]], <8 x i64> [[TMP0]]) #[[ATTR10]] ; CGSCC-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 64 ; CGSCC-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2 ; CGSCC-NEXT: ret void @@ -465,18 +465,26 @@ attributes #5 = { argmemonly nounwind } ;. ; TUNIT: attributes #[[ATTR0]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } -; TUNIT: attributes #[[ATTR1]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; TUNIT: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; TUNIT: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } -; TUNIT: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR5]] = { willreturn } -; TUNIT: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR1]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; TUNIT: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; TUNIT: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; TUNIT: attributes #[[ATTR4]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; TUNIT: attributes #[[ATTR5]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; TUNIT: attributes #[[ATTR6]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; TUNIT: attributes #[[ATTR7]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR9]] = { willreturn } +; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn memory(argmem: readwrite) } ;. ; CGSCC: attributes #[[ATTR0]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } -; CGSCC: attributes #[[ATTR1]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; CGSCC: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } -; CGSCC: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } -; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR5]] = { willreturn } -; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR4]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR5]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; CGSCC: attributes #[[ATTR6]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR7]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; CGSCC: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR9]] = { willreturn } +; CGSCC: attributes #[[ATTR10]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -22,8 +22,9 @@ } define internal void @g(ptr %a) { +; CHECK: Function Attrs: memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@g -; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[A_PRIV]], align 4 ; CHECK-NEXT: [[AA:%.*]] = load i32, ptr [[A_PRIV]], align 1 @@ -42,7 +43,7 @@ define internal i32 @test(ptr %X, ptr %Y) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]], i64 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: [[Y_PRIV:%.*]] = alloca i64, align 8 ; CGSCC-NEXT: store i64 [[TMP0]], ptr [[Y_PRIV]], align 4 ; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[X]], align 4 @@ -69,12 +70,12 @@ } define internal i32 @caller(ptr %A) { -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller -; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 [[TMP0]], ptr [[A_PRIV]], align 4 -; CGSCC-NEXT: [[C:%.*]] = call i32 @test(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_PRIV]], i64 noundef 1) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: [[C:%.*]] = call i32 @test(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_PRIV]], i64 noundef 1) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: ret i32 [[C]] ; %B = alloca i64 @@ -86,14 +87,14 @@ define i32 @callercaller() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@callercaller -; TUNIT-SAME: () #[[ATTR0:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: [[B:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: ret i32 3 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@callercaller -; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { -; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32 noundef 2) #[[ATTR4:[0-9]+]] +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32 noundef 2) #[[ATTR4]] ; CGSCC-NEXT: ret i32 [[X]] ; %B = alloca i32 @@ -102,11 +103,12 @@ ret i32 %X } ;. -; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ;. -; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR3]] = { willreturn memory(read) } -; CGSCC: attributes #[[ATTR4]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR4]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/alloca-as.ll @@ -32,8 +32,9 @@ } define internal i32 @foo(ptr %arg) { +; CHECK: Function Attrs: memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@foo -; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[ARG_PRIV:%.*]] = alloca i32, align 4, addrspace(7) ; CHECK-NEXT: store i32 [[TMP0]], ptr addrspace(7) [[ARG_PRIV]], align 4 @@ -49,3 +50,6 @@ } declare void @use(i32) +;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/array.ll @@ -2,8 +2,6 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC ; -; FIXME: The GEP + BC + GEP solution we create is not great but correct. - declare void @use(ptr nocapture readonly %arg) define void @caller() { @@ -30,8 +28,9 @@ } define internal void @callee(ptr noalias %arg) { +; CHECK: Function Attrs: memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@callee -; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) { +; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[ARG_PRIV:%.*]] = alloca [3 x i32], align 4 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[ARG_PRIV]], align 4 @@ -46,3 +45,6 @@ call void @use(ptr %arg) ret void } +;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll @@ -42,7 +42,7 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test -; TUNIT-SAME: (ptr nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nocapture nofree [[X:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; TUNIT-NEXT: store i32 1, ptr [[S]], align 8 @@ -54,7 +54,7 @@ ; TUNIT-NEXT: [[C:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] ; TUNIT-NEXT: ret i32 [[C]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: @@ -79,6 +79,6 @@ ; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll @@ -21,7 +21,7 @@ } define internal i32 @caller(ptr %B) { -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller ; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 @@ -45,7 +45,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@callercaller ; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { -; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32 noundef 2) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: [[X:%.*]] = call i32 @caller(i32 noundef 2) #[[ATTR3]] ; CGSCC-NEXT: ret i32 [[X]] ; %B = alloca i32 @@ -58,10 +58,9 @@ ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR3]] = { willreturn memory(read) } -; CGSCC: attributes #[[ATTR4]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR3]] = { willreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CHECK: {{.*}} Index: llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll @@ -34,7 +34,7 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test -; TUNIT-SAME: (ptr nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nocapture nofree [[X:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; TUNIT-NEXT: store i32 1, ptr [[S]], align 8 @@ -46,7 +46,7 @@ ; TUNIT-NEXT: call void @f(i32 [[TMP0]], i64 [[TMP1]], i32 [[TMP2]]) #[[ATTR1:[0-9]+]] ; TUNIT-NEXT: ret i32 0 ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: @@ -69,6 +69,6 @@ ; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/dbg.ll @@ -5,8 +5,9 @@ declare void @sink(i32) define internal void @test(ptr %X) !dbg !2 { +; CHECK: Function Attrs: memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@test -; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[X:%.*]]) !dbg [[DBG3:![0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[X:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG3:![0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[X]], align 8 ; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 8 ; CHECK-NEXT: call void @sink(i32 [[TMP2]]) @@ -31,13 +32,14 @@ define void @caller(ptr %Y, ptr %P) { ; TUNIT-LABEL: define {{[^@]+}}@caller -; TUNIT-SAME: (ptr nocapture nofree readonly [[Y:%.*]], ptr nocapture nofree readnone [[P:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree readonly [[Y:%.*]], ptr nocapture nofree [[P:%.*]]) { ; TUNIT-NEXT: call void @test(ptr nocapture nofree readonly align 8 [[Y]]), !dbg [[DBG4:![0-9]+]] ; TUNIT-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]], ptr nocapture nofree readnone [[P:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y:%.*]], ptr nocapture nofree readnone [[P:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: call void @test(ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[Y]]), !dbg [[DBG4:![0-9]+]] ; CGSCC-NEXT: call void @test_byval(), !dbg [[DBG5:![0-9]+]] ; CGSCC-NEXT: ret void @@ -59,6 +61,8 @@ !5 = !DIFile(filename: "test.c", directory: "") !6 = !DILocation(line: 9, scope: !2) ;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +;. ; CHECK: [[META0:![0-9]+]] = !{i32 2, !"Debug Info Version", i32 3} ; CHECK: [[META1:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.5.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly) ; CHECK: [[META2:![0-9]+]] = !DIFile(filename: "test.c", directory: "") Index: llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll @@ -87,8 +87,9 @@ ; CGSCC-NEXT: [[A_PTR:%.*]] = alloca ptr, align 8 ; CGSCC-NEXT: br label [[LOOP:%.*]] ; CGSCC: loop: -; CGSCC-NEXT: [[PHI:%.*]] = phi ptr [ null, [[ENTRY:%.*]] ], [ [[A_PRIV]], [[LOOP]] ] +; CGSCC-NEXT: [[PHI:%.*]] = phi ptr [ null, [[ENTRY:%.*]] ], [ [[GEP:%.*]], [[LOOP]] ] ; CGSCC-NEXT: [[TMP2:%.*]] = phi ptr [ [[A_PRIV]], [[ENTRY]] ], [ [[TMP2]], [[LOOP]] ] +; CGSCC-NEXT: [[GEP]] = getelementptr [[STRUCT_FOO]], ptr [[A_PRIV]], i64 0 ; CGSCC-NEXT: br label [[LOOP]] ; entry: Index: llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll @@ -62,7 +62,7 @@ define internal i1 @g(ptr %a, ptr inalloca(%struct.ss) %b) nounwind { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@g -; CGSCC-SAME: (ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], ptr noalias nocapture nofree nonnull writeonly inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(8) [[A:%.*]], ptr noalias nocapture nofree nonnull inalloca([[STRUCT_SS:%.*]]) align 4 dereferenceable(8) [[B:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: ret i1 undef ; Index: llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll @@ -88,11 +88,11 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(argmem: write) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ; CGSCC: attributes #[[ATTR3]] = { nounwind willreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: Index: llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll @@ -30,13 +30,13 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@caller ; TUNIT-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR0]] { -; TUNIT-NEXT: [[V:%.*]] = musttail call i32 @test(ptr nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: [[V:%.*]] = musttail call i32 @test(ptr nocapture nofree readonly [[P]]) #[[ATTR3:[0-9]+]] ; TUNIT-NEXT: ret i32 [[V]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller ; CGSCC-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @test(ptr nocapture nofree readonly [[P]]) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @test(ptr nocapture nofree readonly [[P]]) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: ret i32 [[V]] ; %v = musttail call i32 @test(%T* %p) @@ -68,7 +68,7 @@ ; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[A_GEP]], align 4 ; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[B_GEP]], align 4 ; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @foo(ptr undef, i32 [[V]]) #[[ATTR5]] +; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @foo(ptr readnone undef, i32 [[V]]) #[[ATTR4]] ; CGSCC-NEXT: ret i32 [[CA]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 @@ -89,7 +89,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller2 ; CGSCC-SAME: (ptr nocapture nofree readonly align 4 [[G:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR5]] +; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR4]] ; CGSCC-NEXT: ret i32 [[V]] ; %v = call i32 @test2(%T* %g, i32 0) @@ -119,26 +119,26 @@ } define internal i32 @test2b(ptr %p, i32 %p2) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test2b -; TUNIT-SAME: (ptr nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], ptr [[P]], i64 0, i32 3 ; TUNIT-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], ptr [[P]], i64 0, i32 2 ; TUNIT-NEXT: [[A:%.*]] = load i32, ptr [[A_GEP]], align 4 ; TUNIT-NEXT: [[B:%.*]] = load i32, ptr [[B_GEP]], align 4 ; TUNIT-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; TUNIT-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr undef, i32 [[V]]) #[[ATTR4]] +; TUNIT-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr writeonly undef, i32 [[V]]) #[[ATTR4:[0-9]+]] ; TUNIT-NEXT: ret i32 [[CA]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test2b -; CGSCC-SAME: (ptr nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree readonly [[P:%.*]], i32 [[P2:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: [[A_GEP:%.*]] = getelementptr [[T:%.*]], ptr [[P]], i64 0, i32 3 ; CGSCC-NEXT: [[B_GEP:%.*]] = getelementptr [[T]], ptr [[P]], i64 0, i32 2 ; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[A_GEP]], align 4 ; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[B_GEP]], align 4 ; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]] -; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr undef, i32 [[V]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr writeonly undef, i32 [[V]]) #[[ATTR5:[0-9]+]] ; CGSCC-NEXT: ret i32 [[CA]] ; %a.gep = getelementptr %T, %T* %p, i64 0, i32 3 @@ -151,16 +151,16 @@ } define i32 @caller2b(ptr %g) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@caller2b -; TUNIT-SAME: (ptr nocapture nofree readonly [[G:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[G:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: [[V:%.*]] = call noundef i32 @test2b(ptr nocapture nofree readonly [[G]], i32 undef) #[[ATTR4]] ; TUNIT-NEXT: ret i32 [[V]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@caller2b -; CGSCC-SAME: (ptr nocapture nofree readonly align 4 [[G:%.*]]) #[[ATTR4]] { -; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2b(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR7:[0-9]+]] +; CGSCC-SAME: (ptr nocapture nofree readonly align 4 [[G:%.*]]) #[[ATTR1]] { +; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2b(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR4]] ; CGSCC-NEXT: ret i32 [[V]] ; %v = call i32 @test2b(%T* %g, i32 0) @@ -170,15 +170,13 @@ ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn memory(argmem: read) } ; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR5]] = { willreturn } -; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { willreturn } +; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll @@ -15,7 +15,7 @@ define i32 @bar() { ; CHECK-LABEL: define {{[^@]+}}@bar() addrspace(1) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call addrspace(1) i32 @foo() #[[ATTR0:[0-9]+]] +; CHECK-NEXT: [[CALL:%.*]] = call addrspace(1) i32 @foo() #[[ATTR1:[0-9]+]] ; CHECK-NEXT: unreachable ; @@ -25,9 +25,9 @@ } define internal i32 @foo(ptr) { -; CHECK: Function Attrs: noreturn +; CHECK: Function Attrs: noreturn memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@foo -; CHECK-SAME: () addrspace(1) #[[ATTR0]] { +; CHECK-SAME: () addrspace(1) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 ; CHECK-NEXT: call addrspace(0) void asm sideeffect "ldr r0, [r0] \0Abx lr \0A", ""() @@ -40,7 +40,8 @@ } ;. -; CHECK: attributes #[[ATTR0]] = { noreturn } +; CHECK: attributes #[[ATTR0]] = { noreturn memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR1]] = { noreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/pr27568.ll @@ -4,7 +4,9 @@ target triple = "x86_64-pc-windows-msvc" define internal void @callee(ptr) { -; CHECK-LABEL: define {{[^@]+}}@callee() { +; CHECK: Function Attrs: memory(readwrite, argmem: none) +; CHECK-LABEL: define {{[^@]+}}@callee +; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @thunk() ; CHECK-NEXT: ret void @@ -43,6 +45,9 @@ declare void @thunk() declare i32 @__CxxFrameHandler3(...) +;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) } +;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} ; TUNIT: {{.*}} Index: llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll @@ -11,16 +11,16 @@ ; CHECK: @[[A:[a-zA-Z0-9_$"\\.-]+]] = common local_unnamed_addr global i32 0, align 4 ;. define i32 @fn2() local_unnamed_addr { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: read) ; TUNIT-LABEL: define {{[^@]+}}@fn2 ; TUNIT-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr @b, align 4 ; TUNIT-NEXT: [[TMP2:%.*]] = sext i32 [[TMP1]] to i64 ; TUNIT-NEXT: [[TMP3:%.*]] = inttoptr i64 [[TMP2]] to ptr -; TUNIT-NEXT: call fastcc void @fn1(ptr nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR1:[0-9]+]] +; TUNIT-NEXT: call fastcc void @fn1(ptr nocapture nofree readonly align 4 [[TMP3]]) #[[ATTR2:[0-9]+]] ; TUNIT-NEXT: ret i32 undef ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: read) ; CGSCC-LABEL: define {{[^@]+}}@fn2 ; CGSCC-SAME: () local_unnamed_addr #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr @b, align 4 @@ -37,21 +37,13 @@ } define internal fastcc void @fn1(ptr nocapture readonly) unnamed_addr { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn -; TUNIT-LABEL: define {{[^@]+}}@fn1 -; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR0]] { -; TUNIT-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 -1 -; TUNIT-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4 -; TUNIT-NEXT: store i32 [[TMP3]], ptr @a, align 4 -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn -; CGSCC-LABEL: define {{[^@]+}}@fn1 -; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 -1 -; CGSCC-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4 -; CGSCC-NEXT: store i32 [[TMP3]], ptr @a, align 4 -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: read, inaccessiblemem: none) +; CHECK-LABEL: define {{[^@]+}}@fn1 +; CHECK-SAME: (ptr nocapture nofree nonnull readonly align 4 [[TMP0:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 -1 +; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4 +; CHECK-NEXT: store i32 [[TMP3]], ptr @a, align 4 +; CHECK-NEXT: ret void ; %2 = getelementptr inbounds i32, ptr %0, i64 -1 %3 = load i32, ptr %2, align 4 @@ -59,12 +51,11 @@ ret void } ;. -; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: read) } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: read, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ;. -; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: read) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: read, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } ;. -;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: -; CHECK: {{.*}} Index: llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/profile.ll @@ -24,8 +24,9 @@ } define internal void @promote_i32_ptr(ptr %xp) { +; CHECK: Function Attrs: memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@promote_i32_ptr -; CHECK-SAME: (i32 [[TMP0:%.*]]) { +; CHECK-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[XP_PRIV:%.*]] = alloca i32, align 4 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[XP_PRIV]], align 4 ; CHECK-NEXT: [[X:%.*]] = load i32, ptr [[XP_PRIV]], align 4 @@ -41,5 +42,7 @@ !0 = !{!"branch_weights", i32 30} ;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: read) } +;. ; CHECK: [[META0:![0-9]+]] = !{!"branch_weights", i32 30} ;. Index: llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll @@ -22,7 +22,7 @@ ; CHECK: @[[D:[a-zA-Z0-9_$"\\.-]+]] = global i8 0, align 1 ;. define internal fastcc void @fn(ptr nocapture readonly %p1, ptr nocapture readonly %p2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@fn ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: @@ -41,18 +41,18 @@ } define i32 @main() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) ; TUNIT-LABEL: define {{[^@]+}}@main -; TUNIT-SAME: () #[[ATTR0]] { +; TUNIT-SAME: () #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr @e, align 8, !tbaa [[TBAA5:![0-9]+]] ; TUNIT-NEXT: store ptr @g, ptr [[TMP0]], align 8, !tbaa [[TBAA5]] ; TUNIT-NEXT: [[TMP1:%.*]] = load ptr, ptr @a, align 8, !tbaa [[TBAA5]] ; TUNIT-NEXT: store i32 1, ptr [[TMP1]], align 4, !tbaa [[TBAA0]] -; TUNIT-NEXT: call fastcc void @fn() #[[ATTR1:[0-9]+]] +; TUNIT-NEXT: call fastcc void @fn() #[[ATTR2:[0-9]+]] ; TUNIT-NEXT: ret i32 0 ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) ; CGSCC-LABEL: define {{[^@]+}}@main ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: @@ -84,11 +84,12 @@ !9 = !{!"any pointer", !3, i64 0} ;. -; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } ;. -; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) } ; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } ;. ; CHECK: [[TBAA0]] = !{!1, !1, i64 0} Index: llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll @@ -9,13 +9,13 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@add -; TUNIT-SAME: (ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: store i32 undef, ptr [[R]], align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@add -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nocapture nofree noundef nonnull sret(i32) align 4 dereferenceable(4) [[R:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: [[BP:%.*]] = getelementptr { i32, i32 }, ptr [[THIS]], i32 0, i32 1 ; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[THIS]], align 8 ; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[BP]], align 4 @@ -37,7 +37,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@f ; TUNIT-SAME: () #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: [[R:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: call void @add(ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef, ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] +; TUNIT-NEXT: call void @add(ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef, ptr noalias nocapture nofree noundef nonnull sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) @@ -45,7 +45,7 @@ ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: [[R:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[PAIR:%.*]] = alloca { i32, i32 }, align 8 -; CGSCC-NEXT: call void @add(ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], ptr noalias nocapture nofree noundef nonnull writeonly sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: call void @add(ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[PAIR]], ptr noalias nocapture nofree noundef nonnull sret(i32) align 4 dereferenceable(4) [[R]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: ret void ; %r = alloca i32 @@ -57,7 +57,7 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(argmem: write) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) } Index: llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll @@ -25,7 +25,7 @@ define void @zed(ptr byval(%pair) %Data) { ; TUNIT-LABEL: define {{[^@]+}}@zed -; TUNIT-SAME: (ptr noalias nocapture nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; TUNIT-SAME: (ptr noalias nocapture nonnull byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[DATA]], align 1 ; TUNIT-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], ptr [[DATA]], i64 0, i32 1 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[DATA_0_1]], align 1 @@ -33,7 +33,7 @@ ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@zed -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readonly byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull byval([[PAIR:%.*]]) dereferenceable(8) [[DATA:%.*]]) { ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[DATA]], align 1 ; CGSCC-NEXT: [[DATA_0_1:%.*]] = getelementptr [[PAIR]], ptr [[DATA]], i64 0, i32 1 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[DATA_0_1]], align 1 Index: llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll =================================================================== --- llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll +++ llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll @@ -19,11 +19,19 @@ ; CHECK: @[[T45:[a-zA-Z0-9_$"\\.-]+]] = internal global [[STRUCT_TT0:%.*]] { i64 1335139741, i64 438042995 }, align 8 ;. define i32 @main(i32 %argc, ptr nocapture readnone %argv) #0 { -; CHECK-LABEL: define {{[^@]+}}@main -; CHECK-SAME: (i32 [[ARGC:%.*]], ptr nocapture nofree readnone [[ARGV:%.*]]) { -; CHECK-NEXT: entry: -; CHECK-NEXT: tail call void (ptr, ptr, ptr, ptr, ptr, ...) @callee_t0f(ptr undef, ptr undef, ptr undef, ptr undef, ptr undef, ptr noundef nonnull byval([[STRUCT_TT0:%.*]]) align 8 dereferenceable(16) @t45) -; CHECK-NEXT: ret i32 0 +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@main +; TUNIT-SAME: (i32 [[ARGC:%.*]], ptr nocapture nofree readnone [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: tail call void (ptr, ptr, ptr, ptr, ptr, ...) @callee_t0f(ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr noundef nonnull byval([[STRUCT_TT0:%.*]]) align 8 dereferenceable(16) @t45) +; TUNIT-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@main +; CGSCC-SAME: (i32 [[ARGC:%.*]], ptr nocapture nofree readnone [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: tail call void (ptr, ptr, ptr, ptr, ptr, ...) @callee_t0f(ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr readnone undef, ptr noundef nonnull readnone byval([[STRUCT_TT0:%.*]]) align 8 dereferenceable(16) @t45) +; CGSCC-NEXT: ret i32 0 ; entry: tail call void (ptr, ptr, ptr, ptr, ptr, ...) @callee_t0f(ptr undef, ptr undef, ptr undef, ptr undef, ptr undef, ptr byval(%struct.tt0) align 8 @t45) @@ -32,8 +40,9 @@ ; Function Attrs: nounwind uwtable define internal void @callee_t0f(ptr nocapture readnone %tp13, ptr nocapture readnone %tp14, ptr nocapture readnone %tp15, ptr nocapture readnone %tp16, ptr nocapture readnone %tp17, ...) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@callee_t0f -; CHECK-SAME: (ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP13:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP14:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP15:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP16:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP17:%.*]], ...) { +; CHECK-SAME: (ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP13:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP14:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP15:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP16:%.*]], ptr noalias nocapture nofree nonnull readnone align 4294967296 [[TP17:%.*]], ...) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @sink(i32 noundef 0) ; CHECK-NEXT: ret void @@ -44,6 +53,6 @@ } declare void @sink(i32) -;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: -; CGSCC: {{.*}} -; TUNIT: {{.*}} +;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) } +;. Index: llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll =================================================================== --- llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll +++ llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll @@ -69,7 +69,7 @@ define void @fn_no_null_opt(ptr %P, i1 %C) null_pointer_is_valid { ; -; TUNIT: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid +; TUNIT: Function Attrs: nofree norecurse nosync nounwind null_pointer_is_valid memory(read, argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@fn_no_null_opt ; TUNIT-SAME: (ptr nocapture nofree writeonly [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: entry: @@ -85,7 +85,7 @@ ; TUNIT: exit: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree nosync nounwind null_pointer_is_valid +; CGSCC: Function Attrs: nofree nosync nounwind null_pointer_is_valid memory(read, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@fn_no_null_opt ; CGSCC-SAME: (ptr nocapture nofree writeonly align 4 dereferenceable_or_null(4) [[P:%.*]], i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: entry: @@ -132,10 +132,10 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind memory(argmem: readwrite) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid } +; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind null_pointer_is_valid memory(read, argmem: readwrite) } ; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid memory(read, argmem: readwrite) } ;. Index: llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll =================================================================== --- llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll +++ llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll @@ -36,7 +36,7 @@ ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[P:%.*]] = alloca float, align 4 -; TUNIT-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, ptr noundef @.omp_outlined., ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, i64 undef) +; TUNIT-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, ptr noundef @.omp_outlined., ptr nocapture nofree nonnull align 4 dereferenceable(4) undef, ptr nocapture nofree nonnull align 4 dereferenceable(4) undef, i64 undef) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@foo @@ -47,7 +47,7 @@ ; CGSCC-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4 ; CGSCC-NEXT: store float 3.000000e+00, ptr [[P]], align 4 ; CGSCC-NEXT: store i32 7, ptr [[N_ADDR]], align 4 -; CGSCC-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, ptr noundef @.omp_outlined., ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) +; CGSCC-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 3, ptr noundef readonly @.omp_outlined., ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024) ; CGSCC-NEXT: ret void ; entry: @@ -61,8 +61,9 @@ } define internal void @.omp_outlined.(ptr noalias %.global_tid., ptr noalias %.bound_tid., ptr dereferenceable(4) %N, ptr dereferenceable(4) %p, i64 %q) { +; TUNIT: Function Attrs: memory(readwrite, argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@.omp_outlined. -; TUNIT-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { +; TUNIT-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 ; TUNIT-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 @@ -117,8 +118,9 @@ ; TUNIT: omp.precond.end: ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@.omp_outlined. -; CGSCC-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) { +; CGSCC-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]], i64 [[Q:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[Q_ADDR:%.*]] = alloca i64, align 8 ; CGSCC-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 @@ -259,6 +261,8 @@ !1 = !{i64 2, i64 -1, i64 -1, i1 true} !0 = !{!1} ;. +; CHECK: attributes #[[ATTR0:[0-9]+]] = { memory(readwrite, argmem: read) } +;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 2, i64 -1, i64 -1, i1 true} ;. Index: llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll =================================================================== --- llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll +++ llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll @@ -37,10 +37,10 @@ ; TUNIT-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 ; TUNIT-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 ; TUNIT-NEXT: [[THREAD:%.*]] = alloca i64, align 8 -; TUNIT-NEXT: [[CALL:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @foo, ptr noalias nocapture nofree readnone align 4294967296 undef) -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @bar, ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) undef) -; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @baz, ptr noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) -; TUNIT-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @buz, ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) +; TUNIT-NEXT: [[CALL:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @foo, ptr noalias nocapture nofree align 4294967296 undef) +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @bar, ptr nocapture nofree nonnull align 8 dereferenceable(8) undef) +; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @baz, ptr nocapture nofree noundef nonnull align 8 dereferenceable(1) [[ALLOC1]]) +; TUNIT-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @buz, ptr nofree noundef nonnull align 8 dereferenceable(1) "no-capture-maybe-returned" [[ALLOC2]]) ; TUNIT-NEXT: ret i32 0 ; ; CGSCC-LABEL: define {{[^@]+}}@main() { @@ -48,10 +48,10 @@ ; CGSCC-NEXT: [[ALLOC1:%.*]] = alloca i8, align 8 ; CGSCC-NEXT: [[ALLOC2:%.*]] = alloca i8, align 8 ; CGSCC-NEXT: [[THREAD:%.*]] = alloca i64, align 8 -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @foo, ptr noalias nocapture nofree noundef readnone align 4294967296 null) -; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @bar, ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) @GlobalVPtr) -; CGSCC-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @baz, ptr noalias nocapture nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC1]]) -; CGSCC-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(ptr noundef nonnull align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @buz, ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(1) [[ALLOC2]]) +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @pthread_create(ptr noalias noundef nonnull readnone align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @foo, ptr noalias nocapture nofree noundef align 4294967296 null) +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @pthread_create(ptr noalias noundef nonnull readnone align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @bar, ptr nofree noundef nonnull align 8 dereferenceable(8) @GlobalVPtr) +; CGSCC-NEXT: [[CALL2:%.*]] = call i32 @pthread_create(ptr noalias noundef nonnull readnone align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @baz, ptr nocapture nofree noundef nonnull align 8 dereferenceable(1) [[ALLOC1]]) +; CGSCC-NEXT: [[CALL3:%.*]] = call i32 @pthread_create(ptr noalias noundef nonnull readnone align 8 dereferenceable(8) [[THREAD]], ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull @buz, ptr nofree noundef nonnull align 8 dereferenceable(1) [[ALLOC2]]) ; CGSCC-NEXT: ret i32 0 ; entry: @@ -81,7 +81,7 @@ define internal ptr @bar(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@bar -; CHECK-SAME: (ptr noalias nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: ret ptr @GlobalVPtr ; @@ -92,7 +92,7 @@ define internal ptr @baz(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@baz -; CHECK-SAME: (ptr noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (ptr nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: ret ptr [[ARG]] ; @@ -103,7 +103,7 @@ define internal ptr @buz(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@buz -; CHECK-SAME: (ptr noalias nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (ptr nofree noundef nonnull readnone returned align 8 dereferenceable(1) "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: ret ptr [[ARG]] ; Index: llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll =================================================================== --- llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -72,7 +72,7 @@ ; TUNIT: RET: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@caller ; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 { ; CGSCC-NEXT: [[Q:%.*]] = alloca i32, align 4 @@ -120,11 +120,11 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(argmem: write) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(write) } ; CGSCC: attributes #[[ATTR3]] = { nounwind willreturn } ; CGSCC: attributes #[[ATTR4]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll =================================================================== --- llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll +++ llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll @@ -26,9 +26,9 @@ ; CHECK: @[[GSH:[a-zA-Z0-9_$"\\.-]+]] = dso_local global i32 0, align 4 ;. define internal i32 @callee(ptr %thread_local_ptr, ptr %shared_ptr) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@callee -; CHECK-SAME: (ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[THREAD_LOCAL_PTR:%.*]], ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[SHARED_PTR:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr @gtl, align 4 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @gsh, align 4 @@ -45,12 +45,12 @@ define dso_local void @caller() { ; TUNIT-LABEL: define {{[^@]+}}@caller() { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: call void @broker(ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) undef, ptr noundef nonnull @callee, ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) undef) +; TUNIT-NEXT: call void @broker(ptr nocapture nofree nonnull align 4 dereferenceable(4) undef, ptr noundef nonnull @callee, ptr nocapture nofree nonnull align 4 dereferenceable(4) undef) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@caller() { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: call void @broker(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) @gtl, ptr noundef nonnull @callee, ptr nofree noundef nonnull readonly align 4 dereferenceable(4) @gsh) +; CGSCC-NEXT: call void @broker(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) @gtl, ptr noalias noundef nonnull readnone @callee, ptr nofree noundef nonnull align 4 dereferenceable(4) @gsh) ; CGSCC-NEXT: ret void ; entry: @@ -63,7 +63,7 @@ !1 = !{i64 1, i64 0, i64 2, i1 false} !0 = !{!1} ;. -; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 1, i64 0, i64 2, i1 false} Index: llvm/test/Transforms/Attributor/align.ll =================================================================== --- llvm/test/Transforms/Attributor/align.ll +++ llvm/test/Transforms/Attributor/align.ll @@ -222,7 +222,7 @@ ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@test7 ; CGSCC-SAME: () #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) ptr @f1() #[[ATTR14:[0-9]+]] +; CGSCC-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) ptr @f1() #[[ATTR16:[0-9]+]] ; CGSCC-NEXT: ret ptr [[C]] ; %c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1) @@ -361,17 +361,17 @@ declare void @user_i32_ptr(ptr nocapture readnone) nounwind define internal void @test8(ptr %a, ptr %b, ptr %c) { -; TUNIT: Function Attrs: nounwind +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@test8 -; TUNIT-SAME: (ptr noalias nocapture readnone align 4 [[A:%.*]], ptr noalias nocapture readnone align 4 [[B:%.*]], ptr noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (ptr noalias nocapture readnone align 4 [[A:%.*]], ptr noalias nocapture readnone align 4 [[B:%.*]], ptr noalias nocapture readnone [[C:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone align 4 [[A]]) #[[ATTR2]] ; TUNIT-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone align 4 [[B]]) #[[ATTR2]] ; TUNIT-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone [[C]]) #[[ATTR2]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nounwind +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@test8 -; CGSCC-SAME: (ptr noalias nocapture readnone align 4 [[A:%.*]], ptr noalias nocapture readnone align 4 [[B:%.*]], ptr noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr noalias nocapture readnone align 4 [[A:%.*]], ptr noalias nocapture readnone align 4 [[B:%.*]], ptr noalias nocapture readnone [[C:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone align 4 [[A]]) #[[ATTR3]] ; CGSCC-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone align 4 [[B]]) #[[ATTR3]] ; CGSCC-NEXT: call void @user_i32_ptr(ptr noalias nocapture readnone [[C]]) #[[ATTR3]] @@ -403,14 +403,14 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define ptr @test10a(ptr align 32 %p) { -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test10a -; TUNIT-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 32 ; TUNIT-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[R:%.*]] = call align 32 ptr @test10a(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; TUNIT-NEXT: [[R:%.*]] = call align 32 ptr @test10a(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] ; TUNIT-NEXT: store i32 1, ptr [[R]], align 32 ; TUNIT-NEXT: [[G0:%.*]] = getelementptr i32, ptr [[P]], i32 8 ; TUNIT-NEXT: br label [[E:%.*]] @@ -422,14 +422,14 @@ ; TUNIT-NEXT: [[PHI:%.*]] = phi ptr [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] ; TUNIT-NEXT: ret ptr [[PHI]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test10a -; CGSCC-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 32 ; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R:%.*]] = call align 32 ptr @test10a(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; CGSCC-NEXT: [[R:%.*]] = call align 32 ptr @test10a(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR5]] ; CGSCC-NEXT: store i32 1, ptr [[R]], align 32 ; CGSCC-NEXT: [[G0:%.*]] = getelementptr i32, ptr [[P]], i32 8 ; CGSCC-NEXT: br label [[E:%.*]] @@ -465,14 +465,14 @@ ; FIXME: This will work with an upcoming patch (D66618 or similar) ; store i32 -1, i32* %g1, align 32 define ptr @test10b(ptr align 32 %p) { -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test10b -; TUNIT-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 32 ; TUNIT-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[R:%.*]] = call align 32 ptr @test10b(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]] +; TUNIT-NEXT: [[R:%.*]] = call align 32 ptr @test10b(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] ; TUNIT-NEXT: store i32 1, ptr [[R]], align 32 ; TUNIT-NEXT: [[G0:%.*]] = getelementptr i32, ptr [[P]], i32 8 ; TUNIT-NEXT: br label [[E:%.*]] @@ -484,14 +484,14 @@ ; TUNIT-NEXT: [[PHI:%.*]] = phi ptr [ [[G0]], [[T]] ], [ [[G1]], [[F]] ] ; TUNIT-NEXT: ret ptr [[PHI]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test10b -; CGSCC-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 32 ; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R:%.*]] = call align 32 ptr @test10b(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]] +; CGSCC-NEXT: [[R:%.*]] = call align 32 ptr @test10b(ptr nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR5]] ; CGSCC-NEXT: store i32 1, ptr [[R]], align 32 ; CGSCC-NEXT: [[G0:%.*]] = getelementptr i32, ptr [[P]], i32 8 ; CGSCC-NEXT: br label [[E:%.*]] @@ -524,13 +524,13 @@ define i64 @test11(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test11 -; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: [[RET:%.*]] = load i64, ptr [[P]], align 8 ; TUNIT-NEXT: ret i64 [[RET]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test11 -; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: [[RET:%.*]] = load i64, ptr [[P]], align 8 ; CGSCC-NEXT: ret i64 [[RET]] ; @@ -546,7 +546,7 @@ define i64 @test12-1(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test12-1 -; TUNIT-SAME: (ptr nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 ; TUNIT-NEXT: [[RET:%.*]] = load i64, ptr [[ARRAYIDX1]], align 16 @@ -554,7 +554,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test12-1 -; CGSCC-SAME: (ptr nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 ; CGSCC-NEXT: [[RET:%.*]] = load i64, ptr [[ARRAYIDX1]], align 16 @@ -570,13 +570,13 @@ define i64 @test12-2(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test12-2 -; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[RET:%.*]] = load i64, ptr [[P]], align 16 ; TUNIT-NEXT: ret i64 [[RET]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test12-2 -; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: [[RET:%.*]] = load i64, ptr [[P]], align 16 ; CGSCC-NEXT: ret i64 [[RET]] ; @@ -589,7 +589,7 @@ define void @test12-3(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@test12-3 -; TUNIT-SAME: (ptr nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { ; TUNIT-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 ; TUNIT-NEXT: store i64 0, ptr [[ARRAYIDX1]], align 16 @@ -597,7 +597,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@test12-3 -; CGSCC-SAME: (ptr nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { ; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 ; CGSCC-NEXT: store i64 0, ptr [[ARRAYIDX1]], align 16 @@ -613,13 +613,13 @@ define void @test12-4(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@test12-4 -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: store i64 0, ptr [[P]], align 16 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@test12-4 -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR7]] { ; CGSCC-NEXT: store i64 0, ptr [[P]], align 16 ; CGSCC-NEXT: ret void ; @@ -633,18 +633,18 @@ define void @test12-5(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@test12-5 -; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 -; TUNIT-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR6:[0-9]+]] +; TUNIT-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR7:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@test12-5 -; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1 ; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3 -; CGSCC-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR8:[0-9]+]] ; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* @@ -657,14 +657,14 @@ define void @test12-6(ptr align 4 %p) { ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@test12-6 -; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR7]] { -; TUNIT-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR6]] +; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8]] { +; TUNIT-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR7]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@test12-6 -; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8]] { -; CGSCC-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR7]] +; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR9]] { +; CGSCC-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR8]] ; CGSCC-NEXT: ret void ; %p-cast = bitcast i32* %p to i64* @@ -675,7 +675,7 @@ define void @test13(i1 %c, ptr align 32 %dst) #0 { ; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@test13 -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -688,7 +688,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@test13 -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -713,7 +713,7 @@ define void @test13-1(i1 %c, ptr align 32 %dst) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-1 -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -726,7 +726,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-1 -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -751,7 +751,7 @@ define void @test13-2(i1 %c, ptr align 32 %dst) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-2 -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -764,7 +764,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-2 -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR11]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -789,7 +789,7 @@ define void @test13-3(i1 %c, ptr align 32 %dst) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test13-3 -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; TUNIT: truebb: ; TUNIT-NEXT: br label [[END:%.*]] @@ -802,7 +802,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test13-3 -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR11]] { ; CGSCC-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]] ; CGSCC: truebb: ; CGSCC-NEXT: br label [[END:%.*]] @@ -828,13 +828,13 @@ define i64 @ptr2int(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ptr2int -; TUNIT-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; TUNIT-NEXT: [[P2I:%.*]] = ptrtoint ptr [[P]] to i64 ; TUNIT-NEXT: ret i64 [[P2I]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ptr2int -; CGSCC-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: [[P2I:%.*]] = ptrtoint ptr [[P]] to i64 ; CGSCC-NEXT: ret i64 [[P2I]] ; @@ -844,13 +844,13 @@ define ptr @int2ptr(i64 %i) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@int2ptr -; TUNIT-SAME: (i64 [[I:%.*]]) #[[ATTR10]] { +; TUNIT-SAME: (i64 [[I:%.*]]) #[[ATTR11]] { ; TUNIT-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to ptr ; TUNIT-NEXT: ret ptr [[I2P]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@int2ptr -; CGSCC-SAME: (i64 [[I:%.*]]) #[[ATTR11]] { +; CGSCC-SAME: (i64 [[I:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to ptr ; CGSCC-NEXT: ret ptr [[I2P]] ; @@ -862,13 +862,13 @@ define void @aligned_store(ptr %Value, ptr %Ptr) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@aligned_store -; TUNIT-SAME: (ptr nofree writeonly [[VALUE:%.*]], ptr nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (ptr nofree readnone [[VALUE:%.*]], ptr nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: store ptr [[VALUE]], ptr [[PTR]], align 32 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@aligned_store -; CGSCC-SAME: (ptr nofree writeonly [[VALUE:%.*]], ptr nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] { +; CGSCC-SAME: (ptr nofree readnone [[VALUE:%.*]], ptr nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR7]] { ; CGSCC-NEXT: store ptr [[VALUE]], ptr [[PTR]], align 32 ; CGSCC-NEXT: ret void ; @@ -892,13 +892,13 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@align_store_after_bc -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: store i8 0, ptr [[ARG]], align 2048 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@align_store_after_bc -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR7]] { ; CGSCC-NEXT: store i8 0, ptr [[ARG]], align 2048 ; CGSCC-NEXT: ret void ; @@ -913,13 +913,13 @@ define i32 @musttail_callee_1(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@musttail_callee_1 -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[V:%.*]] = load i32, ptr [[P]], align 32 ; TUNIT-NEXT: ret i32 [[V]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@musttail_callee_1 -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: [[V:%.*]] = load i32, ptr [[P]], align 32 ; CGSCC-NEXT: ret i32 [[V]] ; @@ -927,24 +927,24 @@ ret i32 %v } define i32 @musttail_caller_1(ptr %p) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@musttail_caller_1 -; TUNIT-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR12:[0-9]+]] { ; TUNIT-NEXT: [[C:%.*]] = load i1, ptr @cnd, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; TUNIT: mt: -; TUNIT-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree readonly [[P]]) #[[ATTR12:[0-9]+]] +; TUNIT-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree readonly [[P]]) #[[ATTR14:[0-9]+]] ; TUNIT-NEXT: ret i32 [[V]] ; TUNIT: exit: ; TUNIT-NEXT: ret i32 0 ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@musttail_caller_1 -; CGSCC-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR12:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree readonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { ; CGSCC-NEXT: [[C:%.*]] = load i1, ptr @cnd, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]] ; CGSCC: mt: -; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR14]] +; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR16]] ; CGSCC-NEXT: ret i32 [[V]] ; CGSCC: exit: ; CGSCC-NEXT: ret i32 0 @@ -959,32 +959,32 @@ } define ptr @checkAndAdvance(ptr align(16) %p) { -; TUNIT: Function Attrs: nounwind +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@checkAndAdvance -; TUNIT-SAME: (ptr noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (ptr noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR13:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[P]], align 16 ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] ; TUNIT: if.then: ; TUNIT-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P]], i64 4 -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @checkAndAdvance(ptr nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @checkAndAdvance(ptr nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: return: ; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[ADD_PTR]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] ; TUNIT-NEXT: call void @user_i32_ptr(ptr noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]] ; TUNIT-NEXT: ret ptr [[RETVAL_0]] ; -; CGSCC: Function Attrs: nounwind +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@checkAndAdvance -; CGSCC-SAME: (ptr noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR14:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[P]], align 16 ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] ; CGSCC: if.then: ; CGSCC-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P]], i64 4 -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @checkAndAdvance(ptr nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @checkAndAdvance(ptr nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR14]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: return: ; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[ADD_PTR]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ] @@ -1025,7 +1025,7 @@ define internal ptr @aligned_8_return(ptr %a, i1 %c1, i1 %c2) norecurse { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@aligned_8_return -; TUNIT-SAME: (ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR10]] { +; TUNIT-SAME: (ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR11]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca ptr, align 8 ; TUNIT-NEXT: br i1 [[C1]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -1042,7 +1042,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@aligned_8_return -; CGSCC-SAME: (ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR11]] { +; CGSCC-SAME: (ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca ptr, align 8 ; CGSCC-NEXT: br i1 [[C1]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -1075,14 +1075,14 @@ define ptr @aligned_8_return_caller(ptr align(16) %a, i1 %c1, i1 %c2) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@aligned_8_return_caller -; TUNIT-SAME: (ptr nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR10]] { -; TUNIT-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A]], i1 [[C1]], i1 [[C2]]) #[[ATTR12]] +; TUNIT-SAME: (ptr nofree readnone align 16 "no-capture-maybe-returned" [[A:%.*]], i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR11]] { +; TUNIT-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 "no-capture-maybe-returned" [[A]], i1 [[C1]], i1 [[C2]]) #[[ATTR14]] ; TUNIT-NEXT: ret ptr [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@aligned_8_return_caller -; CGSCC-SAME: (ptr nofree readnone align 16 [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR13:[0-9]+]] { -; CGSCC-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 [[A]], i1 noundef [[C1]], i1 [[C2]]) #[[ATTR14]] +; CGSCC-SAME: (ptr nofree readnone align 16 [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 [[A]], i1 noundef [[C1]], i1 [[C2]]) #[[ATTR16]] ; CGSCC-NEXT: ret ptr [[R]] ; %r = call i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2) @@ -1096,30 +1096,34 @@ ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; TUNIT: attributes #[[ATTR2]] = { nounwind } -; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR6]] = { nounwind willreturn } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nounwind willreturn } -; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } -; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR3]] = { nounwind memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind memory(write, argmem: readwrite) } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR7]] = { nounwind willreturn } +; TUNIT: attributes #[[ATTR8]] = { mustprogress nounwind willreturn } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR13]] = { nounwind memory(readwrite, argmem: read) } +; TUNIT: attributes #[[ATTR14]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR2]] = { noinline nounwind uwtable } ; CGSCC: attributes #[[ATTR3]] = { nounwind } -; CGSCC: attributes #[[ATTR4]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR8]] = { mustprogress nounwind willreturn } -; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR14]] = { willreturn } +; CGSCC: attributes #[[ATTR4]] = { nounwind memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR5]] = { nofree nosync nounwind memory(write, argmem: readwrite) } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR8]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR9]] = { mustprogress nounwind willreturn } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn memory(read, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR14]] = { nounwind memory(readwrite, argmem: read) } +; CGSCC: attributes #[[ATTR15]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR16]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/call-simplify-pointer-info.ll =================================================================== --- llvm/test/Transforms/Attributor/call-simplify-pointer-info.ll +++ llvm/test/Transforms/Attributor/call-simplify-pointer-info.ll @@ -77,8 +77,8 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@sum_two_same_loads ; CGSCC-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P:%.*]]) #[[ATTR2:[0-9]+]] { -; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_1(i8* nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR5:[0-9]+]] -; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_1(i8* nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR5]] +; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_1(i8* nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR4]] +; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_1(i8* nocapture nofree noundef nonnull readonly dereferenceable(1022) [[P]]) #[[ATTR4]] ; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]] ; CGSCC-NEXT: ret i8 [[Z]] ; @@ -183,8 +183,8 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@sum_two_different_loads ; CGSCC-SAME: (i8* nocapture nofree noundef nonnull readonly dereferenceable(972) [[P:%.*]], i8* nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_2(i8* nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR5]] -; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_2(i8* nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR5]] +; CGSCC-NEXT: [[X:%.*]] = call i8 @read_arg_2(i8* nocapture nofree noundef nonnull readonly dereferenceable(972) [[P]]) #[[ATTR4]] +; CGSCC-NEXT: [[Y:%.*]] = call i8 @read_arg_2(i8* nocapture nofree noundef nonnull readonly dereferenceable(971) [[Q]]) #[[ATTR4]] ; CGSCC-NEXT: [[Z:%.*]] = add nsw i8 [[X]], [[Y]] ; CGSCC-NEXT: ret i8 [[Z]] ; @@ -236,7 +236,7 @@ } define i8 @call_partially_simplifiable_2(i1 %cond) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@call_partially_simplifiable_2 ; TUNIT-SAME: (i1 [[COND:%.*]]) #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: entry: @@ -248,10 +248,10 @@ ; TUNIT-NEXT: store i8 3, i8* [[I53]], align 1 ; TUNIT-NEXT: [[I54:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 54 ; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[COND]], i8* [[I51]], i8* [[I52]] -; TUNIT-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(i8* nocapture nofree nonnull readonly dereferenceable(972) [[SEL]], i8* nocapture nofree noundef nonnull readonly dereferenceable(971) [[I53]]) #[[ATTR3]] +; TUNIT-NEXT: [[R:%.*]] = call i8 @sum_two_different_loads(i8* nocapture nofree nonnull readonly dereferenceable(972) [[SEL]], i8* nocapture nofree noundef nonnull readonly dereferenceable(971) [[I53]]) #[[ATTR4:[0-9]+]] ; TUNIT-NEXT: ret i8 [[R]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@call_partially_simplifiable_2 ; CGSCC-SAME: (i1 [[COND:%.*]]) #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: entry: @@ -285,13 +285,13 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } ; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn memory(argmem: read) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(read) } ; CGSCC: attributes #[[ATTR4]] = { willreturn } -; CGSCC: attributes #[[ATTR5]] = { willreturn memory(read) } ;. Index: llvm/test/Transforms/Attributor/callbacks.ll =================================================================== --- llvm/test/Transforms/Attributor/callbacks.ll +++ llvm/test/Transforms/Attributor/callbacks.ll @@ -22,7 +22,7 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: store i32 42, ptr [[B]], align 32 ; TUNIT-NEXT: store ptr [[B]], ptr [[C]], align 64 -; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t0_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr noundef @t0_callback_callee, ptr align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t0_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr noundef @t0_callback_callee, ptr align 256 [[A]], i64 undef, ptr nocapture nofree noundef nonnull align 64 dereferenceable(8) [[C]]) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t0_caller @@ -51,7 +51,7 @@ define internal void @t0_callback_callee(ptr %is_not_null, ptr %ptr, ptr %a, i64 %b, ptr %c) { ; ; TUNIT-LABEL: define {{[^@]+}}@t0_callback_callee -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -60,7 +60,7 @@ ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t0_callback_callee -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; CGSCC-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -95,7 +95,7 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: store i32 42, ptr [[B]], align 32 ; TUNIT-NEXT: store ptr [[B]], ptr [[C]], align 64 -; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t1_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t1_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t1_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t1_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr nocapture nofree noundef nonnull align 64 dereferenceable(8) [[C]]) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t1_caller @@ -125,7 +125,7 @@ ; ; TUNIT: Function Attrs: nosync ; TUNIT-LABEL: define {{[^@]+}}@t1_callback_callee -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -135,7 +135,7 @@ ; ; CGSCC: Function Attrs: nosync ; CGSCC-LABEL: define {{[^@]+}}@t1_callback_callee -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; CGSCC-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -168,7 +168,7 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: store i32 42, ptr [[B]], align 32 ; TUNIT-NEXT: store ptr [[B]], ptr [[C]], align 64 -; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t2_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t2_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t2_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t2_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr nocapture nofree noundef nonnull align 64 dereferenceable(8) [[C]]) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t2_caller @@ -199,7 +199,7 @@ define internal void @t2_callback_callee(ptr %is_not_null, ptr %ptr, ptr %a, i64 %b, ptr %c) { ; ; TUNIT-LABEL: define {{[^@]+}}@t2_callback_callee -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -208,7 +208,7 @@ ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t2_callback_callee -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; CGSCC-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -241,8 +241,8 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: store i32 42, ptr [[B]], align 32 ; TUNIT-NEXT: store ptr [[B]], ptr [[C]], align 64 -; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t3_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t3_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) -; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t3_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t3_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]]) +; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t3_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t3_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr nocapture nofree noundef nonnull align 64 dereferenceable(8) [[C]]) +; TUNIT-NEXT: call void (ptr, ptr, ptr, ...) @t3_callback_broker(ptr noalias nocapture noundef align 4294967296 null, ptr noalias nocapture noundef nonnull align 128 dereferenceable(4) [[PTR]], ptr nocapture noundef @t3_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr nocapture nofree noundef nonnull align 64 dereferenceable(8) [[C]]) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t3_caller @@ -275,7 +275,7 @@ define internal void @t3_callback_callee(ptr %is_not_null, ptr %ptr, ptr %a, i64 %b, ptr %c) { ; ; TUNIT-LABEL: define {{[^@]+}}@t3_callback_callee -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 @@ -284,7 +284,7 @@ ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@t3_callback_callee -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[IS_NOT_NULL:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[PTR:%.*]], ptr nocapture align 256 [[A:%.*]], i64 [[B:%.*]], ptr nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8 ; CGSCC-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4 Index: llvm/test/Transforms/Attributor/callgraph.ll =================================================================== --- llvm/test/Transforms/Attributor/callgraph.ll +++ llvm/test/Transforms/Attributor/callgraph.ll @@ -60,7 +60,7 @@ define void @func6() { ; CHECK-LABEL: @func6( -; CHECK-NEXT: call void @broker(ptr nocapture nofree noundef @func3) +; CHECK-NEXT: call void @broker(ptr noalias nocapture nofree noundef readnone @func3) ; CHECK-NEXT: ret void ; call void @broker(ptr @func3) Index: llvm/test/Transforms/Attributor/depgraph.ll =================================================================== --- llvm/test/Transforms/Attributor/depgraph.ll +++ llvm/test/Transforms/Attributor/depgraph.ll @@ -22,7 +22,7 @@ ; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP7:%.*]] ; CHECK: 4: ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 4 -; CHECK-NEXT: [[TMP6:%.*]] = call ptr @checkAndAdvance(ptr nofree nonnull readonly align 16 [[TMP5]]) #[[ATTR1:[0-9]+]] +; CHECK-NEXT: [[TMP6:%.*]] = call ptr @checkAndAdvance(ptr nofree nonnull readonly align 16 [[TMP5]]) #[[ATTR0]] ; CHECK-NEXT: br label [[TMP8:%.*]] ; CHECK: 7: ; CHECK-NEXT: br label [[TMP8]] @@ -80,16 +80,12 @@ ; GRAPH-NEXT: updates [AANoUnwind] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state nounwind ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state memory:argument -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument +; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state known[memory(readwrite)] assumed[memory(none, argmem: read)], arg(0) known[ModRef] assumed[Ref] +; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state known[memory(readwrite)] assumed[memory(none, argmem: read)], arg(0) known[ModRef] assumed[Ref] ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state memory:argument -; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state readonly +; GRAPH-NEXT: [AAMemoryLocation] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state known[memory(readwrite)] assumed[memory(none, argmem: read)], arg(0) known[ModRef] assumed[Ref] +; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state known[memory(readwrite)] assumed[memory(none, argmem: read)], arg(0) known[ModRef] assumed[Ref] ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %2 = load i32, ptr %0, align 4' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: @@ -97,9 +93,6 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' br i1 %3, label %4, label %7' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs: [@-1]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state readonly -; GRAPH-EMPTY: ; GRAPH-NEXT: [AAPotentialValues] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_ret: [@-1]} with state set-state(< { %5 = getelementptr inbounds i32, ptr %0, i64 4[3], %5 = getelementptr inbounds i32, ptr %0, i64 4[3], } >) ; GRAPH-NEXT: updates [AAPotentialValues] for CtxI ' %.0 = phi ptr [ %6, %4 ], [ %0, %7 ]' at position {flt:.0 [.0@-1]} with state set-state(< {ptr %0[3], %5 = getelementptr inbounds i32, ptr %0, i64 4[3], %5 = getelementptr inbounds i32, ptr %0, i64 4[3], } >) ; GRAPH-EMPTY: @@ -204,7 +197,6 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoCapture] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state assumed not-captured-maybe-returned ; GRAPH-NEXT: updates [AANoCapture] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state assumed not-captured-maybe-returned -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state readonly ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' %5 = getelementptr inbounds i32, ptr %0, i64 4' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: @@ -215,13 +207,6 @@ ; GRAPH-EMPTY: ; GRAPH-NEXT: [AAIsDead] for CtxI ' br label %8' at position {flt: [@-1]} with state assumed-live ; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state readonly -; GRAPH-EMPTY: -; GRAPH-NEXT: [AAMemoryBehavior] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state readonly -; GRAPH-NEXT: updates [AAMemoryBehavior] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state readonly -; GRAPH-NEXT: updates [AAMemoryLocation] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn:checkAndAdvance [checkAndAdvance@-1]} with state memory:argument -; GRAPH-EMPTY: ; GRAPH-NEXT: [AANoFree] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state nofree ; GRAPH-NEXT: updates [AANoFree] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state nofree ; GRAPH-EMPTY: @@ -258,11 +243,9 @@ ; DOT-DAG: Node[[Node11:0x[a-z0-9]+]] [shape=record,label="{[AANoUnwind] ; DOT-DAG: Node[[Node12:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryLocation] ; DOT-DAG: Node[[Node13:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryLocation] -; DOT-DAG: Node[[Node14:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] ; DOT-DAG: Node[[Node15:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] ; DOT-DAG: Node[[Node16:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] ; DOT-DAG: Node[[Node17:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] -; DOT-DAG: Node[[Node18:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] ; DOT-DAG: Node[[Node19:0x[a-z0-9]+]] [shape=record,label="{[AAPotentialValues] ; DOT-DAG: Node[[Node20:0x[a-z0-9]+]] [shape=record,label="{[AAPotentialValues] ; DOT-DAG: Node[[Node21:0x[a-z0-9]+]] [shape=record,label="{[AAReturnedValues] @@ -310,8 +293,6 @@ ; DOT-DAG: Node[[Node63:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] ; DOT-DAG: Node[[Node64:0x[a-z0-9]+]] [shape=record,label="{[AANoCapture] ; DOT-DAG: Node[[Node65:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead] -; DOT-DAG: Node[[Node66:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] -; DOT-DAG: Node[[Node67:0x[a-z0-9]+]] [shape=record,label="{[AAMemoryBehavior] ; DOT-DAG: Node[[Node68:0x[a-z0-9]+]] [shape=record,label="{[AANoFree] ; DOT-DAG: Node[[Node69:0x[a-z0-9]+]] [shape=record,label="{[AAPrivatizablePtr] ; DOT-DAG: Node[[Node70:0x[a-z0-9]+]] [shape=record,label="{[AAAssumptionInfo] @@ -321,40 +302,31 @@ ; DOT-DAG: Node[[Node74:0x[a-z0-9]+]] [shape=record,label="{[AADereferenceable] ; DOT-DAG: Node[[Node20]] -> Node[[Node19]]; -; DOT-DAG: Node[[Node67]] -> Node[[Node13]]; ; DOT-DAG: Node[[Node58]] -> Node[[Node58]]; ; DOT-DAG: Node[[Node13]] -> Node[[Node12]]; ; DOT-DAG: Node[[Node55]] -> Node[[Node56]]; ; DOT-DAG: Node[[Node68]] -> Node[[Node73]]; -; DOT-DAG: Node[[Node61]] -> Node[[Node66]]; ; DOT-DAG: Node[[Node21]] -> Node[[Node20]]; ; DOT-DAG: Node[[Node64]] -> Node[[Node61]]; -; DOT-DAG: Node[[Node14]] -> Node[[Node61]]; ; DOT-DAG: Node[[Node61]] -> Node[[Node64]]; ; DOT-DAG: Node[[Node12]] -> Node[[Node13]]; ; DOT-DAG: Node[[Node11]] -> Node[[Node61]]; ; DOT-DAG: Node[[Node58]] -> Node[[Node51]]; -; DOT-DAG: Node[[Node14]] -> Node[[Node18]]; ; DOT-DAG: Node[[Node22]] -> Node[[Node21]]; ; DOT-DAG: Node[[Node43]] -> Node[[Node68]]; ; DOT-DAG: Node[[Node19]] -> Node[[Node22]]; ; DOT-DAG: Node[[Node21]] -> Node[[Node51]]; -; DOT-DAG: Node[[Node14]] -> Node[[Node66]]; ; DOT-DAG: Node[[Node10]] -> Node[[Node11]]; ; DOT-DAG: Node[[Node41]] -> Node[[Node42]]; ; DOT-DAG: Node[[Node42]] -> Node[[Node41]]; ; DOT-DAG: Node[[Node11]] -> Node[[Node10]]; ; DOT-DAG: Node[[Node21]] -> Node[[Node61]]; -; DOT-DAG: Node[[Node67]] -> Node[[Node66]]; -; DOT-DAG: Node[[Node18]] -> Node[[Node14]]; ; DOT-DAG: Node[[Node58]] -> Node[[Node57]]; -; DOT-DAG: Node[[Node66]] -> Node[[Node67]]; ; DOT-DAG: Node[[Node21]] -> Node[[Node47]]; ; DOT-DAG: Node[[Node44]] -> Node[[Node43]]; ; DOT-DAG: Node[[Node43]] -> Node[[Node44]]; ;. ; CHECK: attributes #[[ATTR0]] = { nofree nosync nounwind memory(argmem: read) } -; CHECK: attributes #[[ATTR1]] = { nofree nosync nounwind } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; GRAPH: {{.*}} Index: llvm/test/Transforms/Attributor/dereferenceable-1.ll =================================================================== --- llvm/test/Transforms/Attributor/dereferenceable-1.ll +++ llvm/test/Transforms/Attributor/dereferenceable-1.ll @@ -207,7 +207,6 @@ ; CHECK-LABEL: define {{[^@]+}}@f7_1 ; CHECK-SAME: (ptr noundef nonnull align 4 dereferenceable(4) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(ptr noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] -; CHECK-NEXT: [[PTR_0:%.*]] = load i32, ptr [[PTR]], align 4 ; CHECK-NEXT: [[B:%.*]] = tail call i32 @unkown_f(ptr noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] ; CHECK-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CHECK: if.true: @@ -239,7 +238,6 @@ ; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: [[PTR:%.*]] = tail call nonnull align 4 dereferenceable(4) ptr @unkown_ptr() #[[ATTR1]] ; CHECK-NEXT: [[A:%.*]] = tail call i32 @unkown_f(ptr noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] -; CHECK-NEXT: [[ARG_A_0:%.*]] = load i32, ptr [[PTR]], align 4 ; CHECK-NEXT: [[B:%.*]] = tail call i32 @unkown_f(ptr noundef nonnull align 4 dereferenceable(4) [[PTR]]) #[[ATTR1]] ; CHECK-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CHECK: if.true: @@ -446,8 +444,8 @@ ; TUNIT-SAME: (ptr nocapture nofree writeonly [[P:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[RANGE:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i64, ptr [[RANGE]], align 8, !range [[RNG0:![0-9]+]] -; TUNIT-NEXT: tail call void @fill_range_inbounds(ptr nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7:[0-9]+]] -; TUNIT-NEXT: tail call void @fill_range_not_inbounds(ptr nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @fill_range_inbounds(ptr nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR8:[0-9]+]] +; TUNIT-NEXT: tail call void @fill_range_not_inbounds(ptr nocapture nofree writeonly [[P]], i64 [[TMP0]]) #[[ATTR9:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) @@ -633,59 +631,32 @@ ; } ; FIXME: %ptr should be dereferenceable(4) define dso_local void @rec-branch-2(i32 %a, i32 %b, i32 %c, ptr %ptr) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) -; TUNIT-LABEL: define {{[^@]+}}@rec-branch-2 -; TUNIT-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], ptr nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { -; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; TUNIT: if.then: -; TUNIT-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; TUNIT-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; TUNIT: if.then2: -; TUNIT-NEXT: store i32 1, ptr [[PTR]], align 4 -; TUNIT-NEXT: br label [[IF_END8:%.*]] -; TUNIT: if.else: -; TUNIT-NEXT: store i32 2, ptr [[PTR]], align 4 -; TUNIT-NEXT: br label [[IF_END8]] -; TUNIT: if.else3: -; TUNIT-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; TUNIT-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; TUNIT: if.then5: -; TUNIT-NEXT: store i32 3, ptr [[PTR]], align 4 -; TUNIT-NEXT: br label [[IF_END8]] -; TUNIT: if.else6: -; TUNIT-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, ptr nocapture nofree writeonly [[PTR]]) #[[ATTR8:[0-9]+]] -; TUNIT-NEXT: br label [[IF_END8]] -; TUNIT: if.end8: -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) -; CGSCC-LABEL: define {{[^@]+}}@rec-branch-2 -; CGSCC-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], ptr nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { -; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 -; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] -; CGSCC: if.then: -; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 -; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] -; CGSCC: if.then2: -; CGSCC-NEXT: store i32 1, ptr [[PTR]], align 4 -; CGSCC-NEXT: br label [[IF_END8:%.*]] -; CGSCC: if.else: -; CGSCC-NEXT: store i32 2, ptr [[PTR]], align 4 -; CGSCC-NEXT: br label [[IF_END8]] -; CGSCC: if.else3: -; CGSCC-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 -; CGSCC-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] -; CGSCC: if.then5: -; CGSCC-NEXT: store i32 3, ptr [[PTR]], align 4 -; CGSCC-NEXT: br label [[IF_END8]] -; CGSCC: if.else6: -; CGSCC-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, ptr nocapture nofree writeonly [[PTR]]) #[[ATTR7:[0-9]+]] -; CGSCC-NEXT: br label [[IF_END8]] -; CGSCC: if.end8: -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: nofree nosync nounwind memory(argmem: write) +; CHECK-LABEL: define {{[^@]+}}@rec-branch-2 +; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]], ptr nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[A]], 0 +; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_ELSE3:%.*]], label [[IF_THEN:%.*]] +; CHECK: if.then: +; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[B]], 0 +; CHECK-NEXT: br i1 [[TOBOOL1]], label [[IF_ELSE:%.*]], label [[IF_THEN2:%.*]] +; CHECK: if.then2: +; CHECK-NEXT: store i32 1, ptr [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8:%.*]] +; CHECK: if.else: +; CHECK-NEXT: store i32 2, ptr [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else3: +; CHECK-NEXT: [[TOBOOL4:%.*]] = icmp eq i32 [[C]], 0 +; CHECK-NEXT: br i1 [[TOBOOL4]], label [[IF_ELSE6:%.*]], label [[IF_THEN5:%.*]] +; CHECK: if.then5: +; CHECK-NEXT: store i32 3, ptr [[PTR]], align 4 +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.else6: +; CHECK-NEXT: tail call void @rec-branch-2(i32 noundef 1, i32 noundef 1, i32 noundef 1, ptr nocapture nofree writeonly [[PTR]]) #[[ATTR5]] +; CHECK-NEXT: br label [[IF_END8]] +; CHECK: if.end8: +; CHECK-NEXT: ret void ; entry: %tobool = icmp eq i32 %a, 0 @@ -727,14 +698,16 @@ ; ATTRIBUTOR-NEXT: call void @unknown() ; ATTRIBUTOR-NEXT: ret void ; +; TUNIT: Function Attrs: memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@nonnull_assume_pos -; TUNIT-SAME: (ptr nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], ptr nocapture nofree nonnull readnone [[ARG3:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR9:[0-9]+]] [ "nonnull"(ptr [[ARG3]]), "dereferenceable"(ptr [[ARG1]], i64 1), "dereferenceable"(ptr [[ARG1]], i64 2), "dereferenceable"(ptr [[ARG1]], i64 101), "dereferenceable_or_null"(ptr [[ARG2]], i64 31), "dereferenceable_or_null"(ptr [[ARG4]], i64 42) ] +; TUNIT-SAME: (ptr nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], ptr nocapture nofree nonnull readnone [[ARG3:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR10:[0-9]+]] [ "nonnull"(ptr [[ARG3]]), "dereferenceable"(ptr [[ARG1]], i64 1), "dereferenceable"(ptr [[ARG1]], i64 2), "dereferenceable"(ptr [[ARG1]], i64 101), "dereferenceable_or_null"(ptr [[ARG2]], i64 31), "dereferenceable_or_null"(ptr [[ARG4]], i64 42) ] ; TUNIT-NEXT: call void @unknown() ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@nonnull_assume_pos -; CGSCC-SAME: (ptr nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], ptr nocapture nofree nonnull readnone [[ARG3:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree nonnull readnone dereferenceable(101) [[ARG1:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(31) [[ARG2:%.*]], ptr nocapture nofree nonnull readnone [[ARG3:%.*]], ptr nocapture nofree readnone dereferenceable_or_null(42) [[ARG4:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] [ "nonnull"(ptr [[ARG3]]), "dereferenceable"(ptr [[ARG1]], i64 1), "dereferenceable"(ptr [[ARG1]], i64 2), "dereferenceable"(ptr [[ARG1]], i64 101), "dereferenceable_or_null"(ptr [[ARG2]], i64 31), "dereferenceable_or_null"(ptr [[ARG4]], i64 42) ] ; CGSCC-NEXT: call void @unknown() ; CGSCC-NEXT: ret void @@ -750,8 +723,9 @@ ; ATTRIBUTOR-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr undef, i64 101), "dereferenceable"(ptr undef, i64 -2), "dereferenceable_or_null"(ptr undef, i64 31) ] ; ATTRIBUTOR-NEXT: ret void ; +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_neg -; CHECK-SAME: (ptr nocapture nofree readnone [[ARG1:%.*]], ptr nocapture nofree readnone [[ARG2:%.*]], ptr nocapture nofree readnone [[ARG3:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree readnone [[ARG1:%.*]], ptr nocapture nofree readnone [[ARG2:%.*]], ptr nocapture nofree readnone [[ARG3:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: call void @unknown() ; CHECK-NEXT: call void @llvm.assume(i1 noundef true) [ "dereferenceable"(ptr [[ARG1]], i64 101), "dereferenceable"(ptr [[ARG2]], i64 -2), "dereferenceable_or_null"(ptr [[ARG3]], i64 31) ] ; CHECK-NEXT: ret void @@ -782,18 +756,18 @@ ; TUNIT-LABEL: define {{[^@]+}}@nonnull_assume_call ; TUNIT-SAME: (ptr [[ARG1:%.*]], ptr [[ARG2:%.*]], ptr [[ARG3:%.*]], ptr [[ARG4:%.*]]) { ; TUNIT-NEXT: call void @unknown() -; TUNIT-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) ptr @unkown_ptr() #[[ATTR10:[0-9]+]] -; TUNIT-NEXT: call void @unknown_use32(ptr nonnull dereferenceable(101) [[P]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(42) [[ARG4]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr nonnull [[ARG3]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(31) [[ARG2]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr nonnull dereferenceable(2) [[ARG1]]) #[[ATTR10]] +; TUNIT-NEXT: [[P:%.*]] = call nonnull dereferenceable(101) ptr @unkown_ptr() #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: call void @unknown_use32(ptr nonnull dereferenceable(101) [[P]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(42) [[ARG4]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr nonnull [[ARG3]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(31) [[ARG2]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr nonnull dereferenceable(2) [[ARG1]]) #[[ATTR11]] ; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(ptr [[ARG3]]), "dereferenceable"(ptr [[ARG1]], i64 1), "dereferenceable"(ptr [[ARG1]], i64 2), "dereferenceable"(ptr [[P]], i64 101), "dereferenceable_or_null"(ptr [[ARG2]], i64 31), "dereferenceable_or_null"(ptr [[ARG4]], i64 42) ] -; TUNIT-NEXT: call void @unknown_use8(ptr nonnull dereferenceable(2) [[ARG1]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(31) [[ARG2]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr nonnull [[ARG3]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(42) [[ARG4]]) #[[ATTR10]] -; TUNIT-NEXT: call void @unknown_use32(ptr nonnull dereferenceable(101) [[P]]) #[[ATTR10]] +; TUNIT-NEXT: call void @unknown_use8(ptr nonnull dereferenceable(2) [[ARG1]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(31) [[ARG2]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr nonnull [[ARG3]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use8(ptr dereferenceable_or_null(42) [[ARG4]]) #[[ATTR11]] +; TUNIT-NEXT: call void @unknown_use32(ptr nonnull dereferenceable(101) [[P]]) #[[ATTR11]] ; TUNIT-NEXT: call void @unknown() ; TUNIT-NEXT: ret void ; @@ -870,11 +844,12 @@ ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind memory(argmem: write) } -; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR8]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR9]] = { willreturn } -; TUNIT: attributes #[[ATTR10]] = { nounwind } +; TUNIT: attributes #[[ATTR6]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR9]] = { nofree nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR10]] = { willreturn } +; TUNIT: attributes #[[ATTR11]] = { nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR1]] = { nounwind willreturn } @@ -882,8 +857,8 @@ ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR5]] = { nofree nosync nounwind memory(argmem: write) } -; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR6]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR8]] = { willreturn } ; CGSCC: attributes #[[ATTR9]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll =================================================================== --- llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll +++ llvm/test/Transforms/Attributor/dereferenceable-2-inseltpoison.ll @@ -246,8 +246,9 @@ declare void @may_not_return() define void @not_guaranteed_to_transfer_execution(ptr %ptr) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@not_guaranteed_to_transfer_execution -; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: call void @may_not_return() ; CHECK-NEXT: ret void ; @@ -437,7 +438,7 @@ define void @stores(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@stores -; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, ptr [[ARG]], i64 1 ; CHECK-NEXT: store float 1.000000e+00, ptr [[ARG]], align 4 ; CHECK-NEXT: store float 2.000000e+00, ptr [[ARRAYIDX1]], align 4 @@ -453,7 +454,7 @@ define void @load_store(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@load_store -; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, ptr [[ARG]], i64 1 ; CHECK-NEXT: store float 2.000000e+00, ptr [[ARRAYIDX1]], align 4 ; CHECK-NEXT: ret void @@ -468,7 +469,7 @@ define void @different_size1(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@different_size1 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: store double 0.000000e+00, ptr [[ARG]], align 8 ; CHECK-NEXT: store i32 0, ptr [[ARG]], align 8 ; CHECK-NEXT: ret void @@ -482,7 +483,7 @@ define void @different_size2(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@different_size2 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: store i32 0, ptr [[ARG]], align 8 ; CHECK-NEXT: store double 0.000000e+00, ptr [[ARG]], align 8 ; CHECK-NEXT: ret void @@ -513,7 +514,7 @@ define i32 @require_cfg_analysis(i32 %c, ptr %p) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@require_cfg_analysis -; CHECK-SAME: (i32 [[C:%.*]], ptr nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (i32 [[C:%.*]], ptr nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 ; CHECK-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] ; CHECK: l1: @@ -567,7 +568,8 @@ ; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CHECK: attributes #[[ATTR4]] = { memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/dereferenceable-2.ll =================================================================== --- llvm/test/Transforms/Attributor/dereferenceable-2.ll +++ llvm/test/Transforms/Attributor/dereferenceable-2.ll @@ -246,8 +246,9 @@ declare void @may_not_return() define void @not_guaranteed_to_transfer_execution(ptr %ptr) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@not_guaranteed_to_transfer_execution -; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree nonnull readnone align 2 dereferenceable(2) [[PTR:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: call void @may_not_return() ; CHECK-NEXT: ret void ; @@ -437,7 +438,7 @@ define void @stores(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@stores -; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, ptr [[ARG]], i64 1 ; CHECK-NEXT: store float 1.000000e+00, ptr [[ARG]], align 4 ; CHECK-NEXT: store float 2.000000e+00, ptr [[ARRAYIDX1]], align 4 @@ -453,7 +454,7 @@ define void @load_store(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@load_store -; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree nonnull writeonly align 4 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: [[ARRAYIDX1:%.*]] = getelementptr float, ptr [[ARG]], i64 1 ; CHECK-NEXT: store float 2.000000e+00, ptr [[ARRAYIDX1]], align 4 ; CHECK-NEXT: ret void @@ -468,7 +469,7 @@ define void @different_size1(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@different_size1 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: store double 0.000000e+00, ptr [[ARG]], align 8 ; CHECK-NEXT: store i32 0, ptr [[ARG]], align 8 ; CHECK-NEXT: ret void @@ -482,7 +483,7 @@ define void @different_size2(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@different_size2 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[ARG:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: store i32 0, ptr [[ARG]], align 8 ; CHECK-NEXT: store double 0.000000e+00, ptr [[ARG]], align 8 ; CHECK-NEXT: ret void @@ -513,7 +514,7 @@ define i32 @require_cfg_analysis(i32 %c, ptr %p) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@require_cfg_analysis -; CHECK-SAME: (i32 [[C:%.*]], ptr nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; CHECK-SAME: (i32 [[C:%.*]], ptr nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { ; CHECK-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C]], 0 ; CHECK-NEXT: br i1 [[TOBOOL1]], label [[L1:%.*]], label [[L2:%.*]] ; CHECK: l1: @@ -567,7 +568,8 @@ ; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CHECK: attributes #[[ATTR4]] = { memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/heap_to_stack.ll =================================================================== --- llvm/test/Transforms/Attributor/heap_to_stack.ll +++ llvm/test/Transforms/Attributor/heap_to_stack.ll @@ -33,8 +33,9 @@ ; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal global ptr undef, align 4 ;. define void @h2s_value_simplify_interaction(i1 %c, ptr %A) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@h2s_value_simplify_interaction -; CHECK-SAME: (i1 [[C:%.*]], ptr nocapture nofree readnone [[A:%.*]]) { +; CHECK-SAME: (i1 [[C:%.*]], ptr nocapture nofree readnone [[A:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[ADD:%.*]] = add i64 2, 2 ; CHECK-NEXT: [[M:%.*]] = tail call noalias align 16 ptr @malloc(i64 noundef [[ADD]]) @@ -46,13 +47,13 @@ ; CHECK: f2: ; CHECK-NEXT: [[L:%.*]] = load i8, ptr [[M]], align 16 ; CHECK-NEXT: call void @usei8(i8 [[L]]) -; CHECK-NEXT: call void @no_sync_func(ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1) [[M]]) #[[ATTR11:[0-9]+]] +; CHECK-NEXT: call void @no_sync_func(ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1) [[M]]) #[[ATTR13:[0-9]+]] ; CHECK-NEXT: br label [[J]] ; CHECK: dead: ; CHECK-NEXT: unreachable ; CHECK: j: ; CHECK-NEXT: [[PHI:%.*]] = phi ptr [ [[M]], [[F]] ], [ null, [[F2]] ] -; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree noundef align 16 [[PHI]]) #[[ATTR11]] +; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree noundef align 16 [[PHI]]) #[[ATTR13]] ; CHECK-NEXT: ret void ; entry: @@ -359,7 +360,7 @@ ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I]]) ; CHECK-NEXT: store i32 10, ptr [[I]], align 4 -; CHECK-NEXT: tail call void @foo_nounw(ptr nofree nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; CHECK-NEXT: tail call void @foo_nounw(ptr nofree nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR13]] ; CHECK-NEXT: tail call void @free(ptr nocapture nonnull align 4 dereferenceable(4) [[I]]) ; CHECK-NEXT: ret void ; @@ -419,7 +420,7 @@ ; CHECK-LABEL: define {{[^@]+}}@test11() { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1 -; CHECK-NEXT: tail call void @sync_will_return(ptr [[I_H2S]]) #[[ATTR11]] +; CHECK-NEXT: tail call void @sync_will_return(ptr [[I_H2S]]) #[[ATTR13]] ; CHECK-NEXT: ret void ; bb: @@ -629,8 +630,9 @@ } define void @test16a(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@test16a -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree readnone [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree readnone [[P:%.*]]) #[[ATTR7]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1 ; CHECK-NEXT: store i8 [[V]], ptr [[I_H2S]], align 1 @@ -646,8 +648,9 @@ } define void @test16b(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16b -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr [[P]], align 8 @@ -664,12 +667,13 @@ } define void @test16c(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16c -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR10]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1 ; CHECK-NEXT: store ptr [[I_H2S]], ptr [[P]], align 8 -; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I_H2S]]) #[[ATTR11]] +; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I_H2S]]) #[[ATTR13]] ; CHECK-NEXT: ret void ; bb: @@ -681,8 +685,9 @@ } define void @test16d(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16d -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR10]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr [[P]], align 8 @@ -698,11 +703,11 @@ define void @test16e(i8 %v) norecurse { ; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@test16e -; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR11:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1 ; CHECK-NEXT: store ptr [[I_H2S]], ptr @G, align 8 -; CHECK-NEXT: call void @usei8p(ptr nocapture nofree [[I_H2S]]) #[[ATTR12:[0-9]+]] +; CHECK-NEXT: call void @usei8p(ptr nocapture nofree [[I_H2S]]) #[[ATTR14:[0-9]+]] ; CHECK-NEXT: ret void ; bb: @@ -722,12 +727,14 @@ ; CHECK: attributes #[[ATTR4]] = { noreturn } ; CHECK: attributes #[[ATTR5:[0-9]+]] = { allockind("free") } ; CHECK: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR7:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) } -; CHECK: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) } -; CHECK: attributes #[[ATTR9]] = { norecurse } -; CHECK: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; CHECK: attributes #[[ATTR11]] = { nounwind } -; CHECK: attributes #[[ATTR12]] = { nocallback nosync nounwind willreturn } +; CHECK: attributes #[[ATTR7]] = { memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,uninitialized,aligned") allocsize(1) } +; CHECK: attributes #[[ATTR9:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) } +; CHECK: attributes #[[ATTR10]] = { memory(readwrite, argmem: write) } +; CHECK: attributes #[[ATTR11]] = { norecurse } +; CHECK: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; CHECK: attributes #[[ATTR13]] = { nounwind } +; CHECK: attributes #[[ATTR14]] = { nocallback nosync nounwind willreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll =================================================================== --- llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll +++ llvm/test/Transforms/Attributor/heap_to_stack_gpu.ll @@ -305,7 +305,7 @@ ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I]]) ; CHECK-NEXT: store i32 10, ptr [[I]], align 4 -; CHECK-NEXT: tail call void @foo_nounw(ptr nofree nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR6:[0-9]+]] +; CHECK-NEXT: tail call void @foo_nounw(ptr nofree nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8:[0-9]+]] ; CHECK-NEXT: tail call void @free(ptr nocapture nonnull align 4 dereferenceable(4) [[I]]) ; CHECK-NEXT: ret void ; @@ -367,7 +367,7 @@ ; CHECK-LABEL: define {{[^@]+}}@test11() { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) -; CHECK-NEXT: tail call void @sync_will_return(ptr [[I]]) #[[ATTR6]] +; CHECK-NEXT: tail call void @sync_will_return(ptr [[I]]) #[[ATTR8]] ; CHECK-NEXT: tail call void @free(ptr nocapture [[I]]) ; CHECK-NEXT: ret void ; @@ -579,8 +579,9 @@ } define void @test16a(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@test16a -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree readnone [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree readnone [[P:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store i8 [[V]], ptr [[I]], align 1 @@ -597,8 +598,9 @@ } define void @test16b(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16b -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr [[P]], align 8 @@ -615,12 +617,13 @@ } define void @test16c(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16c -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR6]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr [[P]], align 8 -; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I]]) #[[ATTR6]] +; CHECK-NEXT: tail call void @no_sync_func(ptr nocapture nofree [[I]]) #[[ATTR8]] ; CHECK-NEXT: tail call void @free(ptr nocapture [[I]]) ; CHECK-NEXT: ret void ; @@ -633,8 +636,9 @@ } define void @test16d(i8 %v, ptr %P) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test16d -; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (i8 [[V:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR6]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr [[P]], align 8 @@ -654,7 +658,7 @@ ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1, addrspace(5) ; CHECK-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[I_H2S]] to ptr -; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR7:[0-9]+]] +; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR9:[0-9]+]] ; CHECK-NEXT: ret void ; bb: @@ -668,7 +672,7 @@ ; CHECK-LABEL: define {{[^@]+}}@test17b() { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @__kmpc_alloc_shared(i64 noundef 4) -; CHECK-NEXT: tail call void @usei8(ptr nofree [[I]]) #[[ATTR7]] +; CHECK-NEXT: tail call void @usei8(ptr nofree [[I]]) #[[ATTR9]] ; CHECK-NEXT: tail call void @__kmpc_free_shared(ptr nocapture [[I]], i64 noundef 4) ; CHECK-NEXT: ret void ; @@ -686,7 +690,7 @@ ; CHECK-NEXT: br label [[NOT_ENTRY:%.*]] ; CHECK: not_entry: ; CHECK-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[I_H2S]] to ptr -; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR7]] +; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR9]] ; CHECK-NEXT: ret void ; entry: @@ -703,11 +707,11 @@ define void @test16e(i8 %v) norecurse { ; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@test16e -; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = tail call noalias ptr @__kmpc_alloc_shared(i64 noundef 4) ; CHECK-NEXT: store ptr [[I]], ptr @G, align 8 -; CHECK-NEXT: call void @usei8(ptr nocapture nofree [[I]]) #[[ATTR8:[0-9]+]] +; CHECK-NEXT: call void @usei8(ptr nocapture nofree [[I]]) #[[ATTR10:[0-9]+]] ; CHECK-NEXT: tail call void @__kmpc_free_shared(ptr noalias nocapture [[I]], i64 noundef 4) ; CHECK-NEXT: ret void ; @@ -724,12 +728,12 @@ define void @test16f(i8 %v) norecurse { ; CHECK: Function Attrs: norecurse ; CHECK-LABEL: define {{[^@]+}}@test16f -; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR5]] { +; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR7]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 4, align 1, addrspace(5) ; CHECK-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[I_H2S]] to ptr ; CHECK-NEXT: store ptr [[MALLOC_CAST]], ptr @Gtl, align 8 -; CHECK-NEXT: call void @usei8(ptr nocapture nofree [[MALLOC_CAST]]) #[[ATTR8]] +; CHECK-NEXT: call void @usei8(ptr nocapture nofree [[MALLOC_CAST]]) #[[ATTR10]] ; CHECK-NEXT: ret void ; bb: @@ -746,7 +750,7 @@ ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I_H2S:%.*]] = alloca i8, i64 256, align 1, addrspace(5) ; CHECK-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[I_H2S]] to ptr -; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR7]] +; CHECK-NEXT: tail call void @usei8(ptr noalias nocapture nofree [[MALLOC_CAST]]) #[[ATTR9]] ; CHECK-NEXT: ret void ; bb: @@ -763,10 +767,12 @@ ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nofree nounwind } ; CHECK: attributes #[[ATTR3]] = { noreturn } ; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR5]] = { norecurse } -; CHECK: attributes #[[ATTR6]] = { nounwind } -; CHECK: attributes #[[ATTR7]] = { nosync nounwind willreturn } -; CHECK: attributes #[[ATTR8]] = { nocallback nosync nounwind willreturn } +; CHECK: attributes #[[ATTR5]] = { memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR6]] = { memory(readwrite, argmem: write) } +; CHECK: attributes #[[ATTR7]] = { norecurse } +; CHECK: attributes #[[ATTR8]] = { nounwind } +; CHECK: attributes #[[ATTR9]] = { nosync nounwind willreturn } +; CHECK: attributes #[[ATTR10]] = { nocallback nosync nounwind willreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/internal-noalias.ll =================================================================== --- llvm/test/Transforms/Attributor/internal-noalias.ll +++ llvm/test/Transforms/Attributor/internal-noalias.ll @@ -7,8 +7,8 @@ ; TUNIT-LABEL: define {{[^@]+}}@visible ; TUNIT-SAME: (ptr noalias nocapture nofree readonly [[A:%.*]], ptr noalias nocapture nofree readonly [[B:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(ptr noalias nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR4:[0-9]+]] -; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr noalias nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(ptr noalias nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3:[0-9]+]] +; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr noalias nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree readonly align 4 [[B]]) #[[ATTR3]] ; TUNIT-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] ; TUNIT-NEXT: ret i32 [[ADD]] ; @@ -36,7 +36,7 @@ ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4 ; TUNIT-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; TUNIT-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] ; TUNIT-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] ; TUNIT-NEXT: ret i32 [[ADD2]] ; @@ -47,7 +47,7 @@ ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4 ; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]] -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) ; CGSCC-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]] ; CGSCC-NEXT: ret i32 [[ADD2]] ; @@ -88,20 +88,20 @@ } define dso_local i32 @visible_local(ptr %A) #0 { -; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable +; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable ; TUNIT-LABEL: define {{[^@]+}}@visible_local -; TUNIT-SAME: (ptr nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[A:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[B:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store i32 5, ptr [[B]], align 4 -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(ptr nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] -; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(ptr nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree readonly align 4 [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR3]] ; TUNIT-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]] ; TUNIT-NEXT: ret i32 [[ADD]] ; -; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(argmem: readwrite) uwtable +; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(argmem: read) uwtable ; CGSCC-LABEL: define {{[^@]+}}@visible_local -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 5, ptr [[B]], align 4 @@ -141,14 +141,14 @@ define i32 @visible_local_2() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@visible_local_2 -; TUNIT-SAME: () #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: [[B:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: ret i32 10 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@visible_local_2 -; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 noundef 5, i32 noundef 5) #[[ATTR6:[0-9]+]] +; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 noundef 5, i32 noundef 5) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: ret i32 [[CALL]] ; %B = alloca i32, align 4 @@ -160,12 +160,12 @@ define internal i32 @noalias_args_argmem_rn(ptr %A, ptr %B) #1 { ; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable ; TUNIT-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: ret i32 undef ; ; CGSCC: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CGSCC-LABEL: define {{[^@]+}}@noalias_args_argmem_rn -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: [[T0:%.*]] = load i32, ptr [[B]], align 4 ; CGSCC-NEXT: store i32 0, ptr [[B]], align 4 ; CGSCC-NEXT: ret i32 [[T0]] @@ -178,17 +178,17 @@ define i32 @visible_local_3() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@visible_local_3 -; TUNIT-SAME: () #[[ATTR2]] { +; TUNIT-SAME: () #[[ATTR1]] { ; TUNIT-NEXT: [[B:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] ; TUNIT-NEXT: ret i32 5 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@visible_local_3 -; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-SAME: () #[[ATTR2]] { ; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 5, ptr [[B]], align 4 -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR5:[0-9]+]] ; CGSCC-NEXT: ret i32 [[CALL]] ; %B = alloca i32, align 4 @@ -201,20 +201,18 @@ attributes #1 = { argmemonly noinline nounwind uwtable willreturn} ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } -; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } +; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind memory(argmem: read) } ; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline nosync nounwind willreturn memory(argmem: read) uwtable } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree noinline nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; CGSCC: attributes #[[ATTR5]] = { memory(read) } -; CGSCC: attributes #[[ATTR6]] = { willreturn } -; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } +; CGSCC: attributes #[[ATTR4]] = { willreturn } +; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CHECK: {{.*}} Index: llvm/test/Transforms/Attributor/liveness.ll =================================================================== --- llvm/test/Transforms/Attributor/liveness.ll +++ llvm/test/Transforms/Attributor/liveness.ll @@ -96,18 +96,31 @@ ; TEST 1: Only first block is live. define i32 @first_block_no_return(i32 %a, i32* nonnull %ptr1, i32* %ptr2) #0 { -; CHECK: Function Attrs: nofree noreturn nosync nounwind -; CHECK-LABEL: define {{[^@]+}}@first_block_no_return -; CHECK-SAME: (i32 [[A:%.*]], i32* nocapture nofree nonnull readnone [[PTR1:%.*]], i32* nocapture nofree readnone [[PTR2:%.*]]) #[[ATTR0:[0-9]+]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: call void @no_return_call() #[[ATTR3:[0-9]+]] -; CHECK-NEXT: unreachable -; CHECK: cond.true: -; CHECK-NEXT: unreachable -; CHECK: cond.false: -; CHECK-NEXT: unreachable -; CHECK: cond.end: -; CHECK-NEXT: unreachable +; TUNIT: Function Attrs: nofree noreturn nosync nounwind memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@first_block_no_return +; TUNIT-SAME: (i32 [[A:%.*]], i32* nocapture nofree nonnull readnone [[PTR1:%.*]], i32* nocapture nofree readnone [[PTR2:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: call void @no_return_call() #[[ATTR3:[0-9]+]] +; TUNIT-NEXT: unreachable +; TUNIT: cond.true: +; TUNIT-NEXT: unreachable +; TUNIT: cond.false: +; TUNIT-NEXT: unreachable +; TUNIT: cond.end: +; TUNIT-NEXT: unreachable +; +; CGSCC: Function Attrs: nofree noreturn nosync nounwind memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@first_block_no_return +; CGSCC-SAME: (i32 [[A:%.*]], i32* nocapture nofree nonnull readnone [[PTR1:%.*]], i32* nocapture nofree readnone [[PTR2:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: call void @no_return_call() #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: unreachable +; CGSCC: cond.true: +; CGSCC-NEXT: unreachable +; CGSCC: cond.false: +; CGSCC-NEXT: unreachable +; CGSCC: cond.end: +; CGSCC-NEXT: unreachable ; entry: call i32 @internal_load(i32* %ptr1) @@ -145,7 +158,7 @@ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[A]], 0 ; CHECK-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CHECK: cond.true: -; CHECK-NEXT: call void @no_return_call() #[[ATTR3]] +; CHECK-NEXT: call void @no_return_call() #[[ATTR3:[0-9]+]] ; CHECK-NEXT: unreachable ; CHECK: cond.false: ; CHECK-NEXT: call void @normal_call() @@ -500,7 +513,7 @@ define void @ub(i32* %0) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@ub -; TUNIT-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: [[POISON:%.*]] = sub nuw i32 0, 1 ; TUNIT-NEXT: [[STILL_POISON:%.*]] = and i32 [[POISON]], 0 ; TUNIT-NEXT: [[POISON_YET_AGAIN:%.*]] = getelementptr i32, i32* [[TMP0]], i32 [[STILL_POISON]] @@ -509,7 +522,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@ub -; CGSCC-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (i32* nocapture nofree writeonly [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: [[POISON:%.*]] = sub nuw i32 0, 1 ; CGSCC-NEXT: [[STILL_POISON:%.*]] = and i32 [[POISON]], 0 ; CGSCC-NEXT: [[POISON_YET_AGAIN:%.*]] = getelementptr i32, i32* [[TMP0]], i32 [[STILL_POISON]] @@ -526,7 +539,7 @@ define void @inf_loop() #0 { ; TUNIT: Function Attrs: nofree norecurse noreturn nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@inf_loop -; TUNIT-SAME: () #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[WHILE_BODY:%.*]] ; TUNIT: while.body: @@ -534,7 +547,7 @@ ; ; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@inf_loop -; CGSCC-SAME: () #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[WHILE_BODY:%.*]] ; CGSCC: while.body: @@ -590,13 +603,13 @@ define void @rec() #0 { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@rec -; TUNIT-SAME: () #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR10:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@rec -; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: ret void ; @@ -794,15 +807,15 @@ define void @test_unreachable() { ; TUNIT: Function Attrs: nofree noreturn nosync nounwind ; TUNIT-LABEL: define {{[^@]+}}@test_unreachable -; TUNIT-SAME: () #[[ATTR0]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14:[0-9]+]] +; TUNIT-SAME: () #[[ATTR0:[0-9]+]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16:[0-9]+]] ; TUNIT-NEXT: call void @test_unreachable() #[[ATTR0]] ; TUNIT-NEXT: unreachable ; ; CGSCC: Function Attrs: nofree noreturn nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@test_unreachable -; CGSCC-SAME: () #[[ATTR0]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16:[0-9]+]] +; CGSCC-SAME: () #[[ATTR0:[0-9]+]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18:[0-9]+]] ; CGSCC-NEXT: call void @test_unreachable() #[[ATTR0]] ; CGSCC-NEXT: unreachable ; @@ -854,28 +867,28 @@ define internal void @middle() { ; TUNIT-LABEL: define {{[^@]+}}@middle() { ; TUNIT-NEXT: bb0: -; TUNIT-NEXT: call void @non_dead_b0() #[[ATTR10:[0-9]+]] -; TUNIT-NEXT: call void @non_dead_b1() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b2() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b3() #[[ATTR10]] +; TUNIT-NEXT: call void @non_dead_b0() #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: call void @non_dead_b1() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b2() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b3() #[[ATTR11]] ; TUNIT-NEXT: br label [[BB1:%.*]] ; TUNIT: bb1: -; TUNIT-NEXT: call void @non_dead_b4() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b5() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b6() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b7() #[[ATTR10]] +; TUNIT-NEXT: call void @non_dead_b4() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b5() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b6() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b7() #[[ATTR11]] ; TUNIT-NEXT: br label [[BB2:%.*]] ; TUNIT: bb2: -; TUNIT-NEXT: call void @non_dead_b8() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b9() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b10() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b11() #[[ATTR10]] +; TUNIT-NEXT: call void @non_dead_b8() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b9() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b10() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b11() #[[ATTR11]] ; TUNIT-NEXT: br label [[BB3:%.*]] ; TUNIT: bb3: -; TUNIT-NEXT: call void @non_dead_b12() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b13() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b14() #[[ATTR10]] -; TUNIT-NEXT: call void @non_dead_b15() #[[ATTR10]] +; TUNIT-NEXT: call void @non_dead_b12() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b13() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b14() #[[ATTR11]] +; TUNIT-NEXT: call void @non_dead_b15() #[[ATTR11]] ; TUNIT-NEXT: br label [[BB4:%.*]] ; TUNIT: bb4: ; TUNIT-NEXT: call void @non_exact2() @@ -883,28 +896,28 @@ ; ; CGSCC-LABEL: define {{[^@]+}}@middle() { ; CGSCC-NEXT: bb0: -; CGSCC-NEXT: call void @non_dead_b0() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b1() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b2() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b3() #[[ATTR16]] +; CGSCC-NEXT: call void @non_dead_b0() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b1() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b2() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b3() #[[ATTR18]] ; CGSCC-NEXT: br label [[BB1:%.*]] ; CGSCC: bb1: -; CGSCC-NEXT: call void @non_dead_b4() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b5() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b6() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b7() #[[ATTR16]] +; CGSCC-NEXT: call void @non_dead_b4() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b5() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b6() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b7() #[[ATTR18]] ; CGSCC-NEXT: br label [[BB2:%.*]] ; CGSCC: bb2: -; CGSCC-NEXT: call void @non_dead_b8() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b9() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b10() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b11() #[[ATTR16]] +; CGSCC-NEXT: call void @non_dead_b8() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b9() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b10() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b11() #[[ATTR18]] ; CGSCC-NEXT: br label [[BB3:%.*]] ; CGSCC: bb3: -; CGSCC-NEXT: call void @non_dead_b12() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b13() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b14() #[[ATTR16]] -; CGSCC-NEXT: call void @non_dead_b15() #[[ATTR16]] +; CGSCC-NEXT: call void @non_dead_b12() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b13() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b14() #[[ATTR18]] +; CGSCC-NEXT: call void @non_dead_b15() #[[ATTR18]] ; CGSCC-NEXT: br label [[BB4:%.*]] ; CGSCC: bb4: ; CGSCC-NEXT: call void @non_exact2() @@ -1023,14 +1036,14 @@ define internal void @non_dead_a0() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a0 -; TUNIT-SAME: () #[[ATTR11:[0-9]+]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12:[0-9]+]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a0 -; CGSCC-SAME: () #[[ATTR13:[0-9]+]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14:[0-9]+]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1039,14 +1052,14 @@ define internal void @non_dead_a1() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a1 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a1 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1055,14 +1068,14 @@ define internal void @non_dead_a2() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a2 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a2 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1071,14 +1084,14 @@ define internal void @non_dead_a3() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a3 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a3 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1087,14 +1100,14 @@ define internal void @non_dead_a4() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a4 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a4 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1103,14 +1116,14 @@ define internal void @non_dead_a5() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a5 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a5 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1119,14 +1132,14 @@ define internal void @non_dead_a6() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a6 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a6 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1135,14 +1148,14 @@ define internal void @non_dead_a7() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a7 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a7 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1151,14 +1164,14 @@ define internal void @non_dead_a8() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a8 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a8 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1167,14 +1180,14 @@ define internal void @non_dead_a9() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a9 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a9 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1183,14 +1196,14 @@ define internal void @non_dead_a10() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a10 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a10 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1199,14 +1212,14 @@ define internal void @non_dead_a11() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a11 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a11 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1215,14 +1228,14 @@ define internal void @non_dead_a12() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a12 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a12 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1231,14 +1244,14 @@ define internal void @non_dead_a13() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a13 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a13 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1247,14 +1260,14 @@ define internal void @non_dead_a14() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a14 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a14 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1263,14 +1276,14 @@ define internal void @non_dead_a15() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_a15 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_a15 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1279,14 +1292,14 @@ define internal void @non_dead_b0() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b0 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b0 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1295,14 +1308,14 @@ define internal void @non_dead_b1() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b1 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b1 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1311,14 +1324,14 @@ define internal void @non_dead_b2() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b2 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b2 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1327,14 +1340,14 @@ define internal void @non_dead_b3() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b3 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b3 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1343,14 +1356,14 @@ define internal void @non_dead_b4() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b4 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b4 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1359,14 +1372,14 @@ define internal void @non_dead_b5() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b5 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b5 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1375,14 +1388,14 @@ define internal void @non_dead_b6() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b6 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b6 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1391,14 +1404,14 @@ define internal void @non_dead_b7() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b7 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b7 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1407,14 +1420,14 @@ define internal void @non_dead_b8() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b8 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b8 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1423,14 +1436,14 @@ define internal void @non_dead_b9() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b9 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b9 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1439,14 +1452,14 @@ define internal void @non_dead_b10() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b10 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b10 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1455,14 +1468,14 @@ define internal void @non_dead_b11() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b11 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b11 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1471,14 +1484,14 @@ define internal void @non_dead_b12() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b12 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b12 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1487,14 +1500,14 @@ define internal void @non_dead_b13() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b13 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b13 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1503,14 +1516,14 @@ define internal void @non_dead_b14() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b14 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b14 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1519,14 +1532,14 @@ define internal void @non_dead_b15() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_b15 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_b15 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1535,14 +1548,14 @@ define internal void @non_dead_c0() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c0 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c0 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1551,14 +1564,14 @@ define internal void @non_dead_c1() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c1 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c1 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1567,14 +1580,14 @@ define internal void @non_dead_c2() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c2 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c2 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1583,14 +1596,14 @@ define internal void @non_dead_c3() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c3 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c3 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1599,14 +1612,14 @@ define internal void @non_dead_c4() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c4 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c4 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1615,14 +1628,14 @@ define internal void @non_dead_c5() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c5 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c5 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1631,14 +1644,14 @@ define internal void @non_dead_c6() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c6 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c6 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1647,14 +1660,14 @@ define internal void @non_dead_c7() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c7 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c7 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1663,14 +1676,14 @@ define internal void @non_dead_c8() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c8 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c8 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1679,14 +1692,14 @@ define internal void @non_dead_c9() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c9 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c9 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1695,14 +1708,14 @@ define internal void @non_dead_c10() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c10 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c10 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1711,14 +1724,14 @@ define internal void @non_dead_c11() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c11 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c11 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1727,14 +1740,14 @@ define internal void @non_dead_c12() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c12 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c12 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1743,14 +1756,14 @@ define internal void @non_dead_c13() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c13 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c13 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1759,14 +1772,14 @@ define internal void @non_dead_c14() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c14 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c14 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1775,14 +1788,14 @@ define internal void @non_dead_c15() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_c15 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_c15 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1791,14 +1804,14 @@ define internal void @non_dead_d0() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d0 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d0 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1807,14 +1820,14 @@ define internal void @non_dead_d1() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d1 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d1 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1823,14 +1836,14 @@ define internal void @non_dead_d2() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d2 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d2 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1839,14 +1852,14 @@ define internal void @non_dead_d3() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d3 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d3 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1855,14 +1868,14 @@ define internal void @non_dead_d4() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d4 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d4 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1871,14 +1884,14 @@ define internal void @non_dead_d5() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d5 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d5 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1887,14 +1900,14 @@ define internal void @non_dead_d6() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d6 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d6 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1903,14 +1916,14 @@ define internal void @non_dead_d7() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d7 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d7 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1919,14 +1932,14 @@ define internal void @non_dead_d8() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d8 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d8 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1935,14 +1948,14 @@ define internal void @non_dead_d9() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d9 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d9 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1951,14 +1964,14 @@ define internal void @non_dead_d10() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d10 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d10 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1967,14 +1980,14 @@ define internal void @non_dead_d11() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d11 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d11 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1983,14 +1996,14 @@ define internal void @non_dead_d12() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d12 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d12 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -1999,14 +2012,14 @@ define internal void @non_dead_d13() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d13 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d13 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -2015,14 +2028,14 @@ define internal void @non_dead_d14() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d14 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d14 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -2031,14 +2044,14 @@ define internal void @non_dead_d15() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@non_dead_d15 -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@non_dead_d15 -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -2101,16 +2114,16 @@ } define internal void @useless_arg_sink(i32* %a) { -; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@useless_arg_sink -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-SAME: () #[[ATTR13:[0-9]+]] { +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@useless_arg_sink -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @sink() @@ -2118,16 +2131,16 @@ } define internal void @useless_arg_almost_sink(i32* %a) { -; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: call void @useless_arg_sink() #[[ATTR10]] +; TUNIT-SAME: () #[[ATTR13]] { +; TUNIT-NEXT: call void @useless_arg_sink() #[[ATTR11]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@useless_arg_almost_sink -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: call void @useless_arg_sink() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR15]] { +; CGSCC-NEXT: call void @useless_arg_sink() #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @useless_arg_sink(i32* %a) @@ -2170,28 +2183,28 @@ define internal i32 @switch_default(i64 %i) nounwind { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@switch_default -; TUNIT-SAME: () #[[ATTR11]] { +; TUNIT-SAME: () #[[ATTR12]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ ; TUNIT-NEXT: i64 3, label [[RETURN:%.*]] ; TUNIT-NEXT: i64 10, label [[RETURN]] ; TUNIT-NEXT: ] ; TUNIT: sw.default: -; TUNIT-NEXT: call void @sink() #[[ATTR14]] +; TUNIT-NEXT: call void @sink() #[[ATTR16]] ; TUNIT-NEXT: ret i32 undef ; TUNIT: return: ; TUNIT-NEXT: unreachable ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@switch_default -; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-SAME: () #[[ATTR14]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ ; CGSCC-NEXT: i64 3, label [[RETURN:%.*]] ; CGSCC-NEXT: i64 10, label [[RETURN]] ; CGSCC-NEXT: ] ; CGSCC: sw.default: -; CGSCC-NEXT: call void @sink() #[[ATTR16]] +; CGSCC-NEXT: call void @sink() #[[ATTR18]] ; CGSCC-NEXT: ret i32 123 ; CGSCC: return: ; CGSCC-NEXT: unreachable @@ -2213,14 +2226,14 @@ define i32 @switch_default_caller() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@switch_default_caller -; TUNIT-SAME: () #[[ATTR11]] { -; TUNIT-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR10]] +; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default() #[[ATTR11]] ; TUNIT-NEXT: ret i32 123 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@switch_default_caller -; CGSCC-SAME: () #[[ATTR13]] { -; CGSCC-NEXT: [[CALL2:%.*]] = tail call noundef i32 @switch_default() #[[ATTR16]] +; CGSCC-SAME: () #[[ATTR14]] { +; CGSCC-NEXT: [[CALL2:%.*]] = tail call noundef i32 @switch_default() #[[ATTR18]] ; CGSCC-NEXT: ret i32 [[CALL2]] ; %call2 = tail call i32 @switch_default(i64 0) @@ -2257,13 +2270,13 @@ define i32 @switch_default_dead_caller() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@switch_default_dead_caller -; TUNIT-SAME: () #[[ATTR12:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR14:[0-9]+]] { ; TUNIT-NEXT: ret i32 123 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@switch_default_dead_caller -; CGSCC-SAME: () #[[ATTR11]] { -; CGSCC-NEXT: [[CALL2:%.*]] = tail call noundef i32 @switch_default_dead() #[[ATTR17:[0-9]+]] +; CGSCC-SAME: () #[[ATTR12]] { +; CGSCC-NEXT: [[CALL2:%.*]] = tail call noundef i32 @switch_default_dead() #[[ATTR19:[0-9]+]] ; CGSCC-NEXT: ret i32 [[CALL2]] ; %call2 = tail call i32 @switch_default_dead(i64 0) @@ -2272,7 +2285,7 @@ define void @call_via_pointer_with_dead_args(i32* %a, i32* %b, void (i32*, i32*, i32*, i64, i32**)* %fp) { ; CHECK-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args -; CHECK-SAME: (i32* [[A:%.*]], i32* [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull [[FP:%.*]]) { +; CHECK-SAME: (i32* [[A:%.*]], i32* [[B:%.*]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull readnone [[FP:%.*]]) { ; CHECK-NEXT: call void [[FP]](i32* [[A]], i32* [[B]], i32* [[A]], i64 -1, i32** null) ; CHECK-NEXT: ret void ; @@ -2310,8 +2323,8 @@ ; TUNIT-NEXT: [[PTR2:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: [[PTR3:%.*]] = alloca i32, align 128 ; TUNIT-NEXT: [[PTR4:%.*]] = alloca i32, align 128 -; TUNIT-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer) -; TUNIT-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef @called_via_pointer_internal_1) +; TUNIT-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* noalias nocapture nofree noundef readnone @called_via_pointer) +; TUNIT-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* noalias nocapture nofree noundef readnone @called_via_pointer_internal_1) ; TUNIT-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]]) ; TUNIT-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]]) ; TUNIT-NEXT: ret void @@ -2322,8 +2335,8 @@ ; CGSCC-NEXT: [[PTR2:%.*]] = alloca i32, align 128 ; CGSCC-NEXT: [[PTR3:%.*]] = alloca i32, align 128 ; CGSCC-NEXT: [[PTR4:%.*]] = alloca i32, align 128 -; CGSCC-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer) -; CGSCC-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* nocapture nofree noundef nonnull @called_via_pointer_internal_1) +; CGSCC-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR1]], void (i32*, i32*, i32*, i64, i32**)* noalias nocapture nofree noundef nonnull readnone @called_via_pointer) +; CGSCC-NEXT: call void @call_via_pointer_with_dead_args(i32* [[A]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR2]], void (i32*, i32*, i32*, i64, i32**)* noalias nocapture nofree noundef nonnull readnone @called_via_pointer_internal_1) ; CGSCC-NEXT: call void @call_via_pointer_with_dead_args_internal_a(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR3]]) ; CGSCC-NEXT: call void @call_via_pointer_with_dead_args_internal_b(i32* [[B]], i32* noundef nonnull align 128 dereferenceable(4) [[PTR4]]) ; CGSCC-NEXT: ret void @@ -2391,7 +2404,7 @@ define internal void @dead_with_blockaddress_users(i32* nocapture %pc) nounwind readonly { ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@dead_with_blockaddress_users -; CGSCC-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-SAME: (i32* nocapture [[PC:%.*]]) #[[ATTR16:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[INDIRECTGOTO:%.*]] ; CGSCC: lab0: @@ -2446,7 +2459,7 @@ ; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[G_0]], 1 ; CHECK-NEXT: br label [[FOR_COND_0]] ; CHECK: for.end.0: -; CHECK-NEXT: [[CALL:%.*]] = call i8* @malloc(i64 noundef 8) +; CHECK-NEXT: [[CALL:%.*]] = call noalias i8* @malloc(i64 noundef 8) ; CHECK-NEXT: store i8* [[CALL]], i8** bitcast (%struct.a** @e to i8**), align 8 ; CHECK-NEXT: [[B:%.*]] = bitcast i8* [[CALL]] to %struct.a** ; CHECK-NEXT: store %struct.a* null, %struct.a** [[B]], align 8 @@ -2501,7 +2514,7 @@ define i32 @h(i32 %i) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@h -; TUNIT-SAME: (i32 [[I:%.*]]) #[[ATTR12]] { +; TUNIT-SAME: (i32 [[I:%.*]]) #[[ATTR14]] { ; TUNIT-NEXT: ret i32 0 ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) @@ -2520,11 +2533,11 @@ define void @bad_gep() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@bad_gep -; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-SAME: () #[[ATTR14]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[N:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: [[M:%.*]] = alloca i8, align 1 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15:[0-9]+]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR17:[0-9]+]] ; TUNIT-NEXT: br label [[EXIT:%.*]] ; TUNIT: while.body: ; TUNIT-NEXT: unreachable @@ -2533,7 +2546,7 @@ ; TUNIT: if.end: ; TUNIT-NEXT: unreachable ; TUNIT: exit: -; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR15]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR17]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) @@ -2542,7 +2555,7 @@ ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[N:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: [[M:%.*]] = alloca i8, align 1 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR17]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR19]] ; CGSCC-NEXT: br label [[EXIT:%.*]] ; CGSCC: while.body: ; CGSCC-NEXT: unreachable @@ -2551,7 +2564,7 @@ ; CGSCC: if.end: ; CGSCC-NEXT: unreachable ; CGSCC: exit: -; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR17]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1, i8* noalias nocapture nofree noundef nonnull dereferenceable(1) [[N]]) #[[ATTR19]] ; CGSCC-NEXT: ret void ; entry: @@ -2582,7 +2595,7 @@ define i8 @edge_vs_block_liveness() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@edge_vs_block_liveness -; TUNIT-SAME: () #[[ATTR12]] { +; TUNIT-SAME: () #[[ATTR14]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br i1 true, label [[B1:%.*]], label [[B2:%.*]] ; TUNIT: b1: @@ -2624,15 +2637,17 @@ ; TUNIT: attributes #[[ATTR4]] = { noreturn } ; TUNIT: attributes #[[ATTR5]] = { nosync memory(none) } ; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR8]] = { nofree norecurse noreturn nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR13:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR14]] = { nounwind willreturn } -; TUNIT: attributes #[[ATTR15]] = { willreturn } +; TUNIT: attributes #[[ATTR7]] = { nofree noreturn nosync nounwind memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR9]] = { nofree norecurse noreturn nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR16]] = { nounwind willreturn } +; TUNIT: attributes #[[ATTR17]] = { willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { nofree noreturn nosync nounwind } ; CGSCC: attributes #[[ATTR1:[0-9]+]] = { memory(none) } @@ -2643,13 +2658,15 @@ ; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable } ; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable } -; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR10]] = { nofree norecurse noreturn nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR12:[0-9]+]] = { nofree nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR14]] = { nounwind memory(read) } -; CGSCC: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR16]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR17]] = { willreturn } +; CGSCC: attributes #[[ATTR9]] = { nofree noreturn nosync nounwind memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR11]] = { nofree norecurse noreturn nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR13:[0-9]+]] = { nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR15]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR16]] = { nounwind memory(read) } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR18]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR19]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/memory_locations.ll =================================================================== --- llvm/test/Transforms/Attributor/memory_locations.ll +++ llvm/test/Transforms/Attributor/memory_locations.ll @@ -120,8 +120,9 @@ define dso_local ptr @internal_only_rec_static_helper_malloc_noescape(i32 %arg) { ; FIXME: This is actually inaccessiblememonly because the malloced memory does not escape +; CHECK: Function Attrs: memory(write, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_helper_malloc_noescape -; CHECK-SAME: (i32 [[ARG:%.*]]) { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec_static_malloc_noescape(i32 [[ARG]]) ; CHECK-NEXT: ret ptr [[CALL]] @@ -133,8 +134,9 @@ define internal ptr @internal_only_rec_static_malloc_noescape(i32 %arg) { ; FIXME: This is actually inaccessiblememonly because the malloced memory does not escape +; CHECK: Function Attrs: memory(write, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_malloc_noescape -; CHECK-SAME: (i32 [[ARG:%.*]]) { +; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1 @@ -173,9 +175,9 @@ } define dso_local ptr @internal_argmem_only_read(ptr %arg) { -; CHECK: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) +; CHECK: Function Attrs: memory(argmem: read, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_read -; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 4 ; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP]] to i64 @@ -190,9 +192,9 @@ } define dso_local ptr @internal_argmem_only_write(ptr %arg) { -; CHECK: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) +; CHECK: Function Attrs: memory(argmem: write, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_write -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i32 10, ptr [[ARG]], align 4 ; CHECK-NEXT: [[CALL:%.*]] = call noalias dereferenceable_or_null(10) ptr @malloc(i64 noundef 10) @@ -207,14 +209,14 @@ define dso_local ptr @internal_argmem_only_rec(ptr %arg) { ; TUNIT: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; TUNIT-SAME: (ptr nocapture nofree [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @internal_argmem_only_rec_1(ptr nocapture nofree align 4 [[ARG]]) ; TUNIT-NEXT: ret ptr [[CALL]] ; ; CGSCC: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@internal_argmem_only_rec -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @internal_argmem_only_rec_1(ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]]) ; CGSCC-NEXT: ret ptr [[CALL]] @@ -227,7 +229,7 @@ define internal ptr @internal_argmem_only_rec_1(ptr %arg) { ; CHECK: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_rec_1 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 4 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP]], 0 @@ -283,11 +285,11 @@ define internal ptr @internal_argmem_only_rec_2(ptr %arg) { ; CHECK: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@internal_argmem_only_rec_2 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR4]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store i32 0, ptr [[ARG]], align 4 ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 -1 -; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_argmem_only_rec_1(ptr nocapture nofree nonnull align 4 dereferenceable(4) [[ADD_PTR]]) +; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_argmem_only_rec_1(ptr nocapture nofree nonnull align 4 dereferenceable(4) [[ADD_PTR]]) #[[ATTR4]] ; CHECK-NEXT: ret ptr [[CALL]] ; entry: @@ -305,7 +307,7 @@ define void @callerA1(ptr %arg) { ; CHECK: Function Attrs: memory(argmem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@callerA1 -; CHECK-SAME: (ptr [[ARG:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (ptr [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @argmem_only(ptr [[ARG]]) ; CHECK-NEXT: ret void ; @@ -315,7 +317,7 @@ define void @callerA2(ptr %arg) { ; CHECK: Function Attrs: memory(argmem: readwrite, inaccessiblemem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@callerA2 -; CHECK-SAME: (ptr [[ARG:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr [[ARG:%.*]]) #[[ATTR4]] { ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @inaccesible_argmem_only_decl(ptr [[ARG]]) ; CHECK-NEXT: ret void ; @@ -325,7 +327,7 @@ define void @callerB1() { ; CHECK: Function Attrs: memory(none) ; CHECK-LABEL: define {{[^@]+}}@callerB1 -; CHECK-SAME: () #[[ATTR2:[0-9]+]] { +; CHECK-SAME: () #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: [[STACK:%.*]] = alloca i8, align 1 ; CHECK-NEXT: [[TMP1:%.*]] = call ptr @argmem_only(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; CHECK-NEXT: ret void @@ -367,7 +369,9 @@ ret void } define void @callerD1() { -; CHECK-LABEL: define {{[^@]+}}@callerD1() { +; CHECK: Function Attrs: memory(write) +; CHECK-LABEL: define {{[^@]+}}@callerD1 +; CHECK-SAME: () #[[ATTR8:[0-9]+]] { ; CHECK-NEXT: [[UNKNOWN:%.*]] = call ptr @argmem_only(ptr noalias nocapture noundef align 4294967296 null) ; CHECK-NEXT: store i8 0, ptr [[UNKNOWN]], align 1 ; CHECK-NEXT: ret void @@ -377,7 +381,9 @@ ret void } define void @callerD2() { -; CHECK-LABEL: define {{[^@]+}}@callerD2() { +; CHECK: Function Attrs: memory(write, inaccessiblemem: readwrite) +; CHECK-LABEL: define {{[^@]+}}@callerD2 +; CHECK-SAME: () #[[ATTR1]] { ; CHECK-NEXT: [[UNKNOWN:%.*]] = call ptr @inaccesible_argmem_only_decl(ptr noalias nocapture noundef align 4294967296 null) ; CHECK-NEXT: store i8 0, ptr [[UNKNOWN]], align 1 ; CHECK-NEXT: ret void @@ -390,7 +396,7 @@ define void @callerE(ptr %arg) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@callerE -; CHECK-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: ret void ; call void @llvm.lifetime.start.p0(i64 4, ptr %arg) @@ -399,9 +405,9 @@ define void @write_global() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@write_global -; CHECK-SAME: () #[[ATTR6:[0-9]+]] { +; CHECK-SAME: () #[[ATTR10:[0-9]+]] { ; CHECK-NEXT: store i32 0, ptr @G, align 4 ; CHECK-NEXT: ret void ; @@ -411,7 +417,7 @@ define void @write_global_via_arg(ptr %GPtr) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@write_global_via_arg -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[GPTR:%.*]]) #[[ATTR11:[0-9]+]] { ; CHECK-NEXT: store i32 0, ptr [[GPTR]], align 4 ; CHECK-NEXT: ret void ; @@ -419,9 +425,9 @@ ret void } define internal void @write_global_via_arg_internal(ptr %GPtr) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@write_global_via_arg_internal -; CHECK-SAME: () #[[ATTR6]] { +; CHECK-SAME: () #[[ATTR12:[0-9]+]] { ; CHECK-NEXT: store i32 0, ptr @G, align 4 ; CHECK-NEXT: ret void ; @@ -430,32 +436,32 @@ } define void @writeonly_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@writeonly_global -; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: call void @write_global() #[[ATTR11:[0-9]+]] +; TUNIT-SAME: () #[[ATTR10]] { +; TUNIT-NEXT: call void @write_global() #[[ATTR16:[0-9]+]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@writeonly_global -; CGSCC-SAME: () #[[ATTR8:[0-9]+]] { -; CGSCC-NEXT: call void @write_global() #[[ATTR12:[0-9]+]] +; CGSCC-SAME: () #[[ATTR13:[0-9]+]] { +; CGSCC-NEXT: call void @write_global() #[[ATTR17:[0-9]+]] ; CGSCC-NEXT: ret void ; call void @write_global() ret void } define void @writeonly_global_via_arg() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@writeonly_global_via_arg -; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: call void @write_global_via_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR11]] +; TUNIT-SAME: () #[[ATTR10]] { +; TUNIT-NEXT: call void @write_global_via_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR16]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@writeonly_global_via_arg -; CGSCC-SAME: () #[[ATTR8]] { -; CGSCC-NEXT: call void @write_global_via_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR12]] +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @write_global_via_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) @G) #[[ATTR17]] ; CGSCC-NEXT: ret void ; call void @write_global_via_arg(ptr @G) @@ -464,16 +470,16 @@ define void @writeonly_global_via_arg_internal() { ; -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: call void @write_global_via_arg_internal() #[[ATTR11]] +; TUNIT-SAME: () #[[ATTR10]] { +; TUNIT-NEXT: call void @write_global_via_arg_internal() #[[ATTR16]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@writeonly_global_via_arg_internal -; CGSCC-SAME: () #[[ATTR8]] { -; CGSCC-NEXT: call void @write_global_via_arg_internal() #[[ATTR12]] +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @write_global_via_arg_internal() #[[ATTR17]] ; CGSCC-NEXT: ret void ; call void @write_global_via_arg_internal(ptr @G) @@ -483,11 +489,11 @@ define i8 @recursive_not_readnone(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone -; TUNIT-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR13:[0-9]+]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR12:[0-9]+]] +; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] ; TUNIT-NEXT: ret i8 1 ; TUNIT: f: ; TUNIT-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -495,11 +501,11 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone -; CGSCC-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[0-9]+]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR14]] ; CGSCC-NEXT: ret i8 1 ; CGSCC: f: ; CGSCC-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -519,11 +525,11 @@ define internal i8 @recursive_not_readnone_internal(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR13]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR12]] +; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] ; TUNIT-NEXT: ret i8 1 ; TUNIT: f: ; TUNIT-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -531,11 +537,11 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] +; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR14]] ; CGSCC-NEXT: ret i8 1 ; CGSCC: f: ; CGSCC-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -555,16 +561,16 @@ define i8 @readnone_caller(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@readnone_caller -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR14:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i8, align 1 -; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR12]] +; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 [[C]]) #[[ATTR17:[0-9]+]] ; TUNIT-NEXT: ret i8 [[R]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR15:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1 -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 noundef [[C]]) #[[ATTR14:[0-9]+]] +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 noundef [[C]]) #[[ATTR18:[0-9]+]] ; CGSCC-NEXT: ret i8 [[R]] ; %a = alloca i8 @@ -575,11 +581,11 @@ define internal i8 @recursive_readnone_internal2(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR13]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR12]] +; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] ; TUNIT-NEXT: ret i8 1 ; TUNIT: f: ; TUNIT-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -587,11 +593,11 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_readnone_internal2 -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] +; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_readnone_internal2(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR14]] ; CGSCC-NEXT: ret i8 1 ; CGSCC: f: ; CGSCC-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -611,14 +617,14 @@ define i8 @readnone_caller2(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@readnone_caller2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 [[C]]) #[[ATTR12]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR14]] { +; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr writeonly undef, i1 [[C]]) #[[ATTR17]] ; TUNIT-NEXT: ret i8 [[R]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller2 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] { -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 noundef [[C]]) #[[ATTR14]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR15]] { +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr writeonly undef, i1 noundef [[C]]) #[[ATTR18]] ; CGSCC-NEXT: ret i8 [[R]] ; %r = call i8 @recursive_readnone_internal2(ptr undef, i1 %c) @@ -628,11 +634,11 @@ define internal i8 @recursive_not_readnone_internal3(ptr %ptr, i1 %c) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR13]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR12]] +; TUNIT-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] ; TUNIT-NEXT: ret i8 1 ; TUNIT: f: ; TUNIT-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -640,11 +646,11 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@recursive_not_readnone_internal3 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR13]] +; CGSCC-NEXT: [[TMP1:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef false) #[[ATTR14]] ; CGSCC-NEXT: ret i8 1 ; CGSCC: f: ; CGSCC-NEXT: store i8 1, ptr [[PTR]], align 1 @@ -664,16 +670,16 @@ define i8 @readnone_caller3(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@readnone_caller3 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR14]] { ; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR12]] +; TUNIT-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 [[C]]) #[[ATTR17]] ; TUNIT-NEXT: ret i8 [[R]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@readnone_caller3 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR15]] { ; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1 -; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef [[C]]) #[[ATTR14]] +; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef [[C]]) #[[ATTR18]] ; CGSCC-NEXT: ret i8 [[R]] ; %alloc = alloca i8 @@ -682,9 +688,9 @@ } define internal void @argmemonly_before_ipconstprop(ptr %p) argmemonly { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@argmemonly_before_ipconstprop -; CHECK-SAME: () #[[ATTR6]] { +; CHECK-SAME: () #[[ATTR12]] { ; CHECK-NEXT: store i32 0, ptr @G, align 4 ; CHECK-NEXT: ret void ; @@ -692,17 +698,17 @@ ret void } -define void @argmemonky_caller() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) -; TUNIT-LABEL: define {{[^@]+}}@argmemonky_caller -; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR11]] +define void @argmemonly_caller() { +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) +; TUNIT-LABEL: define {{[^@]+}}@argmemonly_caller +; TUNIT-SAME: () #[[ATTR10]] { +; TUNIT-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR16]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) -; CGSCC-LABEL: define {{[^@]+}}@argmemonky_caller -; CGSCC-SAME: () #[[ATTR8]] { -; CGSCC-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR12]] +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) +; CGSCC-LABEL: define {{[^@]+}}@argmemonly_caller +; CGSCC-SAME: () #[[ATTR13]] { +; CGSCC-NEXT: call void @argmemonly_before_ipconstprop() #[[ATTR17]] ; CGSCC-NEXT: ret void ; call void @argmemonly_before_ipconstprop(ptr @G) @@ -714,7 +720,7 @@ define void @argmem_and_unknown(i1 %c, ptr %arg) memory(argmem: readwrite) { ; TUNIT: Function Attrs: nosync memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@argmem_and_unknown -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr writeonly [[ARG:%.*]]) #[[ATTR10:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr writeonly [[ARG:%.*]]) #[[ATTR15:[0-9]+]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: [[P:%.*]] = call ptr @no_mem_unknown_ptr(ptr noalias readnone [[ARG]]) @@ -725,7 +731,7 @@ ; ; CGSCC: Function Attrs: nosync memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@argmem_and_unknown -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr writeonly [[ARG:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr writeonly [[ARG:%.*]]) #[[ATTR16:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: [[P:%.*]] = call ptr @no_mem_unknown_ptr(ptr noalias readnone [[ARG]]) @@ -744,32 +750,41 @@ } ;. ; TUNIT: attributes #[[ATTR0]] = { memory(inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR1]] = { memory(argmem: readwrite, inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR2]] = { memory(none) } -; TUNIT: attributes #[[ATTR3]] = { memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR8]] = { nofree nosync nounwind memory(argmem: write) } -; TUNIT: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR10]] = { nosync memory(argmem: write) } -; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR12]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR1]] = { memory(write, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR2]] = { memory(argmem: read, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR3]] = { memory(argmem: write, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR4]] = { memory(argmem: readwrite, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR5]] = { memory(none) } +; TUNIT: attributes #[[ATTR6]] = { memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR8]] = { memory(write) } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR13]] = { nofree nosync nounwind memory(argmem: write) } +; TUNIT: attributes #[[ATTR14]] = { nofree norecurse nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR15]] = { nosync memory(argmem: write) } +; TUNIT: attributes #[[ATTR16]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR17]] = { nofree nosync nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { memory(inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR1]] = { memory(argmem: readwrite, inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR2]] = { memory(none) } -; CGSCC: attributes #[[ATTR3]] = { memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR9]] = { nofree nosync nounwind memory(argmem: write) } -; CGSCC: attributes #[[ATTR10]] = { nofree nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR11]] = { nosync memory(argmem: write) } -; CGSCC: attributes #[[ATTR12]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR13]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR14]] = { nounwind } +; CGSCC: attributes #[[ATTR1]] = { memory(write, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR2]] = { memory(argmem: read, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR3]] = { memory(argmem: write, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR4]] = { memory(argmem: readwrite, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR5]] = { memory(none) } +; CGSCC: attributes #[[ATTR6]] = { memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR8]] = { memory(write) } +; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR14]] = { nofree nosync nounwind memory(argmem: write) } +; CGSCC: attributes #[[ATTR15]] = { nofree nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR16]] = { nosync memory(argmem: write) } +; CGSCC: attributes #[[ATTR17]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR18]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/misc.ll =================================================================== --- llvm/test/Transforms/Attributor/misc.ll +++ llvm/test/Transforms/Attributor/misc.ll @@ -62,7 +62,7 @@ ; CGSCC-SAME: (ptr [[FP:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]] ; CGSCC-NEXT: call void @callback1(ptr noundef nonnull @foo) ; CGSCC-NEXT: call void @callback2(ptr noundef @foo) ; CGSCC-NEXT: call void @callback2(ptr [[FP]]) @@ -104,6 +104,5 @@ ; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR1]] = { nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR2]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR1]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/misc_crash.ll =================================================================== --- llvm/test/Transforms/Attributor/misc_crash.ll +++ llvm/test/Transforms/Attributor/misc_crash.ll @@ -37,9 +37,9 @@ } define internal void @func2a(i32* %0) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@func2a -; CHECK-SAME: (i32* nocapture nofree nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree nonnull readnone align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: store i32 0, i32* @var2, align 4 ; CHECK-NEXT: ret void ; @@ -131,6 +131,6 @@ declare void @func6(i8*) ;. ; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR2]] = { norecurse } ;. Index: llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll =================================================================== --- llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll +++ llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll @@ -10,7 +10,7 @@ ; CHECK-LABEL: define {{[^@]+}}@select_offsets_simplifiable_1 ; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = call ptr @calloc(i64 noundef 1024, i64 noundef 1) +; CHECK-NEXT: [[BYTES:%.*]] = call noalias ptr @calloc(i64 noundef 1024, i64 noundef 1) ; CHECK-NEXT: [[GEP23:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 23 ; CHECK-NEXT: store i8 23, ptr [[GEP23]], align 4 ; CHECK-NEXT: [[GEP29:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 29 @@ -190,7 +190,7 @@ ; CHECK-LABEL: define {{[^@]+}}@select_offsets_not_simplifiable_3 ; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = call ptr @calloc(i64 noundef 1024, i64 noundef 1) +; CHECK-NEXT: [[BYTES:%.*]] = call noalias ptr @calloc(i64 noundef 1024, i64 noundef 1) ; CHECK-NEXT: [[SEL0:%.*]] = select i1 [[CND1]], i64 23, i64 29 ; CHECK-NEXT: [[SEL1:%.*]] = select i1 [[CND2]], i64 [[SEL0]], i64 7 ; CHECK-NEXT: [[GEP_SEL:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[SEL1]] @@ -214,7 +214,7 @@ ; CHECK-LABEL: define {{[^@]+}}@select_offsets_not_simplifiable_4 ; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = call ptr @calloc(i64 noundef 1024, i64 noundef 1) +; CHECK-NEXT: [[BYTES:%.*]] = call noalias ptr @calloc(i64 noundef 1024, i64 noundef 1) ; CHECK-NEXT: [[SEL0:%.*]] = select i1 [[CND1]], i64 23, i64 29 ; CHECK-NEXT: [[SEL1:%.*]] = select i1 [[CND2]], i64 [[SEL0]], i64 7 ; CHECK-NEXT: [[GEP_SEL:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 [[SEL1]] @@ -291,9 +291,9 @@ } define i8 @select_gep_not_simplifiable_1(i1 %cnd1, i1 %cnd2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CHECK-LABEL: define {{[^@]+}}@select_gep_not_simplifiable_1 -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: [[GEP7:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 7 @@ -318,9 +318,9 @@ ; FIXME: The whole function is just "ret i8 21". define i8 @phi_gep_simplifiable_1(i1 %cnd1, i1 %cnd2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; CHECK-LABEL: define {{[^@]+}}@phi_gep_simplifiable_1 -; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CHECK-NEXT: br i1 [[CND1]], label [[THEN:%.*]], label [[ELSE:%.*]] @@ -405,7 +405,7 @@ } define i8 @phi_gep_not_simplifiable_1(i1 %cnd1, i1 %cnd2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; CHECK-LABEL: define {{[^@]+}}@phi_gep_not_simplifiable_1 ; CHECK-SAME: (i1 noundef [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: entry: @@ -447,7 +447,7 @@ ; CHECK-LABEL: define {{[^@]+}}@phi_gep_not_simplifiable_2 ; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = call ptr @calloc(i64 noundef 1024, i64 noundef 1) +; CHECK-NEXT: [[BYTES:%.*]] = call noalias ptr @calloc(i64 noundef 1024, i64 noundef 1) ; CHECK-NEXT: [[GEP23:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 23 ; CHECK-NEXT: br i1 [[CND1]], label [[THEN:%.*]], label [[ELSE:%.*]] ; CHECK: then: @@ -519,7 +519,7 @@ ; CHECK: attributes #[[ATTR0:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } ; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/noalias.ll =================================================================== --- llvm/test/Transforms/Attributor/noalias.ll +++ llvm/test/Transforms/Attributor/noalias.ll @@ -175,7 +175,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@calle1 ; CGSCC-SAME: () #[[ATTR2:[0-9]+]] { -; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) ptr @getter() #[[ATTR11:[0-9]+]] +; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) ptr @getter() #[[ATTR13:[0-9]+]] ; CGSCC-NEXT: ret ptr [[TMP1]] ; %1 = call ptr @getter() @@ -262,17 +262,29 @@ ; TEST 8 define ptr @test8(ptr %0) nounwind uwtable { -; CHECK: Function Attrs: nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@test8 -; CHECK-SAME: (ptr [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] { -; CHECK-NEXT: [[TMP2:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) -; CHECK-NEXT: [[TMP3:%.*]] = icmp ne ptr [[TMP0]], null -; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] -; CHECK: 4: -; CHECK-NEXT: store i8 10, ptr [[TMP2]], align 1 -; CHECK-NEXT: br label [[TMP5]] -; CHECK: 5: -; CHECK-NEXT: ret ptr [[TMP2]] +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: none) uwtable +; TUNIT-LABEL: define {{[^@]+}}@test8 +; TUNIT-SAME: (ptr readnone [[TMP0:%.*]]) #[[ATTR4:[0-9]+]] { +; TUNIT-NEXT: [[TMP2:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) +; TUNIT-NEXT: [[TMP3:%.*]] = icmp ne ptr [[TMP0]], null +; TUNIT-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] +; TUNIT: 4: +; TUNIT-NEXT: store i8 10, ptr [[TMP2]], align 1 +; TUNIT-NEXT: br label [[TMP5]] +; TUNIT: 5: +; TUNIT-NEXT: ret ptr [[TMP2]] +; +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: none) uwtable +; CGSCC-LABEL: define {{[^@]+}}@test8 +; CGSCC-SAME: (ptr readnone [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: [[TMP2:%.*]] = tail call noalias ptr @malloc(i64 noundef 4) +; CGSCC-NEXT: [[TMP3:%.*]] = icmp ne ptr [[TMP0]], null +; CGSCC-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] +; CGSCC: 4: +; CGSCC-NEXT: store i8 10, ptr [[TMP2]], align 1 +; CGSCC-NEXT: br label [[TMP5]] +; CGSCC: 5: +; CGSCC-NEXT: ret ptr [[TMP2]] ; %2 = tail call noalias ptr @malloc(i64 4) %3 = icmp ne ptr %0, null @@ -290,9 +302,17 @@ ; Simple Argument Test declare void @use_i8(ptr nocapture) define internal void @test9a(ptr %a, ptr %b) { -; CHECK-LABEL: define {{[^@]+}}@test9a() { -; CHECK-NEXT: call void @use_i8(ptr noalias nocapture noundef align 4294967296 null) -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@test9a +; TUNIT-SAME: () #[[ATTR5:[0-9]+]] { +; TUNIT-NEXT: call void @use_i8(ptr noalias nocapture noundef align 4294967296 null) +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@test9a +; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: call void @use_i8(ptr noalias nocapture noundef align 4294967296 null) +; CGSCC-NEXT: ret void ; call void @use_i8(ptr null) ret void @@ -519,18 +539,18 @@ define i32 @i2p(ptr %arg) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@i2p -; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR4:[0-9]+]] { -; TUNIT-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR10:[0-9]+]] +; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR13:[0-9]+]] ; TUNIT-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to ptr -; TUNIT-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree readonly align 4 [[I2P]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree readonly align 4 [[I2P]]) #[[ATTR13]] ; TUNIT-NEXT: ret i32 [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@i2p -; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { -; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR11]] +; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR13]] ; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to ptr -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[I2P]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[I2P]]) #[[ATTR13]] ; CGSCC-NEXT: ret i32 [[CALL]] ; %c = call i32 @p2i(ptr %arg) @@ -541,13 +561,13 @@ define internal i32 @ret(ptr %arg) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@ret -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[ARG]], align 4 ; TUNIT-NEXT: ret i32 [[L]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@ret -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR8:[0-9]+]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[ARG]], align 4 ; CGSCC-NEXT: ret i32 [[L]] ; @@ -569,7 +589,7 @@ ; TUNIT-SAME: (ptr [[S:%.*]]) unnamed_addr { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR14:[0-9]+]] ; TUNIT-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr nonnull align 8 dereferenceable(240) [[F]], ptr [[S]]) ; TUNIT-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) ; TUNIT-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) @@ -580,7 +600,7 @@ ; CGSCC-SAME: (ptr [[S:%.*]]) unnamed_addr { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR12:[0-9]+]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR13]] ; CGSCC-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr nonnull align 8 dereferenceable(240) [[F]], ptr [[S]]) ; CGSCC-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0) ; CGSCC-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1) @@ -632,15 +652,15 @@ @alias_of_p = external global ptr define void @make_alias(ptr %p) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@make_alias -; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: store ptr [[P]], ptr @alias_of_p, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@make_alias -; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: store ptr [[P]], ptr @alias_of_p, align 8 ; CGSCC-NEXT: ret void ; @@ -651,13 +671,13 @@ define void @only_store(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@only_store -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; TUNIT-NEXT: store i32 0, ptr [[P]], align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@only_store -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: store i32 0, ptr [[P]], align 4 ; CGSCC-NEXT: ret void ; @@ -666,28 +686,28 @@ } define void @test15_caller(ptr noalias %p, i32 %c) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test15_caller -; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR11:[0-9]+]] { ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: -; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @make_alias(ptr noalias nofree readnone [[P]]) #[[ATTR13]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test15_caller -; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: -; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @make_alias(ptr noalias nofree readnone [[P]]) #[[ATTR14]] ; CGSCC-NEXT: ret void ; %tobool = icmp eq i32 %c, 0 @@ -723,32 +743,32 @@ ; Therefore, only one of the two conditions of if statementes will be fulfilled. define internal void @test16_sub(ptr noalias %p, i32 %c1, i32 %c2) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test16_sub -; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR11]] { ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]] -; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly align 4 [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR13]] +; TUNIT-NEXT: tail call void @make_alias(ptr noalias nofree readnone align 4 [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: ; TUNIT-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]] ; TUNIT: if.then2: -; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[IF_END3]] ; TUNIT: if.end3: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test16_sub -; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C1:%.*]], i32 [[C2:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]] -; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]] +; CGSCC-NEXT: tail call void @make_alias(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[P]]) #[[ATTR14]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: ; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0 @@ -780,16 +800,16 @@ } define void @test16_caller(ptr %p, i32 %c) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test16_caller -; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { -; TUNIT-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR10]] +; TUNIT-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR11]] { +; TUNIT-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test16_caller -; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] { -; CGSCC-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]] +; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR12]] { +; CGSCC-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR14]] ; CGSCC-NEXT: ret void ; tail call void @test16_sub(ptr %p, i32 %c, i32 %c) @@ -816,32 +836,32 @@ ; } define void @test17_caller(ptr noalias %p, i32 %c) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test17_caller -; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR11]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; TUNIT: l1: -; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @make_alias(ptr noalias nofree readnone [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[L3:%.*]] ; TUNIT: l2: -; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @only_store(ptr noalias nocapture nofree writeonly align 4 [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[L3]] ; TUNIT: l3: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test17_caller -; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; CGSCC: l1: -; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @make_alias(ptr noalias nofree readnone [[P]]) #[[ATTR14]] ; CGSCC-NEXT: br label [[L3:%.*]] ; CGSCC: l2: -; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]] ; CGSCC-NEXT: br label [[L3]] ; CGSCC: l3: ; CGSCC-NEXT: ret void @@ -876,7 +896,7 @@ define void @noreturn() { ; TUNIT: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@noreturn -; TUNIT-SAME: () #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR12:[0-9]+]] { ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) @@ -889,30 +909,30 @@ } define void @test18_caller(ptr noalias %p, i32 %c) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test18_caller -; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr noalias nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR11]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; TUNIT: l1: -; TUNIT-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @make_alias(ptr noalias nofree readnone [[P]]) #[[ATTR13]] ; TUNIT-NEXT: br label [[L2]] ; TUNIT: l2: -; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @only_store(ptr nocapture nofree writeonly align 4 [[P]]) #[[ATTR13]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test18_caller -; CGSCC-SAME: (ptr noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr noalias nofree nonnull writeonly align 4 dereferenceable(4) [[P:%.*]], i32 [[C:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]] ; CGSCC: l1: -; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @make_alias(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[P]]) #[[ATTR14]] ; CGSCC-NEXT: br label [[L2]] ; CGSCC: l2: -; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]] +; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]] ; CGSCC-NEXT: ret void ; entry: @@ -933,28 +953,31 @@ ; TUNIT: attributes #[[ATTR1]] = { nounwind uwtable } ; TUNIT: attributes #[[ATTR2]] = { nounwind } ; TUNIT: attributes #[[ATTR3]] = { nounwind ssp uwtable } -; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR11]] = { willreturn memory(readwrite) } +; TUNIT: attributes #[[ATTR4]] = { nounwind memory(readwrite, argmem: none) uwtable } +; TUNIT: attributes #[[ATTR5]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR14]] = { willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR1]] = { nounwind uwtable } ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR3]] = { nounwind } ; CGSCC: attributes #[[ATTR4]] = { nounwind ssp uwtable } -; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR11]] = { willreturn } -; CGSCC: attributes #[[ATTR12]] = { willreturn memory(readwrite) } -; CGSCC: attributes #[[ATTR13]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR14]] = { nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR5]] = { nounwind memory(readwrite, argmem: none) uwtable } +; CGSCC: attributes #[[ATTR6]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nosync nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR9:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR13]] = { willreturn } +; CGSCC: attributes #[[ATTR14]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/nocapture-1.ll =================================================================== --- llvm/test/Transforms/Attributor/nocapture-1.ll +++ llvm/test/Transforms/Attributor/nocapture-1.ll @@ -21,9 +21,9 @@ ; It would also be acceptable to mark %q as readnone. Update @c3 too. define void @c2(ptr %q) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@c2 -; CHECK-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr nofree readnone [[Q:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: store ptr [[Q]], ptr @g, align 8 ; CHECK-NEXT: ret void ; @@ -32,16 +32,16 @@ } define void @c3(ptr %q) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@c3 -; TUNIT-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR14:[0-9]+]] +; TUNIT-SAME: (ptr nofree readnone [[Q:%.*]]) #[[ATTR1]] { +; TUNIT-NEXT: call void @c2(ptr noalias nofree readnone [[Q]]) #[[ATTR21:[0-9]+]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@c3 -; CGSCC-SAME: (ptr nofree writeonly [[Q:%.*]]) #[[ATTR2:[0-9]+]] { -; CGSCC-NEXT: call void @c2(ptr nofree writeonly [[Q]]) #[[ATTR17:[0-9]+]] +; CGSCC-SAME: (ptr nofree readnone [[Q:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: call void @c2(ptr noalias nofree readnone [[Q]]) #[[ATTR23:[0-9]+]] ; CGSCC-NEXT: ret void ; call void @c2(ptr %q) @@ -98,9 +98,9 @@ @lookup_table = global [2 x i1] [ i1 0, i1 1 ] define i1 @c5(ptr %q, i32 %bitno) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@c5 -; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: [[TMP:%.*]] = ptrtoint ptr [[Q]] to i32 ; TUNIT-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] ; TUNIT-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 @@ -108,9 +108,9 @@ ; TUNIT-NEXT: [[VAL:%.*]] = load i1, ptr [[LOOKUP]], align 1 ; TUNIT-NEXT: ret i1 [[VAL]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@c5 -; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readnone [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: [[TMP:%.*]] = ptrtoint ptr [[Q]] to i32 ; CGSCC-NEXT: [[TMP2:%.*]] = lshr i32 [[TMP]], [[BITNO]] ; CGSCC-NEXT: [[BIT:%.*]] = and i32 [[TMP2]], 1 @@ -186,15 +186,15 @@ define i1 @c7(ptr %q, i32 %bitno) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@c7 -; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR2]] { -; TUNIT-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR15:[0-9]+]] +; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR4:[0-9]+]] { +; TUNIT-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR22:[0-9]+]] ; TUNIT-NEXT: [[VAL:%.*]] = load i1, ptr [[PTR]], align 1 ; TUNIT-NEXT: ret i1 [[VAL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@c7 ; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR5:[0-9]+]] { -; CGSCC-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR18:[0-9]+]] +; CGSCC-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR24:[0-9]+]] ; CGSCC-NEXT: [[VAL:%.*]] = load i1, ptr [[PTR]], align 1 ; CGSCC-NEXT: ret i1 [[VAL]] ; @@ -205,9 +205,9 @@ define i32 @nc1(ptr %q, ptr %p, i1 %b) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@nc1 -; TUNIT-SAME: (ptr nofree [[Q:%.*]], ptr nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR4:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], ptr nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: e: ; TUNIT-NEXT: br label [[L:%.*]] ; TUNIT: l: @@ -219,9 +219,9 @@ ; TUNIT-NEXT: store ptr [[Q]], ptr @g, align 8 ; TUNIT-NEXT: ret i32 [[VAL]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@nc1 -; CGSCC-SAME: (ptr nofree [[Q:%.*]], ptr nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], ptr nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: e: ; CGSCC-NEXT: br label [[L:%.*]] ; CGSCC: l: @@ -246,9 +246,9 @@ } define i32 @nc1_addrspace(ptr %q, ptr addrspace(1) %p, i1 %b) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@nc1_addrspace -; TUNIT-SAME: (ptr nofree [[Q:%.*]], ptr addrspace(1) nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nofree readonly [[Q:%.*]], ptr addrspace(1) nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: e: ; TUNIT-NEXT: br label [[L:%.*]] ; TUNIT: l: @@ -261,9 +261,9 @@ ; TUNIT-NEXT: store ptr [[Q]], ptr @g, align 8 ; TUNIT-NEXT: ret i32 [[VAL]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@nc1_addrspace -; CGSCC-SAME: (ptr nofree [[Q:%.*]], ptr addrspace(1) nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR6]] { +; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], ptr addrspace(1) nocapture nofree [[P:%.*]], i1 [[B:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: e: ; CGSCC-NEXT: br label [[L:%.*]] ; CGSCC: l: @@ -290,16 +290,16 @@ } define void @nc2(ptr %p, ptr %q) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@nc2 -; TUNIT-SAME: (ptr nocapture nofree [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR4]] { -; TUNIT-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nocapture nofree [[P]], i1 noundef false) #[[ATTR14]] +; TUNIT-SAME: (ptr nocapture nofree [[P:%.*]], ptr nofree readonly [[Q:%.*]]) #[[ATTR5]] { +; TUNIT-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree readonly [[Q]], ptr nocapture nofree [[P]], i1 noundef false) #[[ATTR21]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@nc2 -; CGSCC-SAME: (ptr nocapture nofree align 4 [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR7:[0-9]+]] { -; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR17]] +; CGSCC-SAME: (ptr nocapture nofree align 4 [[P:%.*]], ptr nofree readonly [[Q:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree readonly [[Q]], ptr nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR23]] ; CGSCC-NEXT: ret void ; %1 = call i32 @nc1(ptr %q, ptr %p, i1 0) ; [#uses=0] @@ -308,10 +308,17 @@ define void @nc3(ptr %p) { -; CHECK-LABEL: define {{[^@]+}}@nc3 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull [[P:%.*]]) { -; CHECK-NEXT: call void [[P]]() -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@nc3 +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readnone [[P:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: call void [[P]]() +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@nc3 +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readnone [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: call void [[P]]() +; CGSCC-NEXT: ret void ; call void %p() ret void @@ -321,16 +328,16 @@ ; FIXME: readonly and nocapture missing on the pointer. declare void @external(ptr readonly) nounwind argmemonly define void @nc4(ptr %p) { -; TUNIT: Function Attrs: nounwind memory(argmem: readwrite) +; TUNIT: Function Attrs: nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@nc4 -; TUNIT-SAME: (ptr [[P:%.*]]) #[[ATTR5:[0-9]+]] { -; TUNIT-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR16:[0-9]+]] +; TUNIT-SAME: (ptr nocapture readonly [[P:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR23:[0-9]+]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nounwind memory(argmem: readwrite) +; CGSCC: Function Attrs: nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@nc4 -; CGSCC-SAME: (ptr [[P:%.*]]) #[[ATTR8:[0-9]+]] { -; CGSCC-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR19:[0-9]+]] +; CGSCC-SAME: (ptr nocapture readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR25:[0-9]+]] ; CGSCC-NEXT: ret void ; call void @external(ptr %p) @@ -339,7 +346,7 @@ define void @nc5(ptr %f, ptr %p) { ; CHECK-LABEL: define {{[^@]+}}@nc5 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull [[F:%.*]], ptr nocapture [[P:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull readnone [[F:%.*]], ptr nocapture [[P:%.*]]) { ; CHECK-NEXT: call void [[F]](ptr nocapture [[P]]) ; CHECK-NEXT: ret void ; @@ -350,17 +357,17 @@ ; It would be acceptable to add readnone to %y1_1 and %y1_2. define void @test1_1(ptr %x1_1, ptr %y1_1, i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test1_1 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_1:%.*]], ptr nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] { -; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @test1_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) #[[ATTR17:[0-9]+]] +; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_1:%.*]], ptr nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @test1_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test1_1 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_1:%.*]], ptr nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { -; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @test1_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) #[[ATTR20:[0-9]+]] +; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_1:%.*]], ptr nocapture nofree readnone [[Y1_1:%.*]], i1 [[C:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @test1_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[Y1_1]], i1 [[C]]) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: ret void ; @@ -370,23 +377,23 @@ } define ptr @test1_2(ptr %x1_2, ptr %y1_2, i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test1_2 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR17]] +; TUNIT-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: br label [[F]] ; TUNIT: f: ; TUNIT-NEXT: ret ptr [[Y1_2]] ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test1_2 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree readnone [[X1_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y1_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR11]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR20]] +; CGSCC-NEXT: call void @test1_1(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone [[Y1_2]], i1 noundef [[C]]) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: br label [[F]] ; CGSCC: f: @@ -402,17 +409,17 @@ } define void @test2(ptr %x2) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test2 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X2:%.*]]) #[[ATTR6]] { -; TUNIT-NEXT: call void @test2(ptr noalias nocapture nofree readnone undef) #[[ATTR17]] +; TUNIT-SAME: (ptr nocapture nofree readnone [[X2:%.*]]) #[[ATTR9]] { +; TUNIT-NEXT: call void @test2(ptr noalias nocapture nofree readnone undef) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test2 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X2:%.*]]) #[[ATTR9]] { -; CGSCC-NEXT: call void @test2(ptr noalias nocapture nofree readnone undef) #[[ATTR20]] +; CGSCC-SAME: (ptr nocapture nofree readnone [[X2:%.*]]) #[[ATTR11]] { +; CGSCC-NEXT: call void @test2(ptr noalias nocapture nofree readnone undef) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: ret void ; @@ -422,17 +429,17 @@ } define void @test3(ptr %x3, ptr %y3, ptr %z3) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test3 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X3:%.*]], ptr nocapture nofree readnone [[Y3:%.*]], ptr nocapture nofree readnone [[Z3:%.*]]) #[[ATTR6]] { -; TUNIT-NEXT: call void @test3(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef) #[[ATTR17]] +; TUNIT-SAME: (ptr nocapture nofree readnone [[X3:%.*]], ptr nocapture nofree readnone [[Y3:%.*]], ptr nocapture nofree readnone [[Z3:%.*]]) #[[ATTR9]] { +; TUNIT-NEXT: call void @test3(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test3 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X3:%.*]], ptr nocapture nofree readnone [[Y3:%.*]], ptr nocapture nofree readnone [[Z3:%.*]]) #[[ATTR9]] { -; CGSCC-NEXT: call void @test3(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef) #[[ATTR20]] +; CGSCC-SAME: (ptr nocapture nofree readnone [[X3:%.*]], ptr nocapture nofree readnone [[Y3:%.*]], ptr nocapture nofree readnone [[Z3:%.*]]) #[[ATTR11]] { +; CGSCC-NEXT: call void @test3(ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef, ptr noalias nocapture nofree readnone undef) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: ret void ; @@ -442,17 +449,17 @@ } define void @test4_1(ptr %x4_1, i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test4_1 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) #[[ATTR6]] { -; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @test4_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], ptr noalias nocapture nofree readnone undef, i1 [[C]]) #[[ATTR17]] +; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { +; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @test4_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], ptr noalias nocapture nofree readnone undef, i1 [[C]]) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test4_1 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) #[[ATTR9]] { -; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @test4_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], ptr noalias nocapture nofree readnone undef, i1 [[C]]) #[[ATTR20]] +; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_1:%.*]], i1 [[C:%.*]]) #[[ATTR11]] { +; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @test4_2(ptr noalias nocapture nofree readnone undef, ptr noalias nofree readnone "no-capture-maybe-returned" [[X4_1]], ptr noalias nocapture nofree readnone undef, i1 [[C]]) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: ret void ; @@ -462,23 +469,23 @@ } define ptr @test4_2(ptr %x4_2, ptr %y4_2, ptr %z4_2, i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test4_2 -; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR17]] +; TUNIT-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR9]] ; TUNIT-NEXT: store ptr null, ptr @g, align 8 ; TUNIT-NEXT: br label [[F]] ; TUNIT: f: ; TUNIT-NEXT: ret ptr [[Y4_2]] ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test4_2 -; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree readnone [[X4_2:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[Y4_2:%.*]], ptr nocapture nofree readnone [[Z4_2:%.*]], i1 noundef [[C:%.*]]) #[[ATTR11]] { ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR20]] +; CGSCC-NEXT: call void @test4_1(ptr noalias nocapture nofree noundef readnone align 4294967296 null, i1 noundef [[C]]) #[[ATTR11]] ; CGSCC-NEXT: store ptr null, ptr @g, align 8 ; CGSCC-NEXT: br label [[F]] ; CGSCC: f: @@ -524,13 +531,13 @@ define void @test_cmpxchg(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test_cmpxchg -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; TUNIT-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[P]], i32 0, i32 1 acquire monotonic, align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test_cmpxchg -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[P]], i32 0, i32 1 acquire monotonic, align 4 ; CGSCC-NEXT: ret void ; @@ -541,13 +548,13 @@ define void @test_cmpxchg_ptr(ptr %p, ptr %q) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], ptr nofree readnone [[Q:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[P]], ptr null, ptr [[Q]] acquire monotonic, align 8 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test_cmpxchg_ptr -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(8) [[P:%.*]], ptr nofree readnone [[Q:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: [[TMP1:%.*]] = cmpxchg ptr [[P]], ptr null, ptr [[Q]] acquire monotonic, align 8 ; CGSCC-NEXT: ret void ; @@ -558,13 +565,13 @@ define void @test_atomicrmw(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test_atomicrmw -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: [[TMP1:%.*]] = atomicrmw add ptr [[P]], i32 1 seq_cst, align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test_atomicrmw -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull dereferenceable(4) [[P:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: [[TMP1:%.*]] = atomicrmw add ptr [[P]], i32 1 seq_cst, align 4 ; CGSCC-NEXT: ret void ; @@ -575,7 +582,7 @@ define void @test_volatile(ptr %x) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test_volatile -; TUNIT-SAME: (ptr nofree align 4 [[X:%.*]]) #[[ATTR7]] { +; TUNIT-SAME: (ptr nofree align 4 [[X:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[X]], i64 1 ; TUNIT-NEXT: store volatile i32 0, ptr [[GEP]], align 4 @@ -583,7 +590,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test_volatile -; CGSCC-SAME: (ptr nofree align 4 [[X:%.*]]) #[[ATTR10]] { +; CGSCC-SAME: (ptr nofree align 4 [[X:%.*]]) #[[ATTR12]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[X]], i64 1 ; CGSCC-NEXT: store volatile i32 0, ptr [[GEP]], align 4 @@ -596,19 +603,19 @@ } define void @nocaptureLaunder(ptr %p) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@nocaptureLaunder -; TUNIT-SAME: (ptr nocapture nofree [[P:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18:[0-9]+]] +; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree readnone [[P]]) #[[ATTR24:[0-9]+]] ; TUNIT-NEXT: store i8 42, ptr [[B]], align 1 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@nocaptureLaunder -; CGSCC-SAME: (ptr nocapture nofree [[P:%.*]]) #[[ATTR6]] { +; CGSCC-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]] +; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree readnone [[P]]) #[[ATTR24]] ; CGSCC-NEXT: store i8 42, ptr [[B]], align 1 ; CGSCC-NEXT: ret void ; @@ -620,17 +627,17 @@ @g2 = global ptr null define void @captureLaunder(ptr %p) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@captureLaunder -; TUNIT-SAME: (ptr nofree [[P:%.*]]) #[[ATTR4]] { -; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]] +; TUNIT-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR12:[0-9]+]] { +; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree readnone [[P]]) #[[ATTR24]] ; TUNIT-NEXT: store ptr [[B]], ptr @g2, align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@captureLaunder -; CGSCC-SAME: (ptr nofree [[P:%.*]]) #[[ATTR6]] { -; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]] +; CGSCC-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree readnone [[P]]) #[[ATTR24]] ; CGSCC-NEXT: store ptr [[B]], ptr @g2, align 8 ; CGSCC-NEXT: ret void ; @@ -640,13 +647,21 @@ } define void @nocaptureStrip(ptr %p) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) -; CHECK-LABEL: define {{[^@]+}}@nocaptureStrip -; CHECK-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR18:[0-9]+]] -; CHECK-NEXT: store i8 42, ptr [[B]], align 1 -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT-LABEL: define {{[^@]+}}@nocaptureStrip +; TUNIT-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR13:[0-9]+]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR24]] +; TUNIT-NEXT: store i8 42, ptr [[B]], align 1 +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC-LABEL: define {{[^@]+}}@nocaptureStrip +; CGSCC-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR24]] +; CGSCC-NEXT: store i8 42, ptr [[B]], align 1 +; CGSCC-NEXT: ret void ; entry: %b = call ptr @llvm.strip.invariant.group.p0(ptr %p) @@ -656,10 +671,10 @@ @g3 = global ptr null define void @captureStrip(ptr %p) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@captureStrip -; CHECK-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR1]] { -; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR18]] +; CHECK-SAME: (ptr nofree readnone [[P:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR24:[0-9]+]] ; CHECK-NEXT: store ptr [[B]], ptr @g3, align 8 ; CHECK-NEXT: ret void ; @@ -726,13 +741,13 @@ define i1 @captureDereferenceableOrNullICmp(ptr dereferenceable_or_null(4) %x) null_pointer_is_valid { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; TUNIT-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR14:[0-9]+]] { ; TUNIT-NEXT: [[TMP1:%.*]] = icmp eq ptr [[X]], null ; TUNIT-NEXT: ret i1 [[TMP1]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@captureDereferenceableOrNullICmp -; CGSCC-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: (ptr nofree noundef readnone dereferenceable_or_null(4) [[X:%.*]]) #[[ATTR16:[0-9]+]] { ; CGSCC-NEXT: [[TMP1:%.*]] = icmp eq ptr [[X]], null ; CGSCC-NEXT: ret i1 [[TMP1]] ; @@ -757,14 +772,14 @@ define ptr @test_returned1(ptr %A, ptr returned %B) nounwind readonly { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@test_returned1 -; TUNIT-SAME: (ptr nocapture [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR15:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]]) ; TUNIT-NEXT: ret ptr [[P]] ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@test_returned1 -; CGSCC-SAME: (ptr nocapture [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR12:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture [[A:%.*]], ptr returned [[B:%.*]]) #[[ATTR17:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]]) ; CGSCC-NEXT: ret ptr [[P]] @@ -775,18 +790,18 @@ } define ptr @test_returned2(ptr %A, ptr %B) { -; TUNIT: Function Attrs: nounwind memory(read) +; TUNIT: Function Attrs: nounwind memory(read, argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@test_returned2 -; TUNIT-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR9]] { +; TUNIT-SAME: (ptr [[A:%.*]], ptr [[B:%.*]]) #[[ATTR16:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR9]] +; TUNIT-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]]) #[[ATTR15]] ; TUNIT-NEXT: ret ptr [[P]] ; -; CGSCC: Function Attrs: nounwind memory(read) +; CGSCC: Function Attrs: nounwind memory(read, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@test_returned2 -; CGSCC-SAME: (ptr readonly [[A:%.*]], ptr readonly [[B:%.*]]) #[[ATTR12]] { +; CGSCC-SAME: (ptr [[A:%.*]], ptr [[B:%.*]]) #[[ATTR18:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr readonly [[A]], ptr readonly [[B]]) #[[ATTR12]] +; CGSCC-NEXT: [[P:%.*]] = call ptr @unknownpi8pi8(ptr [[A]], ptr [[B]]) #[[ATTR17]] ; CGSCC-NEXT: ret ptr [[P]] ; entry: @@ -800,15 +815,15 @@ ; FIXME: Both pointers should be nocapture define void @ptr_uses(ptr %ptr, ptr %wptr) { -; TUNIT: Function Attrs: mustprogress nounwind willreturn +; TUNIT: Function Attrs: mustprogress nounwind willreturn memory(read, argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@ptr_uses -; TUNIT-SAME: (ptr [[PTR:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR11:[0-9]+]] { +; TUNIT-SAME: (ptr readonly [[PTR:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR18:[0-9]+]] { ; TUNIT-NEXT: store i8 0, ptr [[WPTR]], align 1 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nounwind willreturn +; CGSCC: Function Attrs: mustprogress nounwind willreturn memory(read, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@ptr_uses -; CGSCC-SAME: (ptr [[PTR:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-SAME: (ptr readonly [[PTR:%.*]], ptr nocapture nofree noundef nonnull writeonly dereferenceable(1) [[WPTR:%.*]]) #[[ATTR20:[0-9]+]] { ; CGSCC-NEXT: store i8 0, ptr [[WPTR]], align 1 ; CGSCC-NEXT: ret void ; @@ -823,44 +838,55 @@ declare ptr @llvm.strip.invariant.group.p0(ptr) ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) } ; TUNIT: attributes #[[ATTR3]] = { memory(read) } -; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR5]] = { nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR6]] = { nofree nosync nounwind memory(write) } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } -; TUNIT: attributes #[[ATTR9]] = { nounwind memory(read) } -; TUNIT: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR11]] = { mustprogress nounwind willreturn } -; TUNIT: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR13:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; TUNIT: attributes #[[ATTR14]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR15]] = { nofree nounwind willreturn } -; TUNIT: attributes #[[ATTR16]] = { nounwind } -; TUNIT: attributes #[[ATTR17]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR18]] = { willreturn } +; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR6]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR7:[0-9]+]] = { nounwind memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR8]] = { nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR9]] = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } +; TUNIT: attributes #[[ATTR15]] = { nounwind memory(read) } +; TUNIT: attributes #[[ATTR16]] = { nounwind memory(read, argmem: readwrite) } +; TUNIT: attributes #[[ATTR17:[0-9]+]] = { nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR18]] = { mustprogress nounwind willreturn memory(read, argmem: readwrite) } +; TUNIT: attributes #[[ATTR19:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR20:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +; TUNIT: attributes #[[ATTR21]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR22]] = { nofree nounwind willreturn } +; TUNIT: attributes #[[ATTR23]] = { nounwind } +; TUNIT: attributes #[[ATTR24]] = { willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR4]] = { memory(read) } ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR8]] = { nounwind memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR9]] = { nofree nosync nounwind memory(write) } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } -; CGSCC: attributes #[[ATTR12]] = { nounwind memory(read) } -; CGSCC: attributes #[[ATTR13:[0-9]+]] = { nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR14]] = { mustprogress nounwind willreturn } -; CGSCC: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; CGSCC: attributes #[[ATTR17]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR18]] = { willreturn } -; CGSCC: attributes #[[ATTR19]] = { nounwind } -; CGSCC: attributes #[[ATTR20]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR8]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR9:[0-9]+]] = { nounwind memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR10]] = { nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR11]] = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR16]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } +; CGSCC: attributes #[[ATTR17]] = { nounwind memory(read) } +; CGSCC: attributes #[[ATTR18]] = { nounwind memory(read, argmem: readwrite) } +; CGSCC: attributes #[[ATTR19:[0-9]+]] = { nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR20]] = { mustprogress nounwind willreturn memory(read, argmem: readwrite) } +; CGSCC: attributes #[[ATTR21:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR22:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +; CGSCC: attributes #[[ATTR23]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR24]] = { willreturn } +; CGSCC: attributes #[[ATTR25]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/nocapture-2.ll =================================================================== --- llvm/test/Transforms/Attributor/nocapture-2.ll +++ llvm/test/Transforms/Attributor/nocapture-2.ll @@ -44,7 +44,7 @@ define i32 @is_null_control(i32* %p) #0 { ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable ; CHECK-LABEL: define {{[^@]+}}@is_null_control -; CHECK-SAME: (i32* nofree [[P:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR0]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[P]], null @@ -172,11 +172,11 @@ ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; TUNIT: cond.true: ; TUNIT-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to i16* -; TUNIT-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR9:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR10:[0-9]+]] ; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i8* [[CALL]] to double* -; TUNIT-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i32* -; TUNIT-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL2]] to i32* ; TUNIT-NEXT: br label [[COND_END:%.*]] ; TUNIT: cond.false: @@ -194,11 +194,11 @@ ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CGSCC: cond.true: ; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i32* [[A]] to i16* -; CGSCC-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR10:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR11:[0-9]+]] ; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i8* [[CALL]] to double* -; CGSCC-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR11]] ; CGSCC-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i32* -; CGSCC-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR11]] ; CGSCC-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL2]] to i32* ; CGSCC-NEXT: br label [[COND_END:%.*]] ; CGSCC: cond.false: @@ -233,49 +233,27 @@ ; FIXME: the call1 below to scc_B should return dereferenceable_or_null(8) (as the callee does). Something prevented that deduction and needs to be investigated. define i64* @scc_B(double* dereferenceable_or_null(8) %a) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(none) -; TUNIT-LABEL: define {{[^@]+}}@scc_B -; TUNIT-SAME: (double* nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { -; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne double* [[A]], null -; TUNIT-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; TUNIT: cond.true: -; TUNIT-NEXT: [[TMP0:%.*]] = bitcast double* [[A]] to i32* -; TUNIT-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR9]] -; TUNIT-NEXT: [[TMP1:%.*]] = bitcast float* [[CALL]] to double* -; TUNIT-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR9]] -; TUNIT-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i16* -; TUNIT-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR9]] -; TUNIT-NEXT: br label [[COND_END:%.*]] -; TUNIT: cond.false: -; TUNIT-NEXT: [[TMP3:%.*]] = bitcast double* [[A]] to i8* -; TUNIT-NEXT: br label [[COND_END]] -; TUNIT: cond.end: -; TUNIT-NEXT: [[COND:%.*]] = phi i8* [ [[CALL2]], [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ] -; TUNIT-NEXT: [[TMP4:%.*]] = bitcast i8* [[COND]] to i64* -; TUNIT-NEXT: ret i64* [[TMP4]] -; -; CGSCC: Function Attrs: nofree nosync nounwind memory(none) -; CGSCC-LABEL: define {{[^@]+}}@scc_B -; CGSCC-SAME: (double* nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne double* [[A]], null -; CGSCC-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] -; CGSCC: cond.true: -; CGSCC-NEXT: [[TMP0:%.*]] = bitcast double* [[A]] to i32* -; CGSCC-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR10]] -; CGSCC-NEXT: [[TMP1:%.*]] = bitcast float* [[CALL]] to double* -; CGSCC-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR10]] -; CGSCC-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i16* -; CGSCC-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR10]] -; CGSCC-NEXT: br label [[COND_END:%.*]] -; CGSCC: cond.false: -; CGSCC-NEXT: [[TMP3:%.*]] = bitcast double* [[A]] to i8* -; CGSCC-NEXT: br label [[COND_END]] -; CGSCC: cond.end: -; CGSCC-NEXT: [[COND:%.*]] = phi i8* [ [[CALL2]], [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ] -; CGSCC-NEXT: [[TMP4:%.*]] = bitcast i8* [[COND]] to i64* -; CGSCC-NEXT: ret i64* [[TMP4]] +; CHECK: Function Attrs: nofree nosync nounwind memory(none) +; CHECK-LABEL: define {{[^@]+}}@scc_B +; CHECK-SAME: (double* nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: entry: +; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne double* [[A]], null +; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] +; CHECK: cond.true: +; CHECK-NEXT: [[TMP0:%.*]] = bitcast double* [[A]] to i32* +; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR2]] +; CHECK-NEXT: [[TMP1:%.*]] = bitcast float* [[CALL]] to double* +; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP1]]) #[[ATTR2]] +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i64* [[CALL1]] to i16* +; CHECK-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR2]] +; CHECK-NEXT: br label [[COND_END:%.*]] +; CHECK: cond.false: +; CHECK-NEXT: [[TMP3:%.*]] = bitcast double* [[A]] to i8* +; CHECK-NEXT: br label [[COND_END]] +; CHECK: cond.end: +; CHECK-NEXT: [[COND:%.*]] = phi i8* [ [[CALL2]], [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ] +; CHECK-NEXT: [[TMP4:%.*]] = bitcast i8* [[COND]] to i64* +; CHECK-NEXT: ret i64* [[TMP4]] ; entry: %tobool = icmp ne double* %a, null @@ -306,22 +284,22 @@ ; TUNIT-SAME: (i16* nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[BC:%.*]] = bitcast i16* [[A]] to i32* -; TUNIT-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR10]] ; TUNIT-NEXT: [[BC2:%.*]] = bitcast float* [[CALL]] to i8* ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[BC2]], null ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; TUNIT: cond.true: ; TUNIT-NEXT: [[TMP0:%.*]] = bitcast i16* [[A]] to double* -; TUNIT-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP1:%.*]] = bitcast i64* [[CALL1]] to i8* ; TUNIT-NEXT: br label [[COND_END:%.*]] ; TUNIT: cond.false: -; TUNIT-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10]] ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: ; TUNIT-NEXT: [[COND:%.*]] = phi i8* [ [[TMP1]], [[COND_TRUE]] ], [ [[CALL2]], [[COND_FALSE]] ] ; TUNIT-NEXT: [[TMP2:%.*]] = bitcast i8* [[COND]] to i32* -; TUNIT-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR9]] +; TUNIT-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL3]] to i8* ; TUNIT-NEXT: ret i8* [[TMP3]] ; @@ -330,22 +308,22 @@ ; CGSCC-SAME: (i16* nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[BC:%.*]] = bitcast i16* [[A]] to i32* -; CGSCC-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[BC]]) #[[ATTR11]] ; CGSCC-NEXT: [[BC2:%.*]] = bitcast float* [[CALL]] to i8* ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i8* [[BC2]], null ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]] ; CGSCC: cond.true: ; CGSCC-NEXT: [[TMP0:%.*]] = bitcast i16* [[A]] to double* -; CGSCC-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(4) i64* @scc_B(double* noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[TMP0]]) #[[ATTR11]] ; CGSCC-NEXT: [[TMP1:%.*]] = bitcast i64* [[CALL1]] to i8* ; CGSCC-NEXT: br label [[COND_END:%.*]] ; CGSCC: cond.false: -; CGSCC-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(4) i8* @scc_C(i16* noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: ; CGSCC-NEXT: [[COND:%.*]] = phi i8* [ [[TMP1]], [[COND_TRUE]] ], [ [[CALL2]], [[COND_FALSE]] ] ; CGSCC-NEXT: [[TMP2:%.*]] = bitcast i8* [[COND]] to i32* -; CGSCC-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL3:%.*]] = call dereferenceable_or_null(4) float* @scc_A(i32* noalias nofree readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[TMP2]]) #[[ATTR11]] ; CGSCC-NEXT: [[TMP3:%.*]] = bitcast float* [[CALL3]] to i8* ; CGSCC-NEXT: ret i8* [[TMP3]] ; @@ -475,16 +453,16 @@ ; TUNIT-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls ; TUNIT-SAME: (i64* nocapture nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10:[0-9]+]] -; TUNIT-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls ; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR11:[0-9]+]] -; CGSCC-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR12:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR12]] ; CGSCC-NEXT: ret void ; entry: @@ -505,14 +483,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a ; TUNIT-SAME: (i64* nofree returned writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: ret i64* [[A]] ; ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0a ; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A]]) #[[ATTR12]] ; CGSCC-NEXT: ret i64* [[CALL]] ; entry: @@ -532,7 +510,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b ; TUNIT-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[A]] to i64 ; TUNIT-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; TUNIT-NEXT: ret void @@ -541,7 +519,7 @@ ; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_0b ; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call i64* @not_captured_but_returned_0(i64* nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A]]) #[[ATTR12]] ; CGSCC-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; CGSCC-NEXT: store i64 [[TMP0]], i64* [[A]], align 8 ; CGSCC-NEXT: ret void @@ -565,14 +543,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a ; TUNIT-SAME: (i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: ret i64* [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(argmem: write) uwtable ; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1a ; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR5]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call noundef nonnull align 8 dereferenceable(8) i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR12]] ; CGSCC-NEXT: ret i64* [[CALL]] ; entry: @@ -588,20 +566,20 @@ ; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_1b(i64* %a) #0 { -; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write) uwtable +; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: readwrite) uwtable ; TUNIT-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b -; TUNIT-SAME: (i64* nofree writeonly align 8 [[A:%.*]]) #[[ATTR5:[0-9]+]] { +; TUNIT-SAME: (i64* nofree align 8 [[A:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree writeonly align 8 "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; TUNIT-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(write) uwtable +; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(write, argmem: readwrite) uwtable ; CGSCC-LABEL: define {{[^@]+}}@negative_test_not_captured_but_returned_call_1b -; CGSCC-SAME: (i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: (i64* nofree noundef nonnull align 8 dereferenceable(16) [[A:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR11]] +; CGSCC-NEXT: [[CALL:%.*]] = call align 8 i64* @not_captured_but_returned_1(i64* nofree noundef nonnull writeonly align 8 dereferenceable(16) [[A]]) #[[ATTR12]] ; CGSCC-NEXT: [[TMP0:%.*]] = ptrtoint i64* [[CALL]] to i64 ; CGSCC-NEXT: store i64 [[TMP0]], i64* [[CALL]], align 8 ; CGSCC-NEXT: ret void @@ -625,17 +603,29 @@ ; define i32* @ret_arg_or_unknown(i32* %b) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; CHECK: ret_arg: -; CHECK-NEXT: ret i32* [[B]] -; CHECK: ret_unknown: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @unknown() -; CHECK-NEXT: ret i32* [[CALL]] +; TUNIT: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable +; TUNIT-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; TUNIT-SAME: (i32* readnone [[B:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; TUNIT-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; TUNIT: ret_arg: +; TUNIT-NEXT: ret i32* [[B]] +; TUNIT: ret_unknown: +; TUNIT-NEXT: [[CALL:%.*]] = call i32* @unknown() +; TUNIT-NEXT: ret i32* [[CALL]] +; +; CGSCC: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable +; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown +; CGSCC-SAME: (i32* readnone [[B:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; CGSCC: ret_arg: +; CGSCC-NEXT: ret i32* [[B]] +; CGSCC: ret_unknown: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown() +; CGSCC-NEXT: ret i32* [[CALL]] ; entry: %cmp = icmp eq i32* %b, null @@ -650,20 +640,35 @@ } define i32* @ret_arg_or_unknown_through_phi(i32* %b) #0 { -; CHECK: Function Attrs: noinline nounwind uwtable -; CHECK-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi -; CHECK-SAME: (i32* [[B:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null -; CHECK-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] -; CHECK: ret_arg: -; CHECK-NEXT: br label [[R:%.*]] -; CHECK: ret_unknown: -; CHECK-NEXT: [[CALL:%.*]] = call i32* @unknown() -; CHECK-NEXT: br label [[R]] -; CHECK: r: -; CHECK-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] -; CHECK-NEXT: ret i32* [[PHI]] +; TUNIT: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable +; TUNIT-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; TUNIT-SAME: (i32* readnone [[B:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; TUNIT-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; TUNIT: ret_arg: +; TUNIT-NEXT: br label [[R:%.*]] +; TUNIT: ret_unknown: +; TUNIT-NEXT: [[CALL:%.*]] = call i32* @unknown() +; TUNIT-NEXT: br label [[R]] +; TUNIT: r: +; TUNIT-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; TUNIT-NEXT: ret i32* [[PHI]] +; +; CGSCC: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable +; CGSCC-LABEL: define {{[^@]+}}@ret_arg_or_unknown_through_phi +; CGSCC-SAME: (i32* readnone [[B:%.*]]) #[[ATTR7]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32* [[B]], null +; CGSCC-NEXT: br i1 [[CMP]], label [[RET_ARG:%.*]], label [[RET_UNKNOWN:%.*]] +; CGSCC: ret_arg: +; CGSCC-NEXT: br label [[R:%.*]] +; CGSCC: ret_unknown: +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @unknown() +; CGSCC-NEXT: br label [[R]] +; CGSCC: r: +; CGSCC-NEXT: [[PHI:%.*]] = phi i32* [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ] +; CGSCC-NEXT: ret i32* [[PHI]] ; entry: %cmp = icmp eq i32* %b, null @@ -689,14 +694,14 @@ define void @not_captured_by_readonly_call(i32* %b) #0 { ; TUNIT: Function Attrs: noinline nounwind memory(read) uwtable ; TUNIT-LABEL: define {{[^@]+}}@not_captured_by_readonly_call -; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: noinline nounwind memory(read) uwtable ; CGSCC-LABEL: define {{[^@]+}}@not_captured_by_readonly_call -; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]]) #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[B]]) ; CGSCC-NEXT: ret void @@ -714,16 +719,16 @@ define i32* @not_captured_by_readonly_call_not_returned_either1(i32* %b, i32* returned %r) { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 -; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR12:[0-9]+]] ; TUNIT-NEXT: ret i32* [[CALL]] ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 -; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly returned [[R:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR12:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR13:[0-9]+]] ; CGSCC-NEXT: ret i32* [[CALL]] ; entry: @@ -735,16 +740,16 @@ define i32* @not_captured_by_readonly_call_not_returned_either2(i32* %b, i32* %r) { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either2 -; TUNIT-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR11]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR12]] ; TUNIT-NEXT: ret i32* [[CALL]] ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either2 -; CGSCC-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR12]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) #[[ATTR13]] ; CGSCC-NEXT: ret i32* [[CALL]] ; entry: @@ -756,16 +761,16 @@ define i32* @not_captured_by_readonly_call_not_returned_either3(i32* %b, i32* %r) { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either3 -; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) #[[ATTR11]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) #[[ATTR12]] ; TUNIT-NEXT: ret i32* [[CALL]] ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either3 -; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (i32* nocapture readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) #[[ATTR12]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1b(i32* nocapture readonly [[B]], i32* readonly [[R]]) #[[ATTR13]] ; CGSCC-NEXT: ret i32* [[CALL]] ; entry: @@ -776,14 +781,14 @@ define i32* @not_captured_by_readonly_call_not_returned_either4(i32* %b, i32* %r) nounwind { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either4 -; TUNIT-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) ; TUNIT-NEXT: ret i32* [[CALL]] ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either4 -; CGSCC-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (i32* readonly [[B:%.*]], i32* readonly [[R:%.*]]) #[[ATTR10]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CALL:%.*]] = call i32* @readonly_unknown_r1a(i32* readonly [[B]], i32* readonly [[R]]) ; CGSCC-NEXT: ret i32* [[CALL]] @@ -831,13 +836,14 @@ ; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind memory(none) } ; TUNIT: attributes #[[ATTR3]] = { noinline nounwind uwtable } ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write) uwtable } -; TUNIT: attributes #[[ATTR6:[0-9]+]] = { memory(read) } -; TUNIT: attributes #[[ATTR7]] = { noinline nounwind memory(read) uwtable } -; TUNIT: attributes #[[ATTR8]] = { nounwind memory(read) } -; TUNIT: attributes #[[ATTR9]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR11]] = { nounwind } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(write, argmem: readwrite) uwtable } +; TUNIT: attributes #[[ATTR6]] = { noinline nounwind memory(readwrite, argmem: none) uwtable } +; TUNIT: attributes #[[ATTR7:[0-9]+]] = { memory(read) } +; TUNIT: attributes #[[ATTR8]] = { noinline nounwind memory(read) uwtable } +; TUNIT: attributes #[[ATTR9]] = { nounwind memory(read) } +; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR12]] = { nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } @@ -845,11 +851,12 @@ ; CGSCC: attributes #[[ATTR3]] = { noinline nounwind uwtable } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable } ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree noinline nosync nounwind willreturn memory(argmem: write) uwtable } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree noinline nosync nounwind willreturn memory(write) uwtable } -; CGSCC: attributes #[[ATTR7:[0-9]+]] = { memory(read) } -; CGSCC: attributes #[[ATTR8]] = { noinline nounwind memory(read) uwtable } -; CGSCC: attributes #[[ATTR9]] = { nounwind memory(read) } -; CGSCC: attributes #[[ATTR10]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR11]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR12]] = { nounwind } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree noinline nosync nounwind willreturn memory(write, argmem: readwrite) uwtable } +; CGSCC: attributes #[[ATTR7]] = { noinline nounwind memory(readwrite, argmem: none) uwtable } +; CGSCC: attributes #[[ATTR8:[0-9]+]] = { memory(read) } +; CGSCC: attributes #[[ATTR9]] = { noinline nounwind memory(read) uwtable } +; CGSCC: attributes #[[ATTR10]] = { nounwind memory(read) } +; CGSCC: attributes #[[ATTR11]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR12]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR13]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/nofree.ll =================================================================== --- llvm/test/Transforms/Attributor/nofree.ll +++ llvm/test/Transforms/Attributor/nofree.ll @@ -258,7 +258,7 @@ ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable ; CHECK-LABEL: define {{[^@]+}}@call_floor2 ; CHECK-SAME: (float [[A:%.*]]) #[[ATTR3]] { -; CHECK-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR11:[0-9]+]] +; CHECK-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR12:[0-9]+]] ; CHECK-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) @@ -300,7 +300,7 @@ ; TEST 12 NoFree argument - positive. define double @test12(double* nocapture readonly %a) { -; CHECK: Function Attrs: nofree nounwind +; CHECK: Function Attrs: nofree nounwind memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@test12 ; CHECK-SAME: (double* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: entry: @@ -319,9 +319,9 @@ ; FIXME: %a should be nofree. ; TEST 13 NoFree argument - positive. define noalias i32* @test13(i64* nocapture readonly %a) { -; CHECK: Function Attrs: nounwind +; CHECK: Function Attrs: nounwind memory(readwrite, argmem: read) ; CHECK-LABEL: define {{[^@]+}}@test13 -; CHECK-SAME: (i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR0]] { +; CHECK-SAME: (i64* nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = load i64, i64* [[A]], align 8 ; CHECK-NEXT: [[CALL:%.*]] = tail call noalias i8* @malloc(i64 [[TMP0]]) #[[ATTR2]] @@ -357,7 +357,7 @@ ; ; CHECK-LABEL: define {{[^@]+}}@nonnull_assume_pos ; CHECK-SAME: (i8* nofree [[ARG1:%.*]], i8* [[ARG2:%.*]], i8* nofree [[ARG3:%.*]], i8* [[ARG4:%.*]]) { -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR11]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR12]] [ "nofree"(i8* [[ARG1]]), "nofree"(i8* [[ARG3]]) ] ; CHECK-NEXT: call void @unknown(i8* nofree [[ARG1]], i8* [[ARG2]], i8* nofree [[ARG3]], i8* [[ARG4]]) ; CHECK-NEXT: ret void ; @@ -444,11 +444,12 @@ ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; TUNIT: attributes #[[ATTR5:[0-9]+]] = { nofree noinline nounwind memory(none) uwtable } ; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; TUNIT: attributes #[[ATTR7]] = { nofree nounwind } +; TUNIT: attributes #[[ATTR7]] = { nofree nounwind memory(readwrite, argmem: read) } ; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; TUNIT: attributes #[[ATTR9:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; TUNIT: attributes #[[ATTR11]] = { willreturn } +; TUNIT: attributes #[[ATTR9]] = { nounwind memory(readwrite, argmem: read) } +; TUNIT: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } +; TUNIT: attributes #[[ATTR12]] = { willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { nounwind } ; CGSCC: attributes #[[ATTR1]] = { noinline nounwind uwtable } @@ -457,9 +458,10 @@ ; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nofree noinline nounwind memory(none) uwtable } ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; CGSCC: attributes #[[ATTR7]] = { nofree nounwind } +; CGSCC: attributes #[[ATTR7]] = { nofree nounwind memory(readwrite, argmem: read) } ; CGSCC: attributes #[[ATTR8:[0-9]+]] = { nobuiltin nofree nounwind } -; CGSCC: attributes #[[ATTR9:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR11]] = { willreturn } +; CGSCC: attributes #[[ATTR9]] = { nounwind memory(readwrite, argmem: read) } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR12]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/nonnull.ll =================================================================== --- llvm/test/Transforms/Attributor/nonnull.ll +++ llvm/test/Transforms/Attributor/nonnull.ll @@ -34,10 +34,10 @@ ; CHECK-SAME: (i1 noundef [[C:%.*]], ptr nofree nonnull readnone returned "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] ; CHECK: A: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15:[0-9]+]] [ "nonnull"(ptr [[RET]]) ] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17:[0-9]+]] [ "nonnull"(ptr [[RET]]) ] ; CHECK-NEXT: ret ptr [[RET]] ; CHECK: B: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15]] [ "nonnull"(ptr [[RET]]) ] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17]] [ "nonnull"(ptr [[RET]]) ] ; CHECK-NEXT: ret ptr [[RET]] ; br i1 %c, label %A, label %B @@ -55,10 +55,10 @@ ; CHECK-SAME: (i1 noundef [[C:%.*]], ptr nofree nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[RET:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: br i1 [[C]], label [[A:%.*]], label [[B:%.*]] ; CHECK: A: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15]] [ "dereferenceable"(ptr [[RET]], i32 4) ] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17]] [ "dereferenceable"(ptr [[RET]], i32 4) ] ; CHECK-NEXT: ret ptr [[RET]] ; CHECK: B: -; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15]] [ "dereferenceable"(ptr [[RET]], i32 4) ] +; CHECK-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17]] [ "dereferenceable"(ptr [[RET]], i32 4) ] ; CHECK-NEXT: ret ptr [[RET]] ; br i1 %c, label %A, label %B @@ -274,7 +274,7 @@ ; CHECK-LABEL: define {{[^@]+}}@test10 ; CHECK-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[A:%.*]], i64 [[N:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: [[CMP:%.*]] = icmp ne i64 [[N]], 0 -; CHECK-NEXT: call void @llvm.assume(i1 noundef [[CMP]]) #[[ATTR15]] +; CHECK-NEXT: call void @llvm.assume(i1 noundef [[CMP]]) #[[ATTR17]] ; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, ptr [[A]], i64 [[N]] ; CHECK-NEXT: ret ptr [[B]] ; @@ -290,16 +290,29 @@ ; } ; FIXME: missing nonnull define ptr @test11(ptr) local_unnamed_addr { -; CHECK-LABEL: define {{[^@]+}}@test11 -; CHECK-SAME: (ptr [[TMP0:%.*]]) local_unnamed_addr { -; CHECK-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null -; CHECK-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] -; CHECK: 3: -; CHECK-NEXT: [[TMP4:%.*]] = tail call ptr @ret_nonnull() -; CHECK-NEXT: br label [[TMP5]] -; CHECK: 5: -; CHECK-NEXT: [[TMP6:%.*]] = phi ptr [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] -; CHECK-NEXT: ret ptr [[TMP6]] +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@test11 +; TUNIT-SAME: (ptr readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR5:[0-9]+]] { +; TUNIT-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null +; TUNIT-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; TUNIT: 3: +; TUNIT-NEXT: [[TMP4:%.*]] = tail call ptr @ret_nonnull() +; TUNIT-NEXT: br label [[TMP5]] +; TUNIT: 5: +; TUNIT-NEXT: [[TMP6:%.*]] = phi ptr [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; TUNIT-NEXT: ret ptr [[TMP6]] +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@test11 +; CGSCC-SAME: (ptr readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR4:[0-9]+]] { +; CGSCC-NEXT: [[TMP2:%.*]] = icmp eq ptr [[TMP0]], null +; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP3:%.*]], label [[TMP5:%.*]] +; CGSCC: 3: +; CGSCC-NEXT: [[TMP4:%.*]] = tail call ptr @ret_nonnull() +; CGSCC-NEXT: br label [[TMP5]] +; CGSCC: 5: +; CGSCC-NEXT: [[TMP6:%.*]] = phi ptr [ [[TMP4]], [[TMP3]] ], [ [[TMP0]], [[TMP1:%.*]] ] +; CGSCC-NEXT: ret ptr [[TMP6]] ; %2 = icmp eq ptr %0, null br i1 %2, label %3, label %5 @@ -333,15 +346,15 @@ ; TUNIT-LABEL: define {{[^@]+}}@test13_helper() { ; TUNIT-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull ptr @ret_nonnull() ; TUNIT-NEXT: [[MAYBENULLPTR:%.*]] = tail call ptr @unknown() -; TUNIT-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR5:[0-9]+]] -; TUNIT-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR5]] +; TUNIT-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR10:[0-9]+]] +; TUNIT-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@test13_helper() { ; CGSCC-NEXT: [[NONNULLPTR:%.*]] = tail call nonnull ptr @ret_nonnull() ; CGSCC-NEXT: [[MAYBENULLPTR:%.*]] = tail call ptr @unknown() -; CGSCC-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR4:[0-9]+]] -; CGSCC-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR4]] +; CGSCC-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]]) #[[ATTR9:[0-9]+]] +; CGSCC-NEXT: tail call void @test13(ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]], ptr noalias nocapture nofree readnone [[MAYBENULLPTR]], ptr noalias nocapture nofree nonnull readnone [[NONNULLPTR]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; %nonnullptr = tail call ptr @ret_nonnull() @@ -352,20 +365,20 @@ } define internal void @test13(ptr %a, ptr %b, ptr %c) { ; -; TUNIT: Function Attrs: nounwind +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@test13 -; TUNIT-SAME: (ptr noalias nocapture nofree nonnull readnone [[A:%.*]], ptr noalias nocapture nofree readnone [[B:%.*]], ptr noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR5]] { -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR5]] -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[B]]) #[[ATTR5]] -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[C]]) #[[ATTR5]] +; TUNIT-SAME: (ptr noalias nocapture nofree nonnull readnone [[A:%.*]], ptr noalias nocapture nofree readnone [[B:%.*]], ptr noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR10]] +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[B]]) #[[ATTR10]] +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[C]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nounwind +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@test13 -; CGSCC-SAME: (ptr noalias nocapture nofree nonnull readnone [[A:%.*]], ptr noalias nocapture nofree readnone [[B:%.*]], ptr noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR4]] { -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR4]] -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[B]]) #[[ATTR4]] -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[C]]) #[[ATTR4]] +; CGSCC-SAME: (ptr noalias nocapture nofree nonnull readnone [[A:%.*]], ptr noalias nocapture nofree readnone [[B:%.*]], ptr noalias nocapture nofree readnone [[C:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[A]]) #[[ATTR9]] +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[B]]) #[[ATTR9]] +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[C]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; call void @use_i8_ptr(ptr %a) @@ -392,7 +405,7 @@ ; FIXME: missing nonnull It should be nonnull @f1(ptr nonnull readonly %arg) ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@f1 -; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = icmp eq ptr [[ARG]], null ; TUNIT-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] @@ -402,11 +415,11 @@ ; TUNIT-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] ; TUNIT: bb4: ; TUNIT-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 1 -; TUNIT-NEXT: [[TMP5B:%.*]] = tail call ptr @f3(ptr nofree nonnull readonly [[TMP5]]) #[[ATTR16:[0-9]+]] +; TUNIT-NEXT: [[TMP5B:%.*]] = tail call ptr @f3(ptr nofree nonnull readonly [[TMP5]]) #[[ATTR7]] ; TUNIT-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, ptr [[TMP5B]], i64 -1 ; TUNIT-NEXT: br label [[BB9]] ; TUNIT: bb6: -; TUNIT-NEXT: [[TMP7:%.*]] = tail call ptr @f2(ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR16]] +; TUNIT-NEXT: [[TMP7:%.*]] = tail call ptr @f2(ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR18:[0-9]+]] ; TUNIT-NEXT: ret ptr [[TMP7]] ; TUNIT: bb9: ; TUNIT-NEXT: [[TMP10:%.*]] = phi ptr [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to ptr), [[BB:%.*]] ] @@ -414,7 +427,7 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@f1 -; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = icmp eq ptr [[ARG]], null ; CGSCC-NEXT: br i1 [[TMP]], label [[BB9:%.*]], label [[BB1:%.*]] @@ -424,11 +437,11 @@ ; CGSCC-NEXT: br i1 [[TMP3]], label [[BB6:%.*]], label [[BB4:%.*]] ; CGSCC: bb4: ; CGSCC-NEXT: [[TMP5:%.*]] = getelementptr inbounds i32, ptr [[ARG]], i64 1 -; CGSCC-NEXT: [[TMP5B:%.*]] = tail call ptr @f3(ptr nofree nonnull readonly [[TMP5]]) #[[ATTR16:[0-9]+]] +; CGSCC-NEXT: [[TMP5B:%.*]] = tail call ptr @f3(ptr nofree nonnull readonly [[TMP5]]) #[[ATTR6]] ; CGSCC-NEXT: [[TMP5C:%.*]] = getelementptr inbounds i32, ptr [[TMP5B]], i64 -1 ; CGSCC-NEXT: br label [[BB9]] ; CGSCC: bb6: -; CGSCC-NEXT: [[TMP7:%.*]] = tail call ptr @f2(ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR16]] +; CGSCC-NEXT: [[TMP7:%.*]] = tail call ptr @f2(ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG]]) #[[ATTR18:[0-9]+]] ; CGSCC-NEXT: ret ptr [[TMP7]] ; CGSCC: bb9: ; CGSCC-NEXT: [[TMP10:%.*]] = phi ptr [ [[TMP5C]], [[BB4]] ], [ inttoptr (i64 4 to ptr), [[BB:%.*]] ] @@ -462,16 +475,16 @@ define internal ptr @f2(ptr %arg) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@f2 -; TUNIT-SAME: (ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: bb: -; TUNIT-NEXT: [[TMP:%.*]] = tail call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR16]] +; TUNIT-NEXT: [[TMP:%.*]] = tail call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: ret ptr [[TMP]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@f2 -; CGSCC-SAME: (ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nofree nonnull readonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: bb: -; CGSCC-NEXT: [[TMP:%.*]] = tail call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR16]] +; CGSCC-NEXT: [[TMP:%.*]] = tail call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR6]] ; CGSCC-NEXT: ret ptr [[TMP]] ; bb: @@ -483,16 +496,16 @@ ; FIXME: missing nonnull. It should be nonnull @f3(ptr nonnull readonly %arg) ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@f3 -; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: bb: -; TUNIT-NEXT: [[TMP:%.*]] = call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR16]] +; TUNIT-NEXT: [[TMP:%.*]] = call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: ret ptr [[TMP]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@f3 -; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: bb: -; CGSCC-NEXT: [[TMP:%.*]] = call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR16]] +; CGSCC-NEXT: [[TMP:%.*]] = call ptr @f1(ptr nofree readonly [[ARG]]) #[[ATTR6]] ; CGSCC-NEXT: ret ptr [[TMP]] ; bb: @@ -526,26 +539,26 @@ define void @f16(ptr %a, ptr %b, i8 %c) { ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@f16 -; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr nonnull [[B]]) #[[ATTR7:[0-9]+]] +; TUNIT-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr nonnull [[B]]) #[[ATTR8:[0-9]+]] ; TUNIT-NEXT: ret void ; TUNIT: if.else: -; TUNIT-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr [[B]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr [[B]]) #[[ATTR8]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@f16 -; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR8:[0-9]+]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr nonnull [[B]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr nonnull [[B]]) #[[ATTR7:[0-9]+]] ; CGSCC-NEXT: ret void ; CGSCC: if.else: -; CGSCC-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr [[B]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun2(ptr nonnull [[A]], ptr [[B]]) #[[ATTR7]] ; CGSCC-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 @@ -568,32 +581,32 @@ ; ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@f17 -; TUNIT-SAME: (ptr nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: tail call void @fun0() #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun0() #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT:%.*]] ; TUNIT: if.else: -; TUNIT-NEXT: tail call void @fun0() #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun0() #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT]] ; TUNIT: cont: -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR8]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@f17 -; CGSCC-SAME: (ptr nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], i8 [[C:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i8 [[C]], 0 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: tail call void @fun0() #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun0() #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT:%.*]] ; CGSCC: if.else: -; CGSCC-NEXT: tail call void @fun0() #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun0() #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT]] ; CGSCC: cont: -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR7]] ; CGSCC-NEXT: ret void ; %cmp = icmp eq i8 %c, 0 @@ -622,50 +635,50 @@ define void @f18(ptr %a, ptr %b, i8 %c) { ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@f18 -; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 ; TUNIT-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: tail call void @fun0() #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun0() #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT:%.*]] ; TUNIT: if.else: -; TUNIT-NEXT: tail call void @fun0() #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun0() #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT]] ; TUNIT: cont: ; TUNIT-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 ; TUNIT-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] ; TUNIT: cont.then: -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT2:%.*]] ; TUNIT: cont.else: -; TUNIT-NEXT: tail call void @fun0() #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun0() #[[ATTR8]] ; TUNIT-NEXT: br label [[CONT2]] ; TUNIT: cont2: -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR8]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@f18 -; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr [[B:%.*]], i8 [[C:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: [[CMP1:%.*]] = icmp eq i8 [[C]], 0 ; CGSCC-NEXT: br i1 [[CMP1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: tail call void @fun0() #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun0() #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT:%.*]] ; CGSCC: if.else: -; CGSCC-NEXT: tail call void @fun0() #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun0() #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT]] ; CGSCC: cont: ; CGSCC-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 1 ; CGSCC-NEXT: br i1 [[CMP2]], label [[CONT_THEN:%.*]], label [[CONT_ELSE:%.*]] ; CGSCC: cont.then: -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT2:%.*]] ; CGSCC: cont.else: -; CGSCC-NEXT: tail call void @fun0() #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun0() #[[ATTR7]] ; CGSCC-NEXT: br label [[CONT2]] ; CGSCC: cont2: -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR7]] ; CGSCC-NEXT: ret void ; %cmp1 = icmp eq i8 %c, 0 @@ -695,32 +708,32 @@ define void @f19(ptr %a, ptr %b, i8 %c) { ; TUNIT: Function Attrs: nounwind ; TUNIT-LABEL: define {{[^@]+}}@f19 -; TUNIT-SAME: (ptr [[A:%.*]], ptr nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (ptr [[A:%.*]], ptr nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR10]] { ; TUNIT-NEXT: br label [[LOOP_HEADER:%.*]] ; TUNIT: loop.header: ; TUNIT-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 ; TUNIT-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] ; TUNIT: loop.body: -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR5]] -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR5]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR10]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR10]] ; TUNIT-NEXT: br label [[LOOP_HEADER]] ; TUNIT: loop.exit: -; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR5]] +; TUNIT-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: nounwind ; CGSCC-LABEL: define {{[^@]+}}@f19 -; CGSCC-SAME: (ptr [[A:%.*]], ptr nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (ptr [[A:%.*]], ptr nonnull [[B:%.*]], i8 [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: br label [[LOOP_HEADER:%.*]] ; CGSCC: loop.header: ; CGSCC-NEXT: [[CMP2:%.*]] = icmp eq i8 [[C]], 0 ; CGSCC-NEXT: br i1 [[CMP2]], label [[LOOP_BODY:%.*]], label [[LOOP_EXIT:%.*]] ; CGSCC: loop.body: -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR4]] -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR4]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR9]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[A]]) #[[ATTR9]] ; CGSCC-NEXT: br label [[LOOP_HEADER]] ; CGSCC: loop.exit: -; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR4]] +; CGSCC-NEXT: tail call void @fun1(ptr nonnull [[B]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; br label %loop.header @@ -856,7 +869,7 @@ define i8 @parent7(ptr %a) { ; CHECK-LABEL: define {{[^@]+}}@parent7 ; CHECK-SAME: (ptr nonnull [[A:%.*]]) { -; CHECK-NEXT: [[RET:%.*]] = call i8 @use1safecall(ptr nonnull readonly [[A]]) #[[ATTR15]] +; CHECK-NEXT: [[RET:%.*]] = call i8 @use1safecall(ptr nonnull readonly [[A]]) #[[ATTR17]] ; CHECK-NEXT: call void @use1nonnull(ptr nonnull [[A]]) ; CHECK-NEXT: ret i8 [[RET]] ; @@ -874,7 +887,7 @@ define i1 @parent8(ptr %a, ptr %bogus1, ptr %b) personality ptr @esfp{ ; TUNIT: Function Attrs: nounwind ; TUNIT-LABEL: define {{[^@]+}}@parent8 -; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr nocapture nofree readnone [[BOGUS1:%.*]], ptr nonnull [[B:%.*]]) #[[ATTR5]] personality ptr @esfp { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], ptr nocapture nofree readnone [[BOGUS1:%.*]], ptr nonnull [[B:%.*]]) #[[ATTR10]] personality ptr @esfp { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: invoke void @use2nonnull(ptr nonnull [[A]], ptr nonnull [[B]]) ; TUNIT-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] @@ -887,7 +900,7 @@ ; ; CGSCC: Function Attrs: nounwind ; CGSCC-LABEL: define {{[^@]+}}@parent8 -; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr nocapture nofree readnone [[BOGUS1:%.*]], ptr nonnull [[B:%.*]]) #[[ATTR4]] personality ptr @esfp { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], ptr nocapture nofree readnone [[BOGUS1:%.*]], ptr nonnull [[B:%.*]]) #[[ATTR9]] personality ptr @esfp { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: invoke void @use2nonnull(ptr nonnull [[A]], ptr nonnull [[B]]) ; CGSCC-NEXT: to label [[CONT:%.*]] unwind label [[EXC:%.*]] @@ -928,13 +941,13 @@ ; Should't be able to derive nonnull based on gep. ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@gep1_no_null_opt -; TUNIT-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR12:[0-9]+]] { ; TUNIT-NEXT: [[Q:%.*]] = getelementptr inbounds i32, ptr [[P]], i32 1 ; TUNIT-NEXT: ret ptr [[Q]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@gep1_no_null_opt -; CGSCC-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: [[Q:%.*]] = getelementptr inbounds i32, ptr [[P]], i32 1 ; CGSCC-NEXT: ret ptr [[Q]] ; @@ -981,8 +994,8 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@g1 -; CGSCC-SAME: () #[[ATTR10:[0-9]+]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull align 4 ptr @g2() #[[ATTR15]] +; CGSCC-SAME: () #[[ATTR12:[0-9]+]] { +; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull align 4 ptr @g2() #[[ATTR17]] ; CGSCC-NEXT: ret ptr [[C]] ; %c = call ptr @g2() @@ -991,16 +1004,16 @@ declare void @use_i32_ptr(ptr readnone nocapture) nounwind define internal void @called_by_weak(ptr %a) { -; TUNIT: Function Attrs: nounwind +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@called_by_weak -; TUNIT-SAME: (ptr noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR5]] { -; TUNIT-NEXT: call void @use_i32_ptr(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR5]] +; TUNIT-SAME: (ptr noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: call void @use_i32_ptr(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nounwind +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@called_by_weak -; CGSCC-SAME: (ptr noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR4]] { -; CGSCC-NEXT: call void @use_i32_ptr(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] +; CGSCC-SAME: (ptr noalias nocapture nonnull readnone [[A:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: call void @use_i32_ptr(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; call void @use_i32_ptr(ptr %a) @@ -1012,12 +1025,12 @@ ; ; TUNIT-LABEL: define {{[^@]+}}@weak_caller ; TUNIT-SAME: (ptr nonnull [[A:%.*]]) { -; TUNIT-NEXT: call void @called_by_weak(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR5]] +; TUNIT-NEXT: call void @called_by_weak(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@weak_caller ; CGSCC-SAME: (ptr nonnull [[A:%.*]]) { -; CGSCC-NEXT: call void @called_by_weak(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR4]] +; CGSCC-NEXT: call void @called_by_weak(ptr noalias nocapture nonnull readnone [[A]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; call void @called_by_weak(ptr %a) @@ -1026,16 +1039,16 @@ ; Expect nonnull define internal void @control(ptr dereferenceable(4) %a) { -; TUNIT: Function Attrs: nounwind +; TUNIT: Function Attrs: nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@control -; TUNIT-SAME: (ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] { -; TUNIT-NEXT: call void @use_i32_ptr(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]] +; TUNIT-SAME: (ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: call void @use_i32_ptr(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nounwind +; CGSCC: Function Attrs: nounwind memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@control -; CGSCC-SAME: (ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] { -; CGSCC-NEXT: call void @use_i32_ptr(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; CGSCC-SAME: (ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: call void @use_i32_ptr(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; call void @use_i32_ptr(ptr %a) @@ -1045,7 +1058,7 @@ define internal void @naked(ptr dereferenceable(4) %a) naked { ; CHECK: Function Attrs: naked ; CHECK-LABEL: define {{[^@]+}}@naked -; CHECK-SAME: (ptr dereferenceable(4) [[A:%.*]]) #[[ATTR11:[0-9]+]] { +; CHECK-SAME: (ptr dereferenceable(4) [[A:%.*]]) #[[ATTR13:[0-9]+]] { ; CHECK-NEXT: call void @use_i32_ptr(ptr [[A]]) ; CHECK-NEXT: ret void ; @@ -1057,7 +1070,7 @@ ; ; CHECK: Function Attrs: noinline optnone ; CHECK-LABEL: define {{[^@]+}}@optnone -; CHECK-SAME: (ptr dereferenceable(4) [[A:%.*]]) #[[ATTR12:[0-9]+]] { +; CHECK-SAME: (ptr dereferenceable(4) [[A:%.*]]) #[[ATTR14:[0-9]+]] { ; CHECK-NEXT: call void @use_i32_ptr(ptr [[A]]) ; CHECK-NEXT: ret void ; @@ -1068,14 +1081,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@make_live ; TUNIT-SAME: (ptr noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { ; TUNIT-NEXT: call void @naked(ptr noundef nonnull align 16 dereferenceable(8) [[A]]) -; TUNIT-NEXT: call void @control(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR5]] +; TUNIT-NEXT: call void @control(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR10]] ; TUNIT-NEXT: call void @optnone(ptr noundef nonnull align 16 dereferenceable(8) [[A]]) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@make_live ; CGSCC-SAME: (ptr noundef nonnull align 16 dereferenceable(8) [[A:%.*]]) { ; CGSCC-NEXT: call void @naked(ptr noundef nonnull align 16 dereferenceable(8) [[A]]) -; CGSCC-NEXT: call void @control(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR4]] +; CGSCC-NEXT: call void @control(ptr noalias nocapture noundef nonnull readnone align 16 dereferenceable(8) [[A]]) #[[ATTR9]] ; CGSCC-NEXT: call void @optnone(ptr noundef nonnull align 16 dereferenceable(8) [[A]]) ; CGSCC-NEXT: ret void ; @@ -1098,32 +1111,32 @@ ; ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; TUNIT-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: en: ; TUNIT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; TUNIT-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; TUNIT: ex: -; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR7]] +; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR8]] ; TUNIT-NEXT: ret i32 [[TMP5]] ; TUNIT: hd: ; TUNIT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; TUNIT-NEXT: tail call void @h(ptr [[A]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @h(ptr [[A]]) #[[ATTR8]] ; TUNIT-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; TUNIT-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; TUNIT-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1 -; CGSCC-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: en: ; CGSCC-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; CGSCC-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; CGSCC: ex: -; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR6]] +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR7]] ; CGSCC-NEXT: ret i32 [[TMP5]] ; CGSCC: hd: ; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; CGSCC-NEXT: tail call void @h(ptr [[A]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @h(ptr [[A]]) #[[ATTR7]] ; CGSCC-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; CGSCC-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; CGSCC-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] @@ -1148,16 +1161,16 @@ ; ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; TUNIT-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: en: ; TUNIT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; TUNIT-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; TUNIT: ex: -; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR7]] +; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR8]] ; TUNIT-NEXT: ret i32 [[TMP5]] ; TUNIT: hd: ; TUNIT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; TUNIT-NEXT: tail call void @h(ptr [[A]]) #[[ATTR7]] +; TUNIT-NEXT: tail call void @h(ptr [[A]]) #[[ATTR8]] ; TUNIT-NEXT: br label [[HD2]] ; TUNIT: hd2: ; TUNIT-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1166,16 +1179,16 @@ ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@nonnull_exec_ctx_1b -; CGSCC-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: en: ; CGSCC-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; CGSCC-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; CGSCC: ex: -; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR6]] +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR7]] ; CGSCC-NEXT: ret i32 [[TMP5]] ; CGSCC: hd: ; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; CGSCC-NEXT: tail call void @h(ptr [[A]]) #[[ATTR6]] +; CGSCC-NEXT: tail call void @h(ptr [[A]]) #[[ATTR7]] ; CGSCC-NEXT: br label [[HD2]] ; CGSCC: hd2: ; CGSCC-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1205,32 +1218,32 @@ ; ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; TUNIT-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: en: ; TUNIT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; TUNIT-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; TUNIT: ex: -; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR5]] +; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR10]] ; TUNIT-NEXT: ret i32 [[TMP5]] ; TUNIT: hd: ; TUNIT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; TUNIT-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR5]] +; TUNIT-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; TUNIT-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; TUNIT-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2 -; CGSCC-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: en: ; CGSCC-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; CGSCC-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; CGSCC: ex: -; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR4]] +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR9]] ; CGSCC-NEXT: ret i32 [[TMP5]] ; CGSCC: hd: ; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD]] ], [ 0, [[EN:%.*]] ] -; CGSCC-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR4]] +; CGSCC-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR9]] ; CGSCC-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 ; CGSCC-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], [[B]] ; CGSCC-NEXT: br i1 [[TMP9]], label [[EX]], label [[HD]] @@ -1255,16 +1268,16 @@ ; ; TUNIT: Function Attrs: mustprogress nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; TUNIT-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { +; TUNIT-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR9]] { ; TUNIT-NEXT: en: ; TUNIT-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; TUNIT-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; TUNIT: ex: -; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR5]] +; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR10]] ; TUNIT-NEXT: ret i32 [[TMP5]] ; TUNIT: hd: ; TUNIT-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; TUNIT-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR5]] +; TUNIT-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR10]] ; TUNIT-NEXT: br label [[HD2]] ; TUNIT: hd2: ; TUNIT-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1273,16 +1286,16 @@ ; ; CGSCC: Function Attrs: mustprogress nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@nonnull_exec_ctx_2b -; CGSCC-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR7]] { +; CGSCC-SAME: (ptr nonnull [[A:%.*]], i32 [[B:%.*]]) #[[ATTR8]] { ; CGSCC-NEXT: en: ; CGSCC-NEXT: [[TMP3:%.*]] = icmp eq i32 [[B]], 0 ; CGSCC-NEXT: br i1 [[TMP3]], label [[EX:%.*]], label [[HD:%.*]] ; CGSCC: ex: -; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR4]] +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @g(ptr nonnull [[A]]) #[[ATTR9]] ; CGSCC-NEXT: ret i32 [[TMP5]] ; CGSCC: hd: ; CGSCC-NEXT: [[TMP7:%.*]] = phi i32 [ [[TMP8:%.*]], [[HD2:%.*]] ], [ 0, [[EN:%.*]] ] -; CGSCC-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR4]] +; CGSCC-NEXT: tail call void @h(ptr nonnull [[A]]) #[[ATTR9]] ; CGSCC-NEXT: br label [[HD2]] ; CGSCC: hd2: ; CGSCC-NEXT: [[TMP8]] = add nuw i32 [[TMP7]], 1 @@ -1390,10 +1403,10 @@ ; We should not mark the return of @strrchr as `nonnull`, it may well be NULL! define ptr @mybasename(ptr nofree readonly %str) { -; CHECK: Function Attrs: mustprogress nofree nounwind willreturn memory(read) +; CHECK: Function Attrs: mustprogress nofree nounwind willreturn memory(read, argmem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@mybasename -; CHECK-SAME: (ptr nofree readonly [[STR:%.*]]) #[[ATTR14:[0-9]+]] { -; CHECK-NEXT: [[CALL:%.*]] = call ptr @strrchr(ptr nofree readonly [[STR]], i32 noundef 47) #[[ATTR15]] +; CHECK-SAME: (ptr nofree readonly [[STR:%.*]]) #[[ATTR16:[0-9]+]] { +; CHECK-NEXT: [[CALL:%.*]] = call ptr @strrchr(ptr nofree readonly [[STR]], i32 noundef 47) #[[ATTR17]] ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne ptr [[CALL]], null ; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, ptr [[CALL]], i64 1 ; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], ptr [[ADD_PTR]], ptr [[STR]] @@ -1414,17 +1427,19 @@ ; ATTRIBUTOR-NEXT: [[TMP1:%.*]] = call ptr @unknown() ; ATTRIBUTOR-NEXT: ret void ; +; TUNIT: Function Attrs: memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@nonnull_assume_pos -; TUNIT-SAME: (ptr nocapture nofree nonnull readnone [[ARG:%.*]]) { -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15]] [ "nonnull"(ptr [[ARG]]) ] -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] +; TUNIT-SAME: (ptr nocapture nofree nonnull readnone [[ARG:%.*]]) #[[ATTR5]] { +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17]] [ "nonnull"(ptr [[ARG]]) ] +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @unknown() ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@nonnull_assume_pos -; CGSCC-SAME: (ptr nocapture nofree nonnull readnone [[ARG:%.*]]) { -; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR15]] [ "nonnull"(ptr [[ARG]]) ] -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; CGSCC-SAME: (ptr nocapture nofree nonnull readnone [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR17]] [ "nonnull"(ptr [[ARG]]) ] +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR9]] ; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @unknown() ; CGSCC-NEXT: ret void ; @@ -1447,28 +1462,30 @@ ; ATTRIBUTOR-NEXT: ret void ; ; +; TUNIT: Function Attrs: memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@nonnull_assume_neg -; TUNIT-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[TMP1:%.*]] = call ptr @unknown() -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG]]) #[[ATTR5]] +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG]]) #[[ATTR10]] ; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(ptr [[ARG]]) ] -; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] +; TUNIT-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR10]] ; TUNIT-NEXT: [[TMP2:%.*]] = call ptr @unknown() -; TUNIT-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] +; TUNIT-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR10]] ; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(ptr [[ARG]]) ] -; TUNIT-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR5]] +; TUNIT-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR10]] ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@nonnull_assume_neg -; CGSCC-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree readnone [[ARG:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[TMP1:%.*]] = call ptr @unknown() -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree readnone [[ARG]]) #[[ATTR9]] ; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(ptr [[ARG]]) ] -; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use_i8_ptr(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR9]] ; CGSCC-NEXT: [[TMP2:%.*]] = call ptr @unknown() -; CGSCC-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR9]] ; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) [ "nonnull"(ptr [[ARG]]) ] -; CGSCC-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use_i8_ptr_ret(ptr noalias nocapture nofree nonnull readnone [[ARG]]) #[[ATTR9]] ; CGSCC-NEXT: ret void ; call ptr @unknown() @@ -1529,34 +1546,38 @@ ; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR4]] = { noreturn } -; TUNIT: attributes #[[ATTR5]] = { nounwind } -; TUNIT: attributes #[[ATTR6]] = { nofree nosync nounwind memory(argmem: read) } -; TUNIT: attributes #[[ATTR7]] = { nounwind willreturn } -; TUNIT: attributes #[[ATTR8]] = { mustprogress nounwind willreturn } -; TUNIT: attributes #[[ATTR9:[0-9]+]] = { nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } -; TUNIT: attributes #[[ATTR11]] = { naked } -; TUNIT: attributes #[[ATTR12]] = { noinline optnone } -; TUNIT: attributes #[[ATTR13:[0-9]+]] = { nofree nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR14]] = { mustprogress nofree nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR15]] = { willreturn } -; TUNIT: attributes #[[ATTR16]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR5]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR6]] = { nounwind memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR7]] = { nofree nosync nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR8]] = { nounwind willreturn } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nounwind willreturn } +; TUNIT: attributes #[[ATTR10]] = { nounwind } +; TUNIT: attributes #[[ATTR11:[0-9]+]] = { nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } +; TUNIT: attributes #[[ATTR13]] = { naked } +; TUNIT: attributes #[[ATTR14]] = { noinline optnone } +; TUNIT: attributes #[[ATTR15:[0-9]+]] = { nofree nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR16]] = { mustprogress nofree nounwind willreturn memory(read, argmem: readwrite) } +; TUNIT: attributes #[[ATTR17]] = { willreturn } +; TUNIT: attributes #[[ATTR18]] = { nofree nosync nounwind } ;. ; CGSCC: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR3]] = { noreturn } -; CGSCC: attributes #[[ATTR4]] = { nounwind } -; CGSCC: attributes #[[ATTR5]] = { nofree nosync nounwind memory(argmem: read) } -; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nounwind willreturn } -; CGSCC: attributes #[[ATTR8:[0-9]+]] = { nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR11]] = { naked } -; CGSCC: attributes #[[ATTR12]] = { noinline optnone } -; CGSCC: attributes #[[ATTR13:[0-9]+]] = { nofree nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR15]] = { willreturn } -; CGSCC: attributes #[[ATTR16]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR4]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR5]] = { nounwind memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR6]] = { nofree nosync nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR8]] = { mustprogress nounwind willreturn } +; CGSCC: attributes #[[ATTR9]] = { nounwind } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR13]] = { naked } +; CGSCC: attributes #[[ATTR14]] = { noinline optnone } +; CGSCC: attributes #[[ATTR15:[0-9]+]] = { nofree nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR16]] = { mustprogress nofree nounwind willreturn memory(read, argmem: readwrite) } +; CGSCC: attributes #[[ATTR17]] = { willreturn } +; CGSCC: attributes #[[ATTR18]] = { nofree nosync nounwind } ;. Index: llvm/test/Transforms/Attributor/norecurse.ll =================================================================== --- llvm/test/Transforms/Attributor/norecurse.ll +++ llvm/test/Transforms/Attributor/norecurse.ll @@ -69,7 +69,7 @@ ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@intrinsic ; CHECK-SAME: (i8* nocapture nofree writeonly [[DEST:%.*]], i8* nocapture nofree readonly [[SRC:%.*]], i32 [[LEN:%.*]]) #[[ATTR4:[0-9]+]] { -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR9:[0-9]+]] +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[DEST]], i8* noalias nocapture nofree readonly [[SRC]], i32 [[LEN]], i1 noundef false) #[[ATTR10:[0-9]+]] ; CHECK-NEXT: ret void ; call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 %len, i1 false) @@ -94,7 +94,7 @@ ; TUNIT: Function Attrs: norecurse nosync memory(none) ; TUNIT-LABEL: define {{[^@]+}}@m ; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR10:[0-9]+]] +; TUNIT-NEXT: [[A:%.*]] = call i32 @called_by_norecurse() #[[ATTR11:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: norecurse nosync memory(none) @@ -127,7 +127,7 @@ ; TUNIT: Function Attrs: norecurse nosync memory(none) ; TUNIT-LABEL: define {{[^@]+}}@o ; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR10]] +; TUNIT-NEXT: [[A:%.*]] = call i32 @called_by_norecurse_indirectly() #[[ATTR11]] ; TUNIT-NEXT: ret i32 [[A]] ; ; CGSCC: Function Attrs: norecurse nosync memory(none) @@ -143,7 +143,7 @@ ; TUNIT: Function Attrs: norecurse nosync memory(none) ; TUNIT-LABEL: define {{[^@]+}}@p ; TUNIT-SAME: () #[[ATTR6]] { -; TUNIT-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR10]] +; TUNIT-NEXT: [[A:%.*]] = call i32 @o() #[[ATTR11]] ; TUNIT-NEXT: ret i32 [[A]] ; ; CGSCC: Function Attrs: norecurse nosync memory(none) @@ -218,8 +218,9 @@ ; Call through a function pointer define i32 @eval_func1(i32 (i32)* , i32) local_unnamed_addr { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@eval_func1 -; CHECK-SAME: (i32 (i32)* nocapture nofree noundef nonnull [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr { +; CHECK-SAME: (i32 (i32)* nocapture nofree noundef nonnull readnone [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) ; CHECK-NEXT: ret i32 [[TMP3]] ; @@ -228,9 +229,9 @@ } define i32 @eval_func2(i32 (i32)* , i32) local_unnamed_addr null_pointer_is_valid{ -; CHECK: Function Attrs: null_pointer_is_valid +; CHECK: Function Attrs: null_pointer_is_valid memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@eval_func2 -; CHECK-SAME: (i32 (i32)* nocapture nofree noundef [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { +; CHECK-SAME: (i32 (i32)* nocapture nofree noundef readnone [[TMP0:%.*]], i32 [[TMP1:%.*]]) local_unnamed_addr #[[ATTR8:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = tail call i32 [[TMP0]](i32 [[TMP1]]) ; CHECK-NEXT: ret i32 [[TMP3]] ; @@ -257,7 +258,7 @@ define i1 @test_rec_neg(i1 %c) norecurse { ; TUNIT: Function Attrs: norecurse ; TUNIT-LABEL: define {{[^@]+}}@test_rec_neg -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: [[RC1:%.*]] = call i1 @rec(i1 noundef true) ; TUNIT-NEXT: br i1 [[RC1]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -268,7 +269,7 @@ ; ; CGSCC: Function Attrs: norecurse ; CGSCC-LABEL: define {{[^@]+}}@test_rec_neg -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: [[RC1:%.*]] = call noundef i1 @rec(i1 noundef true) ; CGSCC-NEXT: br i1 [[RC1]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -314,10 +315,11 @@ ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; TUNIT: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } ; TUNIT: attributes #[[ATTR6]] = { norecurse nosync memory(none) } -; TUNIT: attributes #[[ATTR7]] = { null_pointer_is_valid } -; TUNIT: attributes #[[ATTR8]] = { norecurse } -; TUNIT: attributes #[[ATTR9]] = { willreturn } -; TUNIT: attributes #[[ATTR10]] = { nosync } +; TUNIT: attributes #[[ATTR7]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR8]] = { null_pointer_is_valid memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR9]] = { norecurse } +; TUNIT: attributes #[[ATTR10]] = { willreturn } +; TUNIT: attributes #[[ATTR11]] = { nosync } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) } @@ -326,7 +328,8 @@ ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } ; CGSCC: attributes #[[ATTR6]] = { norecurse nosync memory(none) } -; CGSCC: attributes #[[ATTR7]] = { null_pointer_is_valid } -; CGSCC: attributes #[[ATTR8]] = { norecurse } -; CGSCC: attributes #[[ATTR9]] = { willreturn } +; CGSCC: attributes #[[ATTR7]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR8]] = { null_pointer_is_valid memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR9]] = { norecurse } +; CGSCC: attributes #[[ATTR10]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/nosync.ll =================================================================== --- llvm/test/Transforms/Attributor/nosync.ll +++ llvm/test/Transforms/Attributor/nosync.ll @@ -70,7 +70,7 @@ define void @store_monotonic(i32* nocapture %0) norecurse nounwind uwtable { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@store_monotonic -; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (i32* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[TMP0:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: store atomic i32 10, i32* [[TMP0]] monotonic, align 4 ; CHECK-NEXT: ret void ; @@ -105,7 +105,7 @@ define void @load_release(i32* nocapture %0) norecurse nounwind uwtable { ; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@load_release -; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[TMP0:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i32* nocapture nofree noundef align 4 [[TMP0:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0]] release, align 4 ; CHECK-NEXT: ret void ; @@ -118,7 +118,7 @@ define void @load_volatile_release(i32* nocapture %0) norecurse nounwind uwtable { ; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable ; CHECK-LABEL: define {{[^@]+}}@load_volatile_release -; CHECK-SAME: (i32* nocapture nofree noundef writeonly align 4 [[TMP0:%.*]]) #[[ATTR2]] { +; CHECK-SAME: (i32* nocapture nofree noundef align 4 [[TMP0:%.*]]) #[[ATTR2]] { ; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0]] release, align 4 ; CHECK-NEXT: ret void ; @@ -203,7 +203,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@scc1 ; TUNIT-SAME: (i32* nofree [[TMP0:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: tail call void @scc2(i32* nofree [[TMP0]]) #[[ATTR19:[0-9]+]] -; TUNIT-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR19]] +; TUNIT-NEXT: [[VAL:%.*]] = tail call i32 @volatile_load(i32* nofree align 4 [[TMP0]]) #[[ATTR20:[0-9]+]] ; TUNIT-NEXT: ret i32 [[VAL]] ; ; CGSCC: Function Attrs: nofree noinline nounwind memory(argmem: readwrite) uwtable @@ -251,7 +251,7 @@ define void @foo1(i32* %0, %"struct.std::atomic"* %1) { ; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@foo1 -; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull dereferenceable(1) [[TMP1:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: store i32 100, i32* [[TMP0]], align 4 ; CHECK-NEXT: fence release ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 @@ -268,7 +268,7 @@ define void @bar(i32* %0, %"struct.std::atomic"* %1) { ; CHECK: Function Attrs: nofree norecurse nounwind ; CHECK-LABEL: define {{[^@]+}}@bar -; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull dereferenceable(1) [[TMP1:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 ; CHECK-NEXT: br label [[TMP4:%.*]] ; CHECK: 4: @@ -298,7 +298,7 @@ define void @foo1_singlethread(i32* %0, %"struct.std::atomic"* %1) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@foo1_singlethread -; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull writeonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull dereferenceable(1) [[TMP1:%.*]]) #[[ATTR8:[0-9]+]] { ; CHECK-NEXT: store i32 100, i32* [[TMP0]], align 4 ; CHECK-NEXT: fence syncscope("singlethread") release ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 @@ -315,7 +315,7 @@ define void @bar_singlethread(i32* %0, %"struct.std::atomic"* %1) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind ; CHECK-LABEL: define {{[^@]+}}@bar_singlethread -; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull readonly dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree readnone [[TMP0:%.*]], %"struct.std::atomic"* nocapture nofree nonnull dereferenceable(1) [[TMP1:%.*]]) #[[ATTR9:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds %"struct.std::atomic", %"struct.std::atomic"* [[TMP1]], i64 0, i32 0, i32 0 ; CHECK-NEXT: br label [[TMP4:%.*]] ; CHECK: 4: @@ -349,11 +349,17 @@ ; It is odd to add nocapture but a result of the llvm.memcpy nocapture. ; define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) -; CHECK-LABEL: define {{[^@]+}}@memcpy_volatile -; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] -; CHECK-NEXT: ret i32 4 +; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) +; TUNIT-LABEL: define {{[^@]+}}@memcpy_volatile +; TUNIT-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; TUNIT-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR21:[0-9]+]] +; TUNIT-NEXT: ret i32 4 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) +; CGSCC-LABEL: define {{[^@]+}}@memcpy_volatile +; CGSCC-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8* nocapture nofree readonly [[PTR2:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree writeonly [[PTR1]], i8* noalias nocapture nofree readonly [[PTR2]], i32 noundef 8, i1 noundef true) #[[ATTR20:[0-9]+]] +; CGSCC-NEXT: ret i32 4 ; call void @llvm.memcpy(i8* %ptr1, i8* %ptr2, i32 8, i1 1) ret i32 4 @@ -364,11 +370,17 @@ ; It is odd to add nocapture but a result of the llvm.memset nocapture. ; define i32 @memset_non_volatile(i8* %ptr1, i8 %val) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) -; CHECK-LABEL: define {{[^@]+}}@memset_non_volatile -; CHECK-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { -; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20]] -; CHECK-NEXT: ret i32 4 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) +; TUNIT-LABEL: define {{[^@]+}}@memset_non_volatile +; TUNIT-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; TUNIT-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR21]] +; TUNIT-NEXT: ret i32 4 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) +; CGSCC-LABEL: define {{[^@]+}}@memset_non_volatile +; CGSCC-SAME: (i8* nocapture nofree writeonly [[PTR1:%.*]], i8 [[VAL:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-NEXT: call void @llvm.memset.p0i8.i32(i8* nocapture nofree writeonly [[PTR1]], i8 [[VAL]], i32 noundef 8, i1 noundef false) #[[ATTR20]] +; CGSCC-NEXT: ret i32 4 ; call void @llvm.memset(i8* %ptr1, i8 %val, i32 8, i1 0) ret i32 4 @@ -433,35 +445,64 @@ } define float @cos_test2(float %x) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@cos_test2 -; CHECK-SAME: (float [[X:%.*]]) #[[ATTR15]] { -; CHECK-NEXT: [[C:%.*]] = call nofpclass(inf) float @llvm.cos.f32(float [[X]]) #[[ATTR20]] -; CHECK-NEXT: ret float [[C]] +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@cos_test2 +; TUNIT-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; TUNIT-NEXT: [[C:%.*]] = call nofpclass(inf) float @llvm.cos.f32(float [[X]]) #[[ATTR21]] +; TUNIT-NEXT: ret float [[C]] +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@cos_test2 +; CGSCC-SAME: (float [[X:%.*]]) #[[ATTR15]] { +; CGSCC-NEXT: [[C:%.*]] = call nofpclass(inf) float @llvm.cos.f32(float [[X]]) #[[ATTR20]] +; CGSCC-NEXT: ret float [[C]] ; %c = call float @llvm.cos(float %x) ret float %c } ;. -; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind optsize ssp willreturn memory(none) uwtable } -; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } -; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable } -; CHECK: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } -; CHECK: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; CHECK: attributes #[[ATTR5]] = { nofree noinline nounwind memory(argmem: readwrite) uwtable } -; CHECK: attributes #[[ATTR6]] = { mustprogress nofree norecurse nounwind willreturn } -; CHECK: attributes #[[ATTR7]] = { nofree norecurse nounwind } -; CHECK: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CHECK: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } -; CHECK: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CHECK: attributes #[[ATTR12:[0-9]+]] = { convergent memory(none) } -; CHECK: attributes #[[ATTR13]] = { memory(none) } -; CHECK: attributes #[[ATTR14]] = { nounwind } -; CHECK: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CHECK: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; CHECK: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; CHECK: attributes #[[ATTR19]] = { nofree nounwind } -; CHECK: attributes #[[ATTR20]] = { willreturn } +; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind optsize ssp willreturn memory(none) uwtable } +; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable } +; TUNIT: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; TUNIT: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; TUNIT: attributes #[[ATTR5]] = { nofree noinline nounwind memory(argmem: readwrite) uwtable } +; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nounwind willreturn } +; TUNIT: attributes #[[ATTR7]] = { nofree norecurse nounwind } +; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR12:[0-9]+]] = { convergent memory(none) } +; TUNIT: attributes #[[ATTR13]] = { memory(none) } +; TUNIT: attributes #[[ATTR14]] = { nounwind } +; TUNIT: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +; TUNIT: attributes #[[ATTR19]] = { nofree nounwind memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR20]] = { nofree nounwind } +; TUNIT: attributes #[[ATTR21]] = { willreturn } +;. +; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind optsize ssp willreturn memory(none) uwtable } +; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) uwtable } +; CGSCC: attributes #[[ATTR3]] = { noinline nosync nounwind uwtable } +; CGSCC: attributes #[[ATTR4]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR5]] = { nofree noinline nounwind memory(argmem: readwrite) uwtable } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nounwind willreturn } +; CGSCC: attributes #[[ATTR7]] = { nofree norecurse nounwind } +; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; CGSCC: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR12:[0-9]+]] = { convergent memory(none) } +; CGSCC: attributes #[[ATTR13]] = { memory(none) } +; CGSCC: attributes #[[ATTR14]] = { nounwind } +; CGSCC: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +; CGSCC: attributes #[[ATTR19]] = { nofree nounwind memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR20]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/noundef.ll =================================================================== --- llvm/test/Transforms/Attributor/noundef.ll +++ llvm/test/Transforms/Attributor/noundef.ll @@ -38,8 +38,9 @@ } define internal void @argument_dead_callback_callee(ptr %c) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@argument_dead_callback_callee -; CHECK-SAME: (ptr noalias nocapture nofree readnone align 4294967296 [[C:%.*]]) { +; CHECK-SAME: (ptr noalias nocapture nofree readnone align 4294967296 [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: call void @unknown() ; CHECK-NEXT: ret void ; @@ -49,11 +50,11 @@ define void @callback_caller() { ; TUNIT-LABEL: define {{[^@]+}}@callback_caller() { -; TUNIT-NEXT: call void @callback_broker(ptr noundef @argument_dead_callback_callee, ptr noalias nocapture nofree readnone align 4294967296 undef) +; TUNIT-NEXT: call void @callback_broker(ptr noundef @argument_dead_callback_callee, ptr noalias nocapture nofree align 4294967296 undef) ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@callback_caller() { -; CGSCC-NEXT: call void @callback_broker(ptr noundef @argument_dead_callback_callee, ptr noalias nocapture nofree noundef readnone align 4294967296 null) +; CGSCC-NEXT: call void @callback_broker(ptr noalias noundef readnone @argument_dead_callback_callee, ptr noalias nocapture nofree noundef align 4294967296 null) ; CGSCC-NEXT: ret void ; call void @callback_broker(ptr @argument_dead_callback_callee, ptr null) @@ -139,6 +140,8 @@ !1 = !{i64 0, i64 1, i1 false} !0 = !{!1} ;. +; CHECK: attributes #[[ATTR0]] = { memory(readwrite, argmem: none) } +;. ; CHECK: [[META0:![0-9]+]] = !{!1} ; CHECK: [[META1:![0-9]+]] = !{i64 0, i64 1, i1 false} ;. Index: llvm/test/Transforms/Attributor/openmp_parallel.ll =================================================================== --- llvm/test/Transforms/Attributor/openmp_parallel.ll +++ llvm/test/Transforms/Attributor/openmp_parallel.ll @@ -28,7 +28,7 @@ ; TUNIT-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8 ; TUNIT-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 8 -; TUNIT-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, ptr noundef @.omp_outlined., ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) undef, ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]]) +; TUNIT-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, ptr noundef readonly @.omp_outlined., ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) undef, ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], ptr nocapture nofree noundef nonnull align 8 dereferenceable(8) [[B_ADDR]]) ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: nounwind uwtable @@ -41,7 +41,7 @@ ; CGSCC-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8 ; CGSCC-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 8 ; CGSCC-NEXT: store i32 199, ptr [[N_ADDR]], align 4 -; CGSCC-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, ptr noundef @.omp_outlined., ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], ptr nofree noundef nonnull readonly align 8 dereferenceable(8) [[B_ADDR]]) +; CGSCC-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, ptr noundef readonly @.omp_outlined., ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr nofree noundef nonnull readonly align 8 dereferenceable(8) [[A_ADDR]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[B_ADDR]]) ; CGSCC-NEXT: ret void ; entry: @@ -60,7 +60,7 @@ define internal void @.omp_outlined.(ptr noalias nocapture readonly %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %N, ptr nocapture nonnull readonly align 8 dereferenceable(8) %a, ptr nocapture nonnull readonly align 8 dereferenceable(8) %b) #1 { ; TUNIT: Function Attrs: alwaysinline nofree norecurse nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@.omp_outlined. -; TUNIT-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr noalias nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree nonnull readnone align 4 dereferenceable(4) [[N:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4 @@ -68,7 +68,7 @@ ; TUNIT-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: br label [[OMP_PRECOND_THEN:%.*]] ; TUNIT: omp.precond.then: -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]]) #[[ATTR3:[0-9]+]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]]) ; TUNIT-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4 ; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]]) ; TUNIT-NEXT: store i32 197, ptr [[DOTOMP_UB]], align 4 @@ -113,7 +113,7 @@ ; ; CGSCC: Function Attrs: alwaysinline nofree norecurse nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@.omp_outlined. -; CGSCC-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], ptr noalias nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4 @@ -124,7 +124,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1 ; CGSCC-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]] ; CGSCC: omp.precond.then: -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]]) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_LB]]) ; CGSCC-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4 ; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[DOTOMP_UB]]) ; CGSCC-NEXT: store i32 [[SUB2]], ptr [[DOTOMP_UB]], align 4 @@ -253,7 +253,6 @@ ; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind uwtable } ; CHECK: attributes #[[ATTR1:[0-9]+]] = { alwaysinline nofree norecurse nounwind uwtable } ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CHECK: attributes #[[ATTR3:[0-9]+]] = { memory(readwrite) } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} ; CHECK: [[META1:![0-9]+]] = !{!2} Index: llvm/test/Transforms/Attributor/pointer-info.ll =================================================================== --- llvm/test/Transforms/Attributor/pointer-info.ll +++ llvm/test/Transforms/Attributor/pointer-info.ll @@ -14,19 +14,19 @@ ; TUNIT-NEXT: br label [[CALL_BR:%.*]] ; TUNIT: call.br: ; TUNIT-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_TEST_A]], ptr [[TMP0]], i64 0, i32 2 -; TUNIT-NEXT: tail call void @bar(ptr noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_TEST_A]]) align 8 dereferenceable(24) [[TMP0]]) #[[ATTR2:[0-9]+]] +; TUNIT-NEXT: tail call void @bar(ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_TEST_A]]) align 8 dereferenceable(24) [[TMP0]]) #[[ATTR2:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@foo -; CGSCC-SAME: (ptr nocapture nofree writeonly [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree readnone [[PTR:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = alloca [[STRUCT_TEST_A:%.*]], align 8 ; CGSCC-NEXT: br label [[CALL_BR:%.*]] ; CGSCC: call.br: ; CGSCC-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_TEST_A]], ptr [[TMP0]], i64 0, i32 2 ; CGSCC-NEXT: store ptr [[PTR]], ptr [[TMP1]], align 8 -; CGSCC-NEXT: tail call void @bar(ptr noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_TEST_A]]) align 8 dereferenceable(24) [[TMP0]]) #[[ATTR2:[0-9]+]] +; CGSCC-NEXT: tail call void @bar(ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_TEST_A]]) align 8 dereferenceable(24) [[TMP0]]) #[[ATTR2:[0-9]+]] ; CGSCC-NEXT: ret void ; entry: @@ -43,7 +43,7 @@ define void @bar(ptr noundef byval(%struct.test.a) align 8 %dev) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@bar -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_TEST_A:%.*]]) align 8 dereferenceable(24) [[DEV:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_TEST_A:%.*]]) align 8 dereferenceable(24) [[DEV:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT_TEST_B:%.*]], ptr [[DEV]], i64 0, i32 1 ; CHECK-NEXT: store i32 1, ptr [[TMP1]], align 4 ; CHECK-NEXT: ret void @@ -55,7 +55,7 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(argmem: write) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } Index: llvm/test/Transforms/Attributor/range.ll =================================================================== --- llvm/test/Transforms/Attributor/range.ll +++ llvm/test/Transforms/Attributor/range.ll @@ -19,13 +19,13 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test0-range-check ; TUNIT-SAME: (ptr nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; TUNIT-NEXT: [[A:%.*]] = tail call i32 @test0(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR3:[0-9]+]], !range [[RNG0]] +; TUNIT-NEXT: [[A:%.*]] = tail call i32 @test0(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR4:[0-9]+]], !range [[RNG0]] ; TUNIT-NEXT: ret i32 [[A]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test0-range-check ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[A:%.*]] = tail call i32 @test0(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: [[A:%.*]] = tail call i32 @test0(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR6:[0-9]+]] ; CGSCC-NEXT: ret i32 [[A]] ; %a = tail call i32 @test0(ptr %p) @@ -46,9 +46,10 @@ ; TEST0 icmp test define void @test0-icmp-check(ptr %p){ ; ret = [0, 10) +; TUNIT: Function Attrs: memory(readwrite, argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test0-icmp-check -; TUNIT-SAME: (ptr nocapture nofree readonly align 4 [[P:%.*]]) { -; TUNIT-NEXT: [[RET:%.*]] = tail call i32 @test0(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR3]], !range [[RNG0]] +; TUNIT-SAME: (ptr nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-NEXT: [[RET:%.*]] = tail call i32 @test0(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR4]], !range [[RNG0]] ; TUNIT-NEXT: [[CMP_EQ_1:%.*]] = icmp eq i32 [[RET]], 10 ; TUNIT-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 ; TUNIT-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 @@ -115,9 +116,10 @@ ; TUNIT-NEXT: tail call void @use3(i1 [[CMP_LTE_4]], i1 [[CMP_LTE_5]], i1 [[CMP_LTE_6]]) ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test0-icmp-check -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) { -; CGSCC-NEXT: [[RET:%.*]] = tail call i32 @test0(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR5]] +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-NEXT: [[RET:%.*]] = tail call i32 @test0(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR6]] ; CGSCC-NEXT: [[CMP_EQ_1:%.*]] = icmp eq i32 [[RET]], 10 ; CGSCC-NEXT: [[CMP_EQ_2:%.*]] = icmp eq i32 [[RET]], 9 ; CGSCC-NEXT: [[CMP_EQ_3:%.*]] = icmp eq i32 [[RET]], 8 @@ -288,14 +290,14 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@test1-check ; TUNIT-SAME: (ptr nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { -; TUNIT-NEXT: [[RES:%.*]] = tail call i32 @test1(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR3]], !range [[RNG2:![0-9]+]] +; TUNIT-NEXT: [[RES:%.*]] = tail call i32 @test1(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR4]], !range [[RNG2:![0-9]+]] ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 ; TUNIT-NEXT: ret i1 [[CMP]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@test1-check ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[RES:%.*]] = tail call i32 @test1(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR5]] +; CGSCC-NEXT: [[RES:%.*]] = tail call i32 @test1(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR6]] ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[RES]], 500 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -338,7 +340,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@test2_check ; TUNIT-SAME: (ptr nocapture nofree readonly align 4 [[P:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test2(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test2(ptr nocapture nofree readonly align 4 [[P]]) #[[ATTR4]] ; TUNIT-NEXT: [[CMP:%.*]] = icmp slt i32 [[CALL]], 5 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: @@ -353,7 +355,7 @@ ; CGSCC-LABEL: define {{[^@]+}}@test2_check ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test2(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR5]] +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test2(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]]) #[[ATTR6]] ; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[CALL]], 5 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: @@ -410,7 +412,7 @@ define internal i32 @r1(i32) local_unnamed_addr { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@r1 -; TUNIT-SAME: () local_unnamed_addr #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { ; TUNIT-NEXT: br label [[TMP4:%.*]] ; TUNIT: 1: ; TUNIT-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 @@ -429,7 +431,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@r1 -; CGSCC-SAME: () local_unnamed_addr #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: () local_unnamed_addr #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: br label [[TMP4:%.*]] ; CGSCC: 1: ; CGSCC-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[TMP7:%.*]], 10000 @@ -467,7 +469,7 @@ define void @f1(i32){ ; TUNIT-LABEL: define {{[^@]+}}@f1 ; TUNIT-SAME: (i32 [[TMP0:%.*]]) { -; TUNIT-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR3]] +; TUNIT-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR4]] ; TUNIT-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 ; TUNIT-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] ; TUNIT: 4: @@ -478,7 +480,7 @@ ; ; CGSCC-LABEL: define {{[^@]+}}@f1 ; CGSCC-SAME: (i32 [[TMP0:%.*]]) { -; CGSCC-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR5]] +; CGSCC-NEXT: [[TMP2:%.*]] = tail call i32 @r1() #[[ATTR6]] ; CGSCC-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP2]], 15 ; CGSCC-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP5:%.*]] ; CGSCC: 4: @@ -512,7 +514,7 @@ define dso_local i32 @test4-f1(i32 %u) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test4-f1 -; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] @@ -524,7 +526,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test4-f1 -; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]] @@ -551,16 +553,16 @@ define dso_local i32 @test4-g1(i32 %u) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test4-g1 -; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR4]] ; TUNIT-NEXT: ret i32 [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test4-g1 -; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR5]] +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f1(i32 [[U]]) #[[ATTR6]] ; CGSCC-NEXT: ret i32 [[CALL]] ; ; FIXME: %call should have range [0, inf] @@ -581,7 +583,7 @@ define dso_local i32 @test4-f2(i32 %u) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test4-f2 -; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] @@ -596,7 +598,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test4-f2 -; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[U]], -1 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] @@ -629,16 +631,16 @@ define dso_local i32 @test4-g2(i32 %u) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test4-g2 -; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[U:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR3]], !range [[RNG3:![0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR4]], !range [[RNG3:![0-9]+]] ; TUNIT-NEXT: ret i32 [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test4-g2 -; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i32 [[U:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR5]] +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @test4-f2(i32 [[U]]) #[[ATTR6]] ; CGSCC-NEXT: ret i32 [[CALL]] ; entry: @@ -720,7 +722,7 @@ define dso_local zeroext i1 @phi(i32 %arg) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@phi -; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 ; TUNIT-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] @@ -752,7 +754,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@phi -; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = icmp sgt i32 [[ARG]], 5 ; CGSCC-NEXT: br i1 [[TMP]], label [[BB1:%.*]], label [[BB2:%.*]] @@ -824,7 +826,7 @@ define dso_local i1 @select(i32 %a) local_unnamed_addr #0 { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@select -; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; TUNIT-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -836,7 +838,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@select -; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; CGSCC-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -859,7 +861,7 @@ define dso_local i32 @select_zext(i32 %a) local_unnamed_addr #0 { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@select_zext -; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; TUNIT-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -872,7 +874,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@select_zext -; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; CGSCC-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -897,7 +899,7 @@ define dso_local i64 @select_int2ptr_bitcast_ptr2int(i32 %a) local_unnamed_addr #0 { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR1]] { +; TUNIT-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; TUNIT-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -911,7 +913,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@select_int2ptr_bitcast_ptr2int -; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR2]] { +; CGSCC-SAME: (i32 [[A:%.*]]) local_unnamed_addr #[[ATTR3]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 5 ; CGSCC-NEXT: [[DOT:%.*]] = select i1 [[CMP]], i32 1, i32 2 @@ -940,14 +942,14 @@ define i1 @f_fcmp(float %a, float %b) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@f_fcmp -; TUNIT-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] ; TUNIT-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; TUNIT-NEXT: ret i1 [[S]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@f_fcmp -; CGSCC-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (float [[A:%.*]], float [[B:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[R:%.*]] = fcmp uge float [[A]], [[B]] ; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; CGSCC-NEXT: ret i1 [[S]] @@ -959,14 +961,14 @@ define i1 @d_fcmp(double %a, double %b) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@d_fcmp -; TUNIT-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] ; TUNIT-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; TUNIT-NEXT: ret i1 [[S]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@d_fcmp -; CGSCC-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (double [[A:%.*]], double [[B:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[R:%.*]] = fcmp oeq double [[A]], [[B]] ; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; CGSCC-NEXT: ret i1 [[S]] @@ -978,14 +980,14 @@ define i1 @dp_icmp(ptr %a, ptr %b) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@dp_icmp -; TUNIT-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[R:%.*]] = icmp sge ptr [[A]], [[B]] ; TUNIT-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; TUNIT-NEXT: ret i1 [[S]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@dp_icmp -; CGSCC-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[R:%.*]] = icmp sge ptr [[A]], [[B]] ; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; CGSCC-NEXT: ret i1 [[S]] @@ -997,14 +999,14 @@ define i1 @ip_icmp(ptr %a, ptr %b) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ip_icmp -; TUNIT-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[R:%.*]] = icmp ult ptr [[A]], [[B]] ; TUNIT-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; TUNIT-NEXT: ret i1 [[S]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ip_icmp -; CGSCC-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree readnone [[A:%.*]], ptr nofree readnone [[B:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[R:%.*]] = icmp ult ptr [[A]], [[B]] ; CGSCC-NEXT: [[S:%.*]] = select i1 [[R]], i1 [[R]], i1 false ; CGSCC-NEXT: ret i1 [[S]] @@ -1016,11 +1018,11 @@ define i1 @fcmp_caller(float %fa, float %fb, double %da, double %db, ptr %dpa, ptr %dpb, ptr %ipa, ptr %ipb) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@fcmp_caller -; TUNIT-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], ptr nofree readnone [[DPA:%.*]], ptr nofree readnone [[DPB:%.*]], ptr nofree readnone [[IPA:%.*]], ptr nofree readnone [[IPB:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR3]] -; TUNIT-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR3]] -; TUNIT-NEXT: [[R3:%.*]] = call i1 @dp_icmp(ptr noalias nofree readnone [[DPA]], ptr noalias nofree readnone [[DPB]]) #[[ATTR3]] -; TUNIT-NEXT: [[R4:%.*]] = call i1 @ip_icmp(ptr noalias nofree readnone [[IPA]], ptr noalias nofree readnone [[IPB]]) #[[ATTR3]] +; TUNIT-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], ptr nofree readnone [[DPA:%.*]], ptr nofree readnone [[DPB:%.*]], ptr nofree readnone [[IPA:%.*]], ptr nofree readnone [[IPB:%.*]]) #[[ATTR2]] { +; TUNIT-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR4]] +; TUNIT-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR4]] +; TUNIT-NEXT: [[R3:%.*]] = call i1 @dp_icmp(ptr noalias nofree readnone [[DPA]], ptr noalias nofree readnone [[DPB]]) #[[ATTR4]] +; TUNIT-NEXT: [[R4:%.*]] = call i1 @ip_icmp(ptr noalias nofree readnone [[IPA]], ptr noalias nofree readnone [[IPB]]) #[[ATTR4]] ; TUNIT-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] ; TUNIT-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] ; TUNIT-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] @@ -1028,11 +1030,11 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@fcmp_caller -; CGSCC-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], ptr nofree readnone [[DPA:%.*]], ptr nofree readnone [[DPB:%.*]], ptr nofree readnone [[IPA:%.*]], ptr nofree readnone [[IPB:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR5]] -; CGSCC-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR5]] -; CGSCC-NEXT: [[R3:%.*]] = call i1 @dp_icmp(ptr noalias nofree readnone [[DPA]], ptr noalias nofree readnone [[DPB]]) #[[ATTR5]] -; CGSCC-NEXT: [[R4:%.*]] = call i1 @ip_icmp(ptr noalias nofree readnone [[IPA]], ptr noalias nofree readnone [[IPB]]) #[[ATTR5]] +; CGSCC-SAME: (float [[FA:%.*]], float [[FB:%.*]], double [[DA:%.*]], double [[DB:%.*]], ptr nofree readnone [[DPA:%.*]], ptr nofree readnone [[DPB:%.*]], ptr nofree readnone [[IPA:%.*]], ptr nofree readnone [[IPB:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[R1:%.*]] = call i1 @f_fcmp(float [[FA]], float [[FB]]) #[[ATTR6]] +; CGSCC-NEXT: [[R2:%.*]] = call i1 @d_fcmp(double [[DA]], double [[DB]]) #[[ATTR6]] +; CGSCC-NEXT: [[R3:%.*]] = call i1 @dp_icmp(ptr noalias nofree readnone [[DPA]], ptr noalias nofree readnone [[DPB]]) #[[ATTR6]] +; CGSCC-NEXT: [[R4:%.*]] = call i1 @ip_icmp(ptr noalias nofree readnone [[IPA]], ptr noalias nofree readnone [[IPB]]) #[[ATTR6]] ; CGSCC-NEXT: [[O1:%.*]] = or i1 [[R1]], [[R2]] ; CGSCC-NEXT: [[O2:%.*]] = or i1 [[R3]], [[R4]] ; CGSCC-NEXT: [[O3:%.*]] = or i1 [[O1]], [[O2]] @@ -1051,12 +1053,12 @@ define i8 @ret_two() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ret_two -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i8 2 ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ret_two -; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-SAME: () #[[ATTR3]] { ; CGSCC-NEXT: ret i8 2 ; ret i8 2 @@ -1064,12 +1066,12 @@ define i8 @ret_undef() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ret_undef -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i8 undef ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ret_undef -; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-SAME: () #[[ATTR3]] { ; CGSCC-NEXT: ret i8 undef ; ret i8 undef @@ -1079,13 +1081,13 @@ define i8 @undef_collapse_1() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@undef_collapse_1 -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i8 0 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_1 -; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: [[C:%.*]] = call i8 @ret_undef() #[[ATTR5]] +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: [[C:%.*]] = call i8 @ret_undef() #[[ATTR6]] ; CGSCC-NEXT: [[S:%.*]] = shl i8 [[C]], 2 ; CGSCC-NEXT: ret i8 [[S]] ; @@ -1098,13 +1100,13 @@ define i8 @undef_collapse_2() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@undef_collapse_2 -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i8 0 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_2 -; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: [[C:%.*]] = call i8 @ret_two() #[[ATTR5]] +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: [[C:%.*]] = call i8 @ret_two() #[[ATTR6]] ; CGSCC-NEXT: [[S:%.*]] = shl i8 undef, [[C]] ; CGSCC-NEXT: ret i8 [[S]] ; @@ -1117,14 +1119,14 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@undef_collapse_caller -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i8 0 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@undef_collapse_caller -; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: [[C1:%.*]] = call i8 @undef_collapse_1() #[[ATTR5]] -; CGSCC-NEXT: [[C2:%.*]] = call i8 @undef_collapse_2() #[[ATTR5]] +; CGSCC-SAME: () #[[ATTR4]] { +; CGSCC-NEXT: [[C1:%.*]] = call i8 @undef_collapse_1() #[[ATTR6]] +; CGSCC-NEXT: [[C2:%.*]] = call i8 @undef_collapse_2() #[[ATTR6]] ; CGSCC-NEXT: [[A:%.*]] = add i8 [[C1]], [[C2]] ; CGSCC-NEXT: ret i8 [[A]] ; @@ -1137,13 +1139,13 @@ define i32 @ret1or2(i1 %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ret1or2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 ; TUNIT-NEXT: ret i32 [[S]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ret1or2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[S:%.*]] = select i1 [[C]], i32 1, i32 2 ; CGSCC-NEXT: ret i32 [[S]] ; @@ -1154,9 +1156,9 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@callee_range_1 -; TUNIT-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]] -; TUNIT-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]] +; TUNIT-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR2]] { +; TUNIT-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR4]] +; TUNIT-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR4]] ; TUNIT-NEXT: [[INDIRECTION:%.*]] = select i1 [[C3]], i32 [[R1]], i32 [[R2]] ; TUNIT-NEXT: [[A:%.*]] = add i32 [[R1]], [[INDIRECTION]] ; TUNIT-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 4 @@ -1166,9 +1168,9 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@callee_range_1 -; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR5]] -; CGSCC-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR5]] +; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]], i1 [[C3:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR6]] +; CGSCC-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR6]] ; CGSCC-NEXT: [[INDIRECTION:%.*]] = select i1 [[C3]], i32 [[R1]], i32 [[R2]] ; CGSCC-NEXT: [[A:%.*]] = add i32 [[R1]], [[INDIRECTION]] ; CGSCC-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 4 @@ -1190,9 +1192,9 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@callee_range_2 -; TUNIT-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR3]] -; TUNIT-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR3]] +; TUNIT-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR2]] { +; TUNIT-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR4]] +; TUNIT-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR4]] ; TUNIT-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] ; TUNIT-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 ; TUNIT-NEXT: [[I2:%.*]] = icmp sge i32 [[A]], 2 @@ -1201,9 +1203,9 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@callee_range_2 -; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR5]] -; CGSCC-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR5]] +; CGSCC-SAME: (i1 [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[R1:%.*]] = call i32 @ret1or2(i1 [[C1]]) #[[ATTR6]] +; CGSCC-NEXT: [[R2:%.*]] = call i32 @ret1or2(i1 [[C2]]) #[[ATTR6]] ; CGSCC-NEXT: [[A:%.*]] = add i32 [[R1]], [[R2]] ; CGSCC-NEXT: [[I1:%.*]] = icmp sle i32 [[A]], 3 ; CGSCC-NEXT: [[I2:%.*]] = icmp sge i32 [[A]], 2 @@ -1223,12 +1225,12 @@ define i32 @ret100() { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ret100 -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: ret i32 100 ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ret100 -; CGSCC-SAME: () #[[ATTR2]] { +; CGSCC-SAME: () #[[ATTR3]] { ; CGSCC-NEXT: ret i32 100 ; ret i32 100 @@ -1238,7 +1240,7 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@ctx_adjustment -; TUNIT-SAME: (i32 [[V:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[V:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 ; TUNIT-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; TUNIT: if.true: @@ -1252,13 +1254,13 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ctx_adjustment -; CGSCC-SAME: (i32 [[V:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i32 [[V:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[C1:%.*]] = icmp sge i32 [[V]], 100 ; CGSCC-NEXT: br i1 [[C1]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CGSCC: if.true: ; CGSCC-NEXT: br label [[END:%.*]] ; CGSCC: if.false: -; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret100() #[[ATTR5]] +; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret100() #[[ATTR6]] ; CGSCC-NEXT: br label [[END]] ; CGSCC: end: ; CGSCC-NEXT: [[PHI:%.*]] = phi i32 [ [[V]], [[IF_TRUE]] ], [ [[CALL]], [[IF_FALSE]] ] @@ -1282,13 +1284,13 @@ define i32 @func(i1 %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@func -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 ; TUNIT-NEXT: ret i32 [[RET]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@func -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[RET:%.*]] = select i1 [[C]], i32 0, i32 1 ; CGSCC-NEXT: ret i32 [[RET]] ; @@ -1299,26 +1301,26 @@ define i32 @simplify_callsite_argument(i1 %d) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@simplify_callsite_argument -; TUNIT-SAME: (i1 [[D:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 [[D:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR3]] +; TUNIT-NEXT: [[RET1:%.*]] = call i32 @func(i1 noundef [[C]]) #[[ATTR4]] ; TUNIT-NEXT: ret i32 [[RET1]] ; TUNIT: f: -; TUNIT-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR3]] +; TUNIT-NEXT: [[RET2:%.*]] = call i32 @func(i1 noundef false) #[[ATTR4]] ; TUNIT-NEXT: ret i32 [[RET2]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@simplify_callsite_argument -; CGSCC-SAME: (i1 [[D:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 [[D:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[C:%.*]] = select i1 [[D]], i1 true, i1 false ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR5]] +; CGSCC-NEXT: [[RET1:%.*]] = call noundef i32 @func(i1 noundef [[C]]) #[[ATTR6]] ; CGSCC-NEXT: ret i32 [[RET1]] ; CGSCC: f: -; CGSCC-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR5]] +; CGSCC-NEXT: [[RET2:%.*]] = call noundef i32 @func(i1 noundef false) #[[ATTR6]] ; CGSCC-NEXT: ret i32 [[RET2]] ; %c = select i1 %d, i1 true, i1 false @@ -1335,7 +1337,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@less_than_65536 -; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[SHRINKED:%.*]] = udiv i32 [[ARG]], 65536 ; CGSCC-NEXT: ret i32 [[SHRINKED]] ; @@ -1346,7 +1348,7 @@ define internal i1 @is_less_than_65536(i32 %arg) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@is_less_than_65536 -; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp ult i32 [[ARG]], 65536 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -1357,16 +1359,16 @@ define i1 @check_divided_range(i32 %arg) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@check_divided_range -; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: ret i1 true ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@check_divided_range -; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR5]] -; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR5]] -; CGSCC-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR5]] -; CGSCC-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR5]] +; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @less_than_65536(i32 noundef 0) #[[ATTR6]] +; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_65536(i32 [[ARG]]) #[[ATTR6]] +; CGSCC-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET1]]) #[[ATTR6]] +; CGSCC-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_65536(i32 [[CSRET2]]) #[[ATTR6]] ; CGSCC-NEXT: [[RET:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; CGSCC-NEXT: ret i1 [[RET]] ; @@ -1382,7 +1384,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@cast_and_return -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[RET:%.*]] = zext i1 [[C]] to i32 ; CGSCC-NEXT: ret i32 [[RET]] ; @@ -1393,7 +1395,7 @@ define internal i1 @is_less_than_3(i32 %c) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@is_less_than_3 -; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 3 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -1404,16 +1406,16 @@ define i1 @check_casted_range(i1 %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@check_casted_range -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: ret i1 true ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@check_casted_range -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @cast_and_return(i1 noundef true) #[[ATTR5]] -; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @cast_and_return(i1 [[C]]) #[[ATTR5]] +; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @cast_and_return(i1 noundef true) #[[ATTR6]] +; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @cast_and_return(i1 [[C]]) #[[ATTR6]] ; CGSCC-NEXT: [[ADD:%.*]] = add i32 [[CSRET1]], [[CSRET2]] -; CGSCC-NEXT: [[RET:%.*]] = call i1 @is_less_than_3(i32 [[ADD]]) #[[ATTR5]] +; CGSCC-NEXT: [[RET:%.*]] = call i1 @is_less_than_3(i32 [[ADD]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[RET]] ; %csret1 = call i32 @cast_and_return(i1 true) @@ -1426,7 +1428,7 @@ define internal i32 @less_than_100_1(i32 %c) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@less_than_100_1 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] ; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] @@ -1481,7 +1483,7 @@ define internal i1 @is_less_than_100_1(i32 %c) { ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@is_less_than_100_1 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -1492,14 +1494,14 @@ define i1 @propagate_range1(i32 %c){ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@propagate_range1 -; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: ret i1 true ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@propagate_range1 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CSRET:%.*]] = call i32 @less_than_100_1(i32 noundef [[C]]) #[[ATTR5]] -; CGSCC-NEXT: [[TRUE:%.*]] = call i1 @is_less_than_100_1(i32 noundef [[CSRET]]) #[[ATTR5]] +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CSRET:%.*]] = call i32 @less_than_100_1(i32 noundef [[C]]) #[[ATTR6]] +; CGSCC-NEXT: [[TRUE:%.*]] = call i1 @is_less_than_100_1(i32 noundef [[CSRET]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[TRUE]] ; %csret = call i32 @less_than_100_1(i32 %c) @@ -1511,7 +1513,7 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@less_than_100_2 -; TUNIT-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; TUNIT-NEXT: i32 0, label [[ONZERO:%.*]] ; TUNIT-NEXT: i32 1, label [[ONONE:%.*]] @@ -1540,7 +1542,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@less_than_100_2 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: switch i32 [[C]], label [[OTHERWISE:%.*]] [ ; CGSCC-NEXT: i32 0, label [[ONZERO:%.*]] ; CGSCC-NEXT: i32 1, label [[ONONE:%.*]] @@ -1596,13 +1598,13 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@is_less_than_100_2 -; TUNIT-SAME: (i32 noundef [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 ; TUNIT-NEXT: ret i1 [[CMP]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@is_less_than_100_2 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[CMP:%.*]] = icmp slt i32 [[C]], 100 ; CGSCC-NEXT: ret i1 [[CMP]] ; @@ -1613,21 +1615,21 @@ define i1 @propagate_range2(i32 %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@propagate_range2 -; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR3]] -; TUNIT-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR3]] -; TUNIT-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR3]] -; TUNIT-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR3]] +; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { +; TUNIT-NEXT: [[CSRET1:%.*]] = call noundef i32 @less_than_100_2(i32 noundef 0) #[[ATTR4]] +; TUNIT-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR4]] +; TUNIT-NEXT: [[CSRET2:%.*]] = call noundef i32 @less_than_100_2(i32 [[C]]) #[[ATTR4]] +; TUNIT-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR4]] ; TUNIT-NEXT: [[TRUE:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; TUNIT-NEXT: ret i1 [[TRUE]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@propagate_range2 -; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @less_than_100_2(i32 noundef 0) #[[ATTR5]] -; CGSCC-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR5]] -; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_100_2(i32 noundef [[C]]) #[[ATTR5]] -; CGSCC-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR5]] +; CGSCC-SAME: (i32 noundef [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CSRET1:%.*]] = call i32 @less_than_100_2(i32 noundef 0) #[[ATTR6]] +; CGSCC-NEXT: [[TRUE1:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET1]]) #[[ATTR6]] +; CGSCC-NEXT: [[CSRET2:%.*]] = call i32 @less_than_100_2(i32 noundef [[C]]) #[[ATTR6]] +; CGSCC-NEXT: [[TRUE2:%.*]] = call i1 @is_less_than_100_2(i32 noundef [[CSRET2]]) #[[ATTR6]] ; CGSCC-NEXT: [[TRUE:%.*]] = and i1 [[TRUE1]], [[TRUE2]] ; CGSCC-NEXT: ret i1 [[TRUE]] ; @@ -1642,13 +1644,13 @@ define internal i1 @non_zero(i8 %v) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@non_zero -; TUNIT-SAME: (i8 [[V:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (i8 [[V:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@non_zero -; CGSCC-SAME: (i8 [[V:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (i8 [[V:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[R:%.*]] = icmp ne i8 [[V]], 0 ; CGSCC-NEXT: ret i1 [[R]] ; @@ -1665,7 +1667,7 @@ ; TUNIT-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR3]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR4]] ; TUNIT-NEXT: ret i1 [[R]] ; TUNIT: f: ; TUNIT-NEXT: ret i1 false @@ -1677,7 +1679,7 @@ ; CGSCC-NEXT: [[C:%.*]] = icmp slt i8 0, [[L]] ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR5]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @non_zero(i8 [[L]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[R]] ; CGSCC: f: ; CGSCC-NEXT: ret i1 false @@ -1694,20 +1696,37 @@ define void @spam(ptr %arg, ptr %arg1) { -; CHECK-LABEL: define {{[^@]+}}@spam -; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[ARG:%.*]], ptr nocapture nofree readnone [[ARG1:%.*]]) { -; CHECK-NEXT: bb: -; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 8 -; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i32 [[TMP]], 4 -; CHECK-NEXT: br i1 [[TMP2]], label [[BB3:%.*]], label [[BB4:%.*]] -; CHECK: bb3: -; CHECK-NEXT: call fastcc void @wobble(i32 signext [[TMP]]) -; CHECK-NEXT: br label [[BB5:%.*]] -; CHECK: bb4: -; CHECK-NEXT: call void @ham(i32 [[TMP]]) -; CHECK-NEXT: br label [[BB5]] -; CHECK: bb5: -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: read) +; TUNIT-LABEL: define {{[^@]+}}@spam +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[ARG:%.*]], ptr nocapture nofree readnone [[ARG1:%.*]]) #[[ATTR1]] { +; TUNIT-NEXT: bb: +; TUNIT-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 8 +; TUNIT-NEXT: [[TMP2:%.*]] = icmp ult i32 [[TMP]], 4 +; TUNIT-NEXT: br i1 [[TMP2]], label [[BB3:%.*]], label [[BB4:%.*]] +; TUNIT: bb3: +; TUNIT-NEXT: call fastcc void @wobble(i32 signext [[TMP]]) +; TUNIT-NEXT: br label [[BB5:%.*]] +; TUNIT: bb4: +; TUNIT-NEXT: call void @ham(i32 [[TMP]]) +; TUNIT-NEXT: br label [[BB5]] +; TUNIT: bb5: +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: read) +; CGSCC-LABEL: define {{[^@]+}}@spam +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(4) [[ARG:%.*]], ptr nocapture nofree readnone [[ARG1:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: bb: +; CGSCC-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 8 +; CGSCC-NEXT: [[TMP2:%.*]] = icmp ult i32 [[TMP]], 4 +; CGSCC-NEXT: br i1 [[TMP2]], label [[BB3:%.*]], label [[BB4:%.*]] +; CGSCC: bb3: +; CGSCC-NEXT: call fastcc void @wobble(i32 signext [[TMP]]) +; CGSCC-NEXT: br label [[BB5:%.*]] +; CGSCC: bb4: +; CGSCC-NEXT: call void @ham(i32 [[TMP]]) +; CGSCC-NEXT: br label [[BB5]] +; CGSCC: bb5: +; CGSCC-NEXT: ret void ; bb: %tmp = load i32, ptr %arg, align 8 @@ -1758,7 +1777,7 @@ define i1 @loop_1(i32 %N) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@loop_1 -; TUNIT-SAME: (i32 [[N:%.*]]) #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: (i32 [[N:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[HEADER:%.*]] ; TUNIT: header: @@ -1773,7 +1792,7 @@ ; ; CGSCC: Function Attrs: nofree norecurse nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@loop_1 -; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[HEADER:%.*]] ; CGSCC: header: @@ -1808,16 +1827,18 @@ !1 = !{i32 10, i32 100} ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR1]] = { memory(readwrite, argmem: read) } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR5]] = { willreturn } +; CGSCC: attributes #[[ATTR2]] = { memory(readwrite, argmem: read) } +; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR6]] = { willreturn } ;. ; TUNIT: [[RNG0]] = !{i32 0, i32 10} ; TUNIT: [[RNG1]] = !{i32 10, i32 100} Index: llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll =================================================================== --- llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -35,22 +35,22 @@ define ptr @external_ret2_nrw(ptr %n0, ptr %r0, ptr %w0) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@external_ret2_nrw -; TUNIT-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[R0:%.*]], ptr nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone [[N0:%.*]], ptr nofree readonly [[R0:%.*]], ptr nofree returned writeonly [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret0_nw(ptr nofree [[N0]], ptr nofree [[W0]]) #[[ATTR3:[0-9]+]] -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rrw(ptr nofree align 4 [[R0]], ptr nofree align 4 [[R0]], ptr nofree [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree readonly align 4 [[R0]], ptr nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @internal_ret1_rw(ptr nofree align 4 [[R0]], ptr nofree [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree readnone [[N0]], ptr nofree writeonly [[W0]]) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rrw(ptr nofree readonly align 4 [[R0]], ptr nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR0]] +; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree readonly align 4 [[R0]], ptr nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR0]] +; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @internal_ret1_rw(ptr nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR4]] ; TUNIT-NEXT: ret ptr [[W0]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@external_ret2_nrw -; CGSCC-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[R0:%.*]], ptr nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr nofree readnone [[N0:%.*]], ptr nofree readonly [[R0:%.*]], ptr nofree returned writeonly [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret0_nw(ptr nofree [[N0]], ptr nofree [[W0]]) #[[ATTR2:[0-9]+]] -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rrw(ptr nofree align 4 [[R0]], ptr nofree align 4 [[R0]], ptr nofree [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR3:[0-9]+]] -; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @internal_ret1_rw(ptr nofree align 4 [[R0]], ptr nofree [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree readnone [[N0]], ptr nofree writeonly [[W0]]) #[[ATTR3:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rrw(ptr nofree readonly align 4 [[R0]], ptr nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR0]] +; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @internal_ret1_rw(ptr nofree readonly align 4 [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR3]] ; CGSCC-NEXT: ret ptr [[W0]] ; entry: @@ -62,9 +62,9 @@ } define internal ptr @internal_ret0_nw(ptr %n0, ptr %w0) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@internal_ret0_nw -; TUNIT-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr noalias nofree readnone [[N0:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[R0:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[R1:%.*]] = alloca i32, align 4 @@ -76,20 +76,20 @@ ; TUNIT-NEXT: store i32 3, ptr [[R0]], align 4 ; TUNIT-NEXT: store i32 5, ptr [[R1]], align 4 ; TUNIT-NEXT: store i32 1, ptr [[W0]], align 4 -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @internal_ret0_nw(ptr nofree [[N0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree readnone [[N0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: return: ; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] ; TUNIT-NEXT: ret ptr [[RETVAL_0]] ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@internal_ret0_nw -; CGSCC-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr noalias nofree readnone [[N0:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[R0:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[R1:%.*]] = alloca i32, align 4 @@ -101,12 +101,12 @@ ; CGSCC-NEXT: store i32 3, ptr [[R0]], align 4 ; CGSCC-NEXT: store i32 5, ptr [[R1]], align 4 ; CGSCC-NEXT: store i32 1, ptr [[W0]], align 4 -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4:[0-9]+]] -; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] -; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @internal_ret0_nw(ptr nofree [[N0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree readnone [[N0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: return: ; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ] @@ -141,7 +141,7 @@ define internal ptr @internal_ret1_rrw(ptr %r0, ptr %r1, ptr %w0) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@internal_ret1_rrw -; TUNIT-SAME: (ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], ptr nofree align 4 [[R1:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0:%.*]], ptr nofree readonly align 4 [[R1:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[R0]], align 4 ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -149,19 +149,19 @@ ; TUNIT: if.then: ; TUNIT-NEXT: br label [[RETURN:%.*]] ; TUNIT: if.end: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR4]] ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[R0]], align 4 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr [[R1]], align 4 ; TUNIT-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] ; TUNIT-NEXT: store i32 [[ADD]], ptr [[W0]], align 4 -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[W0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @external_ret2_nrw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL6:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL7:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rw(ptr nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[W0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR0]] +; TUNIT-NEXT: [[CALL6:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL7:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR4]] +; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: return: ; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL8]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -169,7 +169,7 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@internal_ret1_rrw -; CGSCC-SAME: (ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], ptr nofree align 4 [[R1:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0:%.*]], ptr nofree readonly align 4 [[R1:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[R0]], align 4 ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -177,19 +177,19 @@ ; CGSCC: if.then: ; CGSCC-NEXT: br label [[RETURN:%.*]] ; CGSCC: if.end: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR3]] ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[R0]], align 4 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[R1]], align 4 ; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[TMP2]] ; CGSCC-NEXT: store i32 [[ADD]], ptr [[W0]], align 4 -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[W0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @external_ret2_nrw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL6:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] -; CGSCC-NEXT: [[CALL7:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] -; CGSCC-NEXT: [[CALL8:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[R1]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret1_rw(ptr nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[W0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR0]] +; CGSCC-NEXT: [[CALL6:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nocapture nofree nonnull readonly align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; CGSCC-NEXT: [[CALL7:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; CGSCC-NEXT: [[CALL8:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[R1]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: return: ; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL8]], [[IF_END]] ], [ [[R1]], [[IF_THEN]] ] @@ -227,7 +227,7 @@ define ptr @external_sink_ret2_nrw(ptr %n0, ptr %r0, ptr %w0) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CHECK-LABEL: define {{[^@]+}}@external_sink_ret2_nrw -; CHECK-SAME: (ptr nofree [[N0:%.*]], ptr nocapture nofree readonly [[R0:%.*]], ptr nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr nofree readnone [[N0:%.*]], ptr nocapture nofree readonly [[R0:%.*]], ptr nofree returned writeonly "no-capture-maybe-returned" [[W0:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne ptr [[N0]], null ; CHECK-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] @@ -259,7 +259,7 @@ define internal ptr @internal_ret1_rw(ptr %r0, ptr %w0) { ; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@internal_ret1_rw -; TUNIT-SAME: (ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[R0]], align 4 ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -267,13 +267,13 @@ ; TUNIT: if.then: ; TUNIT-NEXT: br label [[RETURN:%.*]] ; TUNIT: if.end: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR0]] ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[R0]], align 4 ; TUNIT-NEXT: store i32 [[TMP1]], ptr [[W0]], align 4 -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret0_nw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[W0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR3]] -; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; TUNIT-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[W0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; TUNIT-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[W0]]) #[[ATTR0]] +; TUNIT-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR0]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: return: ; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -281,7 +281,7 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@internal_ret1_rw -; CGSCC-SAME: (ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[R0]], align 4 ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 @@ -289,13 +289,13 @@ ; CGSCC: if.then: ; CGSCC-NEXT: br label [[RETURN:%.*]] ; CGSCC: if.end: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_ret1_rrw(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR0]] ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[R0]], align 4 ; CGSCC-NEXT: store i32 [[TMP1]], ptr [[W0]], align 4 -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret0_nw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr nofree nonnull align 4 dereferenceable(4) [[W0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] -; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] -; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[R0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; CGSCC-NEXT: [[CALL2:%.*]] = call ptr @internal_ret0_nw(ptr noalias nofree nonnull readnone align 4 dereferenceable(4) [[W0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR1]] +; CGSCC-NEXT: [[CALL3:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR4]] +; CGSCC-NEXT: [[CALL4:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[R0]], ptr nofree noundef nonnull readonly align 4 dereferenceable(4) [[R0]], ptr nofree nonnull writeonly align 4 dereferenceable(4) [[W0]]) #[[ATTR0]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: return: ; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL4]], [[IF_END]] ], [ [[W0]], [[IF_THEN]] ] @@ -327,18 +327,18 @@ define ptr @external_source_ret2_nrw(ptr %n0, ptr %r0, ptr %w0) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; TUNIT-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[R0:%.*]], ptr nofree returned [[W0:%.*]]) #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: (ptr nofree readnone [[N0:%.*]], ptr nofree readonly [[R0:%.*]], ptr nofree returned writeonly [[W0:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree readonly [[R0]], ptr nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR4:[0-9]+]] -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree [[R0]], ptr nofree [[W0]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree readonly [[R0]], ptr nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR5:[0-9]+]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree readonly [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR4]] ; TUNIT-NEXT: ret ptr [[W0]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@external_source_ret2_nrw -; CGSCC-SAME: (ptr nofree [[N0:%.*]], ptr nofree [[R0:%.*]], ptr nofree [[W0:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr nofree readnone [[N0:%.*]], ptr nofree readonly [[R0:%.*]], ptr nofree writeonly [[W0:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @external_sink_ret2_nrw(ptr nofree [[N0]], ptr nocapture nofree readonly [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR5:[0-9]+]] -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree [[N0]], ptr nofree [[R0]], ptr nofree [[W0]]) #[[ATTR3]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @external_sink_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nocapture nofree readonly [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr noalias nofree readnone [[N0]], ptr nofree readonly [[R0]], ptr nofree writeonly [[W0]]) #[[ATTR4]] ; CGSCC-NEXT: ret ptr [[CALL1]] ; entry: @@ -351,15 +351,16 @@ ; for a subset relation. ;. ; TUNIT: attributes #[[ATTR0]] = { nofree nosync nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind memory(argmem: write) } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR3]] = { nounwind } -; CGSCC: attributes #[[ATTR4]] = { nounwind memory(readwrite) } +; CGSCC: attributes #[[ATTR1]] = { nofree nosync nounwind memory(argmem: write) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR3]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR4]] = { nounwind } ; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/readattrs.ll =================================================================== --- llvm/test/Transforms/Attributor/readattrs.ll +++ llvm/test/Transforms/Attributor/readattrs.ll @@ -15,7 +15,7 @@ ;. define void @test1_2(ptr %x1_2, ptr %y1_2, ptr %z1_2) { ; CHECK-LABEL: define {{[^@]+}}@test1_2 -; CHECK-SAME: (ptr [[X1_2:%.*]], ptr [[Y1_2:%.*]], ptr [[Z1_2:%.*]]) { +; CHECK-SAME: (ptr [[X1_2:%.*]], ptr readonly [[Y1_2:%.*]], ptr [[Z1_2:%.*]]) { ; CHECK-NEXT: call void (ptr, ptr, ...) @test1_1(ptr [[X1_2]], ptr readonly [[Y1_2]], ptr [[Z1_2]]) ; CHECK-NEXT: store i32 0, ptr @x, align 4 ; CHECK-NEXT: ret void @@ -26,7 +26,7 @@ } define ptr @test2(ptr %p) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@test2 ; CHECK-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: store i32 0, ptr @x, align 4 @@ -64,7 +64,7 @@ define void @test5(ptr %p, ptr %q) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@test5 -; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], ptr nofree writeonly [[Q:%.*]]) #[[ATTR3:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[P:%.*]], ptr nofree readnone [[Q:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: store ptr [[Q]], ptr [[P]], align 8 ; CHECK-NEXT: ret void ; @@ -90,7 +90,7 @@ define void @test7_1(ptr inalloca(i32) %a) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@test7_1 -; CHECK-SAME: (ptr nocapture nofree nonnull writeonly inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr nocapture nofree nonnull inalloca(i32) dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: ret void ; ret void @@ -119,7 +119,7 @@ ; CGSCC-LABEL: define {{[^@]+}}@test8_2 ; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call align 4 ptr @test8_1(ptr noalias nofree readnone [[P]]) #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call align 4 ptr @test8_1(ptr noalias nofree readnone [[P]]) #[[ATTR17:[0-9]+]] ; CGSCC-NEXT: store i32 10, ptr [[CALL]], align 4 ; CGSCC-NEXT: ret void ; @@ -137,14 +137,14 @@ define void @test9(<4 x ptr> %ptrs, <4 x i32>%val) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@test9 -; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { -; TUNIT-NEXT: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> [[VAL]], <4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR12:[0-9]+]] +; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR5:[0-9]+]] { +; TUNIT-NEXT: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> [[VAL]], <4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR15:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@test9 -; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR0]] { -; CGSCC-NEXT: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> [[VAL]], <4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR13]] +; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]], <4 x i32> [[VAL:%.*]]) #[[ATTR6:[0-9]+]] { +; CGSCC-NEXT: call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32> [[VAL]], <4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef ) #[[ATTR17]] ; CGSCC-NEXT: ret void ; call void @llvm.masked.scatter.v4i32.v4p0(<4 x i32>%val, <4 x ptr> %ptrs, i32 4, <4 x i1>) @@ -156,14 +156,14 @@ define <4 x i32> @test10(<4 x ptr> %ptrs) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@test10 -; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR6:[0-9]+]] { -; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR12]] +; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR15]] ; TUNIT-NEXT: ret <4 x i32> [[RES]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@test10 -; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { -; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR13]] +; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> [[PTRS]], i32 noundef 4, <4 x i1> noundef , <4 x i32> undef) #[[ATTR17]] ; CGSCC-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @llvm.masked.gather.v4i32.v4p0(<4 x ptr> %ptrs, i32 4, <4 x i1>, <4 x i32>undef) @@ -173,16 +173,16 @@ ; CHECK: declare <4 x i32> @test11_1 declare <4 x i32> @test11_1(<4 x ptr>) argmemonly nounwind readonly define <4 x i32> @test11_2(<4 x ptr> %ptrs) { -; TUNIT: Function Attrs: nounwind memory(argmem: read) +; TUNIT: Function Attrs: nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test11_2 -; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR7:[0-9]+]] { -; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x ptr> [[PTRS]]) #[[ATTR13:[0-9]+]] +; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x ptr> [[PTRS]]) #[[ATTR16:[0-9]+]] ; TUNIT-NEXT: ret <4 x i32> [[RES]] ; -; CGSCC: Function Attrs: nounwind memory(argmem: read) +; CGSCC: Function Attrs: nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test11_2 -; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR8:[0-9]+]] { -; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x ptr> [[PTRS]]) #[[ATTR14:[0-9]+]] +; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test11_1(<4 x ptr> [[PTRS]]) #[[ATTR18:[0-9]+]] ; CGSCC-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test11_1(<4 x ptr> %ptrs) @@ -192,16 +192,16 @@ declare <4 x i32> @test12_1(<4 x ptr>) argmemonly nounwind ; CHECK-NOT: readnone define <4 x i32> @test12_2(<4 x ptr> %ptrs) { -; TUNIT: Function Attrs: nounwind memory(argmem: readwrite) +; TUNIT: Function Attrs: nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test12_2 -; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR8:[0-9]+]] { -; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x ptr> [[PTRS]]) #[[ATTR13]] +; TUNIT-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR9]] { +; TUNIT-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x ptr> [[PTRS]]) #[[ATTR16]] ; TUNIT-NEXT: ret <4 x i32> [[RES]] ; -; CGSCC: Function Attrs: nounwind memory(argmem: readwrite) +; CGSCC: Function Attrs: nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test12_2 -; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR9:[0-9]+]] { -; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x ptr> [[PTRS]]) #[[ATTR14]] +; CGSCC-SAME: (<4 x ptr> [[PTRS:%.*]]) #[[ATTR10]] { +; CGSCC-NEXT: [[RES:%.*]] = call <4 x i32> @test12_1(<4 x ptr> [[PTRS]]) #[[ATTR18]] ; CGSCC-NEXT: ret <4 x i32> [[RES]] ; %res = call <4 x i32> @test12_1(<4 x ptr> %ptrs) @@ -211,13 +211,13 @@ define i32 @volatile_load(ptr %p) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@volatile_load -; TUNIT-SAME: (ptr nofree noundef align 4 [[P:%.*]]) #[[ATTR9:[0-9]+]] { +; TUNIT-SAME: (ptr nofree noundef align 4 [[P:%.*]]) #[[ATTR11:[0-9]+]] { ; TUNIT-NEXT: [[LOAD:%.*]] = load volatile i32, ptr [[P]], align 4 ; TUNIT-NEXT: ret i32 [[LOAD]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@volatile_load -; CGSCC-SAME: (ptr nofree noundef align 4 [[P:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (ptr nofree noundef align 4 [[P:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: [[LOAD:%.*]] = load volatile i32, ptr [[P]], align 4 ; CGSCC-NEXT: ret i32 [[LOAD]] ; @@ -234,13 +234,23 @@ ; %addr, causing the store to write to %escaped_then_written. ; define void @unsound_readnone(ptr %ignored, ptr %escaped_then_written) { -; CHECK-LABEL: define {{[^@]+}}@unsound_readnone -; CHECK-SAME: (ptr nocapture nofree readnone [[IGNORED:%.*]], ptr [[ESCAPED_THEN_WRITTEN:%.*]]) { -; CHECK-NEXT: [[ADDR:%.*]] = alloca ptr, align 8 -; CHECK-NEXT: call void @escape_readnone_ptr(ptr noundef nonnull align 8 dereferenceable(8) [[ADDR]], ptr noalias readnone [[ESCAPED_THEN_WRITTEN]]) -; CHECK-NEXT: [[ADDR_LD:%.*]] = load ptr, ptr [[ADDR]], align 8 -; CHECK-NEXT: store i8 0, ptr [[ADDR_LD]], align 1 -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: write) +; TUNIT-LABEL: define {{[^@]+}}@unsound_readnone +; TUNIT-SAME: (ptr nocapture nofree readnone [[IGNORED:%.*]], ptr readnone [[ESCAPED_THEN_WRITTEN:%.*]]) #[[ATTR12:[0-9]+]] { +; TUNIT-NEXT: [[ADDR:%.*]] = alloca ptr, align 8 +; TUNIT-NEXT: call void @escape_readnone_ptr(ptr noundef nonnull align 8 dereferenceable(8) [[ADDR]], ptr noalias readnone [[ESCAPED_THEN_WRITTEN]]) +; TUNIT-NEXT: [[ADDR_LD:%.*]] = load ptr, ptr [[ADDR]], align 8 +; TUNIT-NEXT: store i8 0, ptr [[ADDR_LD]], align 1 +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: write) +; CGSCC-LABEL: define {{[^@]+}}@unsound_readnone +; CGSCC-SAME: (ptr nocapture nofree readnone [[IGNORED:%.*]], ptr readnone [[ESCAPED_THEN_WRITTEN:%.*]]) #[[ATTR13:[0-9]+]] { +; CGSCC-NEXT: [[ADDR:%.*]] = alloca ptr, align 8 +; CGSCC-NEXT: call void @escape_readnone_ptr(ptr noundef nonnull align 8 dereferenceable(8) [[ADDR]], ptr noalias readnone [[ESCAPED_THEN_WRITTEN]]) +; CGSCC-NEXT: [[ADDR_LD:%.*]] = load ptr, ptr [[ADDR]], align 8 +; CGSCC-NEXT: store i8 0, ptr [[ADDR_LD]], align 1 +; CGSCC-NEXT: ret void ; %addr = alloca ptr call void @escape_readnone_ptr(ptr %addr, ptr %escaped_then_written) @@ -251,7 +261,7 @@ define void @unsound_readonly(ptr %ignored, ptr %escaped_then_written) { ; CHECK-LABEL: define {{[^@]+}}@unsound_readonly -; CHECK-SAME: (ptr nocapture nofree readnone [[IGNORED:%.*]], ptr [[ESCAPED_THEN_WRITTEN:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree readnone [[IGNORED:%.*]], ptr readonly [[ESCAPED_THEN_WRITTEN:%.*]]) { ; CHECK-NEXT: [[ADDR:%.*]] = alloca ptr, align 8 ; CHECK-NEXT: call void @escape_readonly_ptr(ptr noundef nonnull align 8 dereferenceable(8) [[ADDR]], ptr readonly [[ESCAPED_THEN_WRITTEN]]) ; CHECK-NEXT: [[ADDR_LD:%.*]] = load ptr, ptr [[ADDR]], align 8 @@ -284,7 +294,7 @@ define void @byval_not_readonly_2(ptr byval(i8) %written) readonly { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@byval_not_readonly_2 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: store i8 0, ptr [[WRITTEN]], align 1 ; CHECK-NEXT: ret void ; @@ -295,13 +305,13 @@ define void @byval_not_readnone_1(ptr byval(i8) %written) readnone { ; TUNIT: Function Attrs: memory(none) ; TUNIT-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; TUNIT-SAME: (ptr noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR10:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR13:[0-9]+]] { ; TUNIT-NEXT: call void @escape_i8(ptr nonnull dereferenceable(1) [[WRITTEN]]) ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: memory(none) ; CGSCC-LABEL: define {{[^@]+}}@byval_not_readnone_1 -; CGSCC-SAME: (ptr noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR14:[0-9]+]] { ; CGSCC-NEXT: call void @escape_i8(ptr nonnull dereferenceable(1) [[WRITTEN]]) ; CGSCC-NEXT: ret void ; @@ -312,7 +322,7 @@ define void @byval_not_readnone_2(ptr byval(i8) %written) readnone { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@byval_not_readnone_2 -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: store i8 0, ptr [[WRITTEN]], align 1 ; CHECK-NEXT: ret void ; @@ -323,7 +333,7 @@ define void @byval_no_fnarg(ptr byval(i8) %written) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CHECK-LABEL: define {{[^@]+}}@byval_no_fnarg -; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { +; CHECK-SAME: (ptr noalias nocapture nofree noundef nonnull byval(i8) dereferenceable(1) [[WRITTEN:%.*]]) #[[ATTR3]] { ; CHECK-NEXT: store i8 0, ptr [[WRITTEN]], align 1 ; CHECK-NEXT: ret void ; @@ -333,17 +343,19 @@ define void @testbyval(ptr %read_only) { ; TUNIT-LABEL: define {{[^@]+}}@testbyval -; TUNIT-SAME: (ptr nocapture readonly [[READ_ONLY:%.*]]) { -; TUNIT-NEXT: call void @byval_not_readonly_1(ptr nocapture readonly byval(i8) [[READ_ONLY]]) +; TUNIT-SAME: (ptr nocapture [[READ_ONLY:%.*]]) { +; TUNIT-NEXT: call void @byval_not_readonly_1(ptr nocapture byval(i8) [[READ_ONLY]]) +; TUNIT-NEXT: call void @byval_not_readonly_2(ptr nocapture nofree byval(i8) [[READ_ONLY]]) #[[ATTR16]] ; TUNIT-NEXT: call void @byval_not_readnone_1(ptr noalias nocapture readnone byval(i8) [[READ_ONLY]]) -; TUNIT-NEXT: call void @byval_no_fnarg(ptr nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13]] +; TUNIT-NEXT: call void @byval_no_fnarg(ptr nocapture nofree byval(i8) [[READ_ONLY]]) #[[ATTR16]] ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(read, argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@testbyval -; CGSCC-SAME: (ptr nocapture noundef nonnull readonly dereferenceable(1) [[READ_ONLY:%.*]]) { -; CGSCC-NEXT: call void @byval_not_readonly_1(ptr noalias nocapture noundef nonnull readonly byval(i8) dereferenceable(1) [[READ_ONLY]]) -; CGSCC-NEXT: call void @byval_not_readnone_1(ptr noalias nocapture noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) -; CGSCC-NEXT: call void @byval_no_fnarg(ptr noalias nocapture nofree noundef nonnull readnone byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR14]] +; CGSCC-SAME: (ptr nocapture noundef nonnull dereferenceable(1) [[READ_ONLY:%.*]]) #[[ATTR15:[0-9]+]] { +; CGSCC-NEXT: call void @byval_not_readonly_1(ptr noalias nocapture noundef nonnull byval(i8) dereferenceable(1) [[READ_ONLY]]) +; CGSCC-NEXT: call void @byval_not_readnone_1(ptr noalias nocapture noundef nonnull byval(i8) dereferenceable(1) [[READ_ONLY]]) +; CGSCC-NEXT: call void @byval_no_fnarg(ptr noalias nocapture nofree noundef nonnull byval(i8) dereferenceable(1) [[READ_ONLY]]) #[[ATTR18]] ; CGSCC-NEXT: ret void ; call void @byval_not_readonly_1(ptr byval(i8) %read_only) @@ -362,16 +374,16 @@ define void @ptr_uses(ptr %ptr) { ; TUNIT: Function Attrs: nounwind memory(read) ; TUNIT-LABEL: define {{[^@]+}}@ptr_uses -; TUNIT-SAME: (ptr nocapture readonly [[PTR:%.*]]) #[[ATTR11:[0-9]+]] { -; TUNIT-NEXT: [[CALL_PTR:%.*]] = call ptr @maybe_returned_ptr(ptr readonly [[PTR]]) #[[ATTR13]] -; TUNIT-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(ptr readonly [[CALL_PTR]]) #[[ATTR13]] +; TUNIT-SAME: (ptr nocapture readonly [[PTR:%.*]]) #[[ATTR14:[0-9]+]] { +; TUNIT-NEXT: [[CALL_PTR:%.*]] = call ptr @maybe_returned_ptr(ptr readonly [[PTR]]) #[[ATTR16]] +; TUNIT-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(ptr readonly [[CALL_PTR]]) #[[ATTR16]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: nounwind memory(read) ; CGSCC-LABEL: define {{[^@]+}}@ptr_uses -; CGSCC-SAME: (ptr nocapture readonly [[PTR:%.*]]) #[[ATTR12:[0-9]+]] { -; CGSCC-NEXT: [[CALL_PTR:%.*]] = call ptr @maybe_returned_ptr(ptr readonly [[PTR]]) #[[ATTR14]] -; CGSCC-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(ptr readonly [[CALL_PTR]]) #[[ATTR14]] +; CGSCC-SAME: (ptr nocapture readonly [[PTR:%.*]]) #[[ATTR16:[0-9]+]] { +; CGSCC-NEXT: [[CALL_PTR:%.*]] = call ptr @maybe_returned_ptr(ptr readonly [[PTR]]) #[[ATTR18]] +; CGSCC-NEXT: [[CALL_VAL:%.*]] = call i8 @maybe_returned_val(ptr readonly [[CALL_PTR]]) #[[ATTR18]] ; CGSCC-NEXT: ret void ; %call_ptr = call ptr @maybe_returned_ptr(ptr %ptr) @@ -402,34 +414,41 @@ ret i32 %l } ;. -; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR2]] = { memory(read) } ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; TUNIT: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR7]] = { nounwind memory(argmem: read) } -; TUNIT: attributes #[[ATTR8]] = { nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR10]] = { memory(none) } -; TUNIT: attributes #[[ATTR11]] = { nounwind memory(read) } -; TUNIT: attributes #[[ATTR12]] = { willreturn } -; TUNIT: attributes #[[ATTR13]] = { nounwind } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR9]] = { nounwind memory(none) } +; TUNIT: attributes #[[ATTR10:[0-9]+]] = { nounwind memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR12]] = { memory(readwrite, argmem: write) } +; TUNIT: attributes #[[ATTR13]] = { memory(none) } +; TUNIT: attributes #[[ATTR14]] = { nounwind memory(read) } +; TUNIT: attributes #[[ATTR15]] = { willreturn } +; TUNIT: attributes #[[ATTR16]] = { nounwind } ;. -; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR2]] = { memory(read) } ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(write) } ; CGSCC: attributes #[[ATTR5:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR6:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR8]] = { nounwind memory(argmem: read) } -; CGSCC: attributes #[[ATTR9]] = { nounwind memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR11]] = { memory(none) } -; CGSCC: attributes #[[ATTR12]] = { nounwind memory(read) } -; CGSCC: attributes #[[ATTR13]] = { willreturn } -; CGSCC: attributes #[[ATTR14]] = { nounwind } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } +; CGSCC: attributes #[[ATTR9:[0-9]+]] = { nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR10]] = { nounwind memory(none) } +; CGSCC: attributes #[[ATTR11:[0-9]+]] = { nounwind memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR13]] = { memory(readwrite, argmem: write) } +; CGSCC: attributes #[[ATTR14]] = { memory(none) } +; CGSCC: attributes #[[ATTR15]] = { memory(read, argmem: readwrite) } +; CGSCC: attributes #[[ATTR16]] = { nounwind memory(read) } +; CGSCC: attributes #[[ATTR17]] = { willreturn } +; CGSCC: attributes #[[ATTR18]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/reduced/aa_execution_domain_wrong_fn.ll =================================================================== --- llvm/test/Transforms/Attributor/reduced/aa_execution_domain_wrong_fn.ll +++ llvm/test/Transforms/Attributor/reduced/aa_execution_domain_wrong_fn.ll @@ -29,18 +29,18 @@ ; CHECK: @[[_ZN4OMPX5STATE9TEAMSTATEE:[a-zA-Z0-9_$"\\.-]+]] = internal addrspace(3) global %"struct.ompx::state::TeamStateTy" undef ;. ; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_16_1d1156__Z38test_target_teams_distribute__parallelv_l16() { -; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @__kmpc_target_init(ptr null, i8 0, i1 false) +; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @__kmpc_target_init(ptr readnone null, i8 0, i1 false) ; CHECK-NEXT: ret void ; ; -; CHECK: Function Attrs: norecurse nosync nounwind memory(write) +; CHECK: Function Attrs: norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@__kmpc_target_init -; CHECK-SAME: (ptr [[TMP0:%.*]], i8 [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { +; CHECK-SAME: (ptr readnone [[TMP0:%.*]], i8 [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: ret i32 0 ; ;. -; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(write) } -; CHECK: attributes #[[ATTR1:[0-9]+]] = { nosync nounwind } +; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } +; CHECK: attributes #[[ATTR1:[0-9]+]] = { nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} ;. Index: llvm/test/Transforms/Attributor/reduced/missed_cached_entry_for_intra_reachability.ll =================================================================== --- llvm/test/Transforms/Attributor/reduced/missed_cached_entry_for_intra_reachability.ll +++ llvm/test/Transforms/Attributor/reduced/missed_cached_entry_for_intra_reachability.ll @@ -13,7 +13,7 @@ ; CHECK: @[[RANDOM:[a-zA-Z0-9_$"\\.-]+]] = external global i1, align 4 ;. define void @widget(ptr %arg1, float %arg2, i64 %idx1, i64 %idx2, i32 %limit) { -; CHECK: Function Attrs: nofree norecurse nounwind +; CHECK: Function Attrs: nofree norecurse nounwind memory(readwrite, argmem: write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@widget ; CHECK-SAME: (ptr nocapture nofree writeonly [[ARG1:%.*]], float [[ARG2:%.*]], i64 [[IDX1:%.*]], i64 [[IDX2:%.*]], i32 [[LIMIT:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: bb: @@ -128,7 +128,7 @@ ret void } ;. -; CHECK: attributes #[[ATTR0]] = { nofree norecurse nounwind } +; CHECK: attributes #[[ATTR0]] = { nofree norecurse nounwind memory(readwrite, argmem: write, inaccessiblemem: none) } ;. ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: ; CGSCC: {{.*}} Index: llvm/test/Transforms/Attributor/reduced/openmp_opt_global_synced.ll =================================================================== --- llvm/test/Transforms/Attributor/reduced/openmp_opt_global_synced.ll +++ llvm/test/Transforms/Attributor/reduced/openmp_opt_global_synced.ll @@ -36,7 +36,7 @@ ;. ; CHECK: @[[_ZN4OMPX5STATE9TEAMSTATEE:[a-zA-Z0-9_$"\\.-]+]] = internal addrspace(3) global ptr undef ;. -; CHECK: Function Attrs: norecurse nosync nounwind memory(read) +; CHECK: Function Attrs: norecurse nosync nounwind memory(read, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@__kmpc_kernel_parallel ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: bb: @@ -59,10 +59,10 @@ ; CHECK-NEXT: ret void ; ;. -; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(read) } +; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(read, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR1]] = { "kernel" } ; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback } -; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind } +; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind memory(read, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} ; CHECK: [[META1:![0-9]+]] = !{i32 7, !"openmp-device", i32 50} Index: llvm/test/Transforms/Attributor/returned.ll =================================================================== --- llvm/test/Transforms/Attributor/returned.ll +++ llvm/test/Transforms/Attributor/returned.ll @@ -56,14 +56,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@scc_r1 ; TUNIT-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR10:[0-9]+]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR11:[0-9]+]] ; TUNIT-NEXT: ret i32 [[R]] ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@scc_r1 ; CGSCC-SAME: (i32 [[A:%.*]], i32 returned [[R:%.*]], i32 [[B:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[A]], i32 [[R]]) #[[ATTR8:[0-9]+]] ; CGSCC-NEXT: ret i32 [[R]] ; entry: @@ -80,18 +80,18 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR12:[0-9]+]] ; TUNIT-NEXT: br label [[RETURN:%.*]] ; TUNIT: if.end: ; TUNIT-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; TUNIT: if.then3: -; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR10]] +; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR11]] +; TUNIT-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR12]] +; TUNIT-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR12]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: if.end12: ; TUNIT-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -99,7 +99,7 @@ ; TUNIT: cond.true: ; TUNIT-NEXT: br label [[COND_END:%.*]] ; TUNIT: cond.false: -; TUNIT-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR12]] ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: ; TUNIT-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -115,18 +115,18 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR9:[0-9]+]] ; CGSCC-NEXT: br label [[RETURN:%.*]] ; CGSCC: if.end: ; CGSCC-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; CGSCC: if.then3: -; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR7]] -; CGSCC-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR7]] -; CGSCC-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR7]] +; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR8]] +; CGSCC-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR9]] +; CGSCC-NEXT: [[CALL8:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[R]], i32 undef) #[[ATTR9]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: if.end12: ; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -134,7 +134,7 @@ ; CGSCC: cond.true: ; CGSCC-NEXT: br label [[COND_END:%.*]] ; CGSCC: cond.false: -; CGSCC-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR9]] ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: ; CGSCC-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -195,18 +195,18 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR12]] ; TUNIT-NEXT: br label [[RETURN:%.*]] ; TUNIT: if.end: ; TUNIT-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; TUNIT: if.then3: -; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR10]] +; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR12]] +; TUNIT-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 undef) #[[ATTR12]] +; TUNIT-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 undef) #[[ATTR12]] +; TUNIT-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 undef) #[[ATTR12]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: if.end12: ; TUNIT-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -214,7 +214,7 @@ ; TUNIT: cond.true: ; TUNIT-NEXT: br label [[COND_END:%.*]] ; TUNIT: cond.false: -; TUNIT-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR12]] ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: ; TUNIT-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -230,19 +230,19 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR8:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[A]], i32 [[R]]) #[[ATTR10:[0-9]+]] ; CGSCC-NEXT: br label [[RETURN:%.*]] ; CGSCC: if.end: ; CGSCC-NEXT: [[CMP2:%.*]] = icmp slt i32 [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; CGSCC: if.then3: -; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 [[R]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL10:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR8]] -; CGSCC-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 [[B]]) #[[ATTR8]] +; CGSCC-NEXT: [[CALL5:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL6:%.*]] = call i32 @scc_r2(i32 [[R]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL7:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[R]], i32 [[R]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL8:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL9:%.*]] = call i32 @scc_r2(i32 [[B]], i32 [[R]], i32 [[B]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL10:%.*]] = call i32 @scc_r1(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] +; CGSCC-NEXT: [[CALL11:%.*]] = call i32 @scc_r1(i32 [[B]], i32 [[B]], i32 [[B]]) #[[ATTR10]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: if.end12: ; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq i32 [[A]], [[B]] @@ -250,7 +250,7 @@ ; CGSCC: cond.true: ; CGSCC-NEXT: br label [[COND_END:%.*]] ; CGSCC: cond.false: -; CGSCC-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR8]] +; CGSCC-NEXT: [[CALL14:%.*]] = call i32 @scc_r2(i32 [[A]], i32 [[B]], i32 [[R]]) #[[ATTR10]] ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: ; CGSCC-NEXT: [[COND:%.*]] = phi i32 [ [[R]], [[COND_TRUE]] ], [ [[CALL14]], [[COND_FALSE]] ] @@ -340,14 +340,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@ptr_scc_r1 ; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]], ptr nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR11]] ; TUNIT-NEXT: ret ptr [[R]] ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@ptr_scc_r1 ; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned [[R:%.*]], ptr nocapture nofree readnone [[B:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR8]] ; CGSCC-NEXT: ret ptr [[R]] ; entry: @@ -364,18 +364,18 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp ugt ptr [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR12]] ; TUNIT-NEXT: br label [[RETURN:%.*]] ; TUNIT: if.end: ; TUNIT-NEXT: [[CMP2:%.*]] = icmp ult ptr [[A]], [[B]] ; TUNIT-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; TUNIT: if.then3: -; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]] -; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] -; TUNIT-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR10]] +; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR11]] +; TUNIT-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR12]] +; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR12]] +; TUNIT-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR12]] ; TUNIT-NEXT: br label [[RETURN]] ; TUNIT: if.end12: ; TUNIT-NEXT: [[CMP13:%.*]] = icmp eq ptr [[A]], [[B]] @@ -383,7 +383,7 @@ ; TUNIT: cond.true: ; TUNIT-NEXT: br label [[COND_END:%.*]] ; TUNIT: cond.false: -; TUNIT-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR12]] ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: ; TUNIT-NEXT: [[COND:%.*]] = phi ptr [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -399,18 +399,18 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp ugt ptr [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR9]] ; CGSCC-NEXT: br label [[RETURN:%.*]] ; CGSCC: if.end: ; CGSCC-NEXT: [[CMP2:%.*]] = icmp ult ptr [[A]], [[B]] ; CGSCC-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_END12:%.*]] ; CGSCC: if.then3: -; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]] -; CGSCC-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]] -; CGSCC-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] -; CGSCC-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]] +; CGSCC-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR8]] +; CGSCC-NEXT: [[CALL6:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[R]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL7:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR9]] +; CGSCC-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL9:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree readnone [[R]], ptr noalias nofree readnone [[R]]) #[[ATTR9]] +; CGSCC-NEXT: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR9]] ; CGSCC-NEXT: br label [[RETURN]] ; CGSCC: if.end12: ; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq ptr [[A]], [[B]] @@ -418,7 +418,7 @@ ; CGSCC: cond.true: ; CGSCC-NEXT: br label [[COND_END:%.*]] ; CGSCC: cond.false: -; CGSCC-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL14:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree readnone [[B]], ptr noalias nofree readnone [[R]]) #[[ATTR9]] ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: ; CGSCC-NEXT: [[COND:%.*]] = phi ptr [ [[R]], [[COND_TRUE]] ], [ [[R]], [[COND_FALSE]] ] @@ -483,14 +483,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@rt0 ; TUNIT-SAME: (ptr nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR13:[0-9]+]] ; TUNIT-NEXT: ret ptr [[A]] ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(argmem: read) uwtable ; CGSCC-LABEL: define {{[^@]+}}@rt0 ; CGSCC-SAME: (ptr nofree noundef nonnull readonly returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt0(ptr nofree noundef nonnull readonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR11:[0-9]+]] ; CGSCC-NEXT: ret ptr [[A]] ; entry: @@ -535,14 +535,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@rt2_helper ; TUNIT-SAME: (ptr nofree readnone returned [[A:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR11]] ; TUNIT-NEXT: ret ptr [[A]] ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@rt2_helper ; CGSCC-SAME: (ptr nofree readnone returned [[A:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[A]]) #[[ATTR8]] ; CGSCC-NEXT: ret ptr [[A]] ; entry: @@ -558,7 +558,7 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR11]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: ; TUNIT-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] @@ -571,7 +571,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt2_helper(ptr noalias nofree readnone [[A]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: ; CGSCC-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[A]], [[IF_THEN]] ] @@ -597,14 +597,14 @@ ; TUNIT-LABEL: define {{[^@]+}}@rt3_helper ; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR11]] ; TUNIT-NEXT: ret ptr [[B]] ; ; CGSCC: Function Attrs: nofree noinline nosync nounwind memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@rt3_helper ; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]], ptr nofree readnone returned "no-capture-maybe-returned" [[B:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR8]] ; CGSCC-NEXT: ret ptr [[B]] ; entry: @@ -620,7 +620,7 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR11]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: ; TUNIT-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] @@ -633,7 +633,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], null ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @rt3_helper(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[B]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: ; CGSCC-NEXT: [[SEL:%.*]] = phi ptr [ [[B]], [[ENTRY:%.*]] ], [ [[B]], [[IF_THEN]] ] @@ -664,16 +664,16 @@ declare void @unknown_fn(ptr) #0 define ptr @calls_unknown_fn(ptr %r) #0 { -; TUNIT: Function Attrs: noinline nounwind uwtable +; TUNIT: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable ; TUNIT-LABEL: define {{[^@]+}}@calls_unknown_fn -; TUNIT-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] { -; TUNIT-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR11:[0-9]+]] +; TUNIT-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR14:[0-9]+]] ; TUNIT-NEXT: ret ptr [[R]] ; -; CGSCC: Function Attrs: noinline nounwind uwtable +; CGSCC: Function Attrs: noinline nounwind memory(readwrite, argmem: none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@calls_unknown_fn -; CGSCC-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR4:[0-9]+]] { -; CGSCC-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR8]] +; CGSCC-SAME: (ptr nofree readnone returned "no-capture-maybe-returned" [[R:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: tail call void @unknown_fn(ptr noundef nonnull @calls_unknown_fn) #[[ATTR10]] ; CGSCC-NEXT: ret ptr [[R]] ; tail call void @unknown_fn(ptr nonnull @calls_unknown_fn) @@ -697,13 +697,13 @@ define linkonce_odr ptr @maybe_redefined_fn(ptr %r) #0 { ; TUNIT: Function Attrs: noinline nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@maybe_redefined_fn -; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR5]] { +; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: ret ptr [[R]] ; ; CGSCC: Function Attrs: noinline nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@maybe_redefined_fn -; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4]] { +; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: ret ptr [[R]] ; @@ -714,16 +714,16 @@ define ptr @calls_maybe_redefined_fn(ptr %r) #0 { ; TUNIT: Function Attrs: noinline norecurse nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn -; TUNIT-SAME: (ptr returned [[R:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-SAME: (ptr returned [[R:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR11]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR14]] ; TUNIT-NEXT: ret ptr [[R]] ; ; CGSCC: Function Attrs: noinline nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn ; CGSCC-SAME: (ptr returned [[R:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR8]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn(ptr [[R]]) #[[ATTR10]] ; CGSCC-NEXT: ret ptr [[R]] ; entry: @@ -763,16 +763,16 @@ define ptr @calls_maybe_redefined_fn2(ptr %r) #0 { ; TUNIT: Function Attrs: noinline norecurse nounwind uwtable ; TUNIT-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 -; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr [[R:%.*]]) #[[ATTR7]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR11]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR14]] ; TUNIT-NEXT: ret ptr [[CALL]] ; ; CGSCC: Function Attrs: noinline nounwind uwtable ; CGSCC-LABEL: define {{[^@]+}}@calls_maybe_redefined_fn2 ; CGSCC-SAME: (ptr [[R:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR8]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @maybe_redefined_fn2(ptr [[R]]) #[[ATTR10]] ; CGSCC-NEXT: ret ptr [[CALL]] ; entry: @@ -836,7 +836,7 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR10]] +; TUNIT-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR11]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: ; TUNIT-NEXT: [[PHI:%.*]] = phi double [ [[B]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ] @@ -850,7 +850,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 0 ; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR7]] +; CGSCC-NEXT: [[CALL:%.*]] = call double @recursion_select_and_phi(i32 [[DEC]], double [[B]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: ; CGSCC-NEXT: [[PHI:%.*]] = phi double [ [[B]], [[IF_THEN]] ], [ [[B]], [[ENTRY:%.*]] ] @@ -1262,7 +1262,7 @@ ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] ; TUNIT: unreachablecall: -; TUNIT-NEXT: call void @noreturn() #[[ATTR7:[0-9]+]] +; TUNIT-NEXT: call void @noreturn() #[[ATTR8:[0-9]+]] ; TUNIT-NEXT: unreachable ; TUNIT: unreachableblock2: ; TUNIT-NEXT: unreachable @@ -1277,7 +1277,7 @@ ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br i1 [[C]], label [[R:%.*]], label [[UNREACHABLECALL:%.*]] ; CGSCC: unreachablecall: -; CGSCC-NEXT: call void @noreturn() #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: call void @noreturn() #[[ATTR6:[0-9]+]] ; CGSCC-NEXT: unreachable ; CGSCC: unreachableblock2: ; CGSCC-NEXT: unreachable @@ -1344,7 +1344,7 @@ define i32 @exact(ptr align 8 %a, ptr align 8 %b) { ; TUNIT: Function Attrs: norecurse ; TUNIT-LABEL: define {{[^@]+}}@exact -; TUNIT-SAME: (ptr align 8 [[A:%.*]], ptr align 8 [[B:%.*]]) #[[ATTR8:[0-9]+]] { +; TUNIT-SAME: (ptr align 8 [[A:%.*]], ptr align 8 [[B:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: [[C0:%.*]] = call i32 @non_exact_0() ; TUNIT-NEXT: [[C1:%.*]] = call i32 @non_exact_1(i32 noundef 1) ; TUNIT-NEXT: [[C2:%.*]] = call i32 @non_exact_2(i32 noundef 2) @@ -1405,7 +1405,7 @@ ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@use_const ; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR9:[0-9]+]] +; CGSCC-NEXT: [[C:%.*]] = call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR12:[0-9]+]] ; CGSCC-NEXT: ret ptr [[C]] ; %c = call ptr @ret_const() @@ -1420,7 +1420,7 @@ ; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable ; CGSCC-LABEL: define {{[^@]+}}@dont_use_const ; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: [[C:%.*]] = musttail call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR9]] +; CGSCC-NEXT: [[C:%.*]] = musttail call noundef nonnull dereferenceable(1) ptr @ret_const() #[[ATTR12]] ; CGSCC-NEXT: ret ptr [[C]] ; %c = musttail call ptr @ret_const() @@ -1475,21 +1475,27 @@ ; TUNIT: attributes #[[ATTR3]] = { nofree noinline nosync nounwind memory(argmem: read) uwtable } ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; TUNIT: attributes #[[ATTR5]] = { noinline nounwind uwtable } -; TUNIT: attributes #[[ATTR6]] = { noinline norecurse nounwind uwtable } -; TUNIT: attributes #[[ATTR7]] = { noreturn } -; TUNIT: attributes #[[ATTR8]] = { norecurse } -; TUNIT: attributes #[[ATTR9:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR11]] = { nounwind } +; TUNIT: attributes #[[ATTR6]] = { noinline nounwind memory(readwrite, argmem: none) uwtable } +; TUNIT: attributes #[[ATTR7]] = { noinline norecurse nounwind uwtable } +; TUNIT: attributes #[[ATTR8]] = { noreturn } +; TUNIT: attributes #[[ATTR9]] = { norecurse } +; TUNIT: attributes #[[ATTR10:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR12]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR13]] = { nofree nosync nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR14]] = { nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR1]] = { nofree noinline nosync nounwind memory(none) uwtable } ; CGSCC: attributes #[[ATTR2]] = { nofree noinline nosync nounwind memory(argmem: read) uwtable } ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR4]] = { noinline nounwind uwtable } -; CGSCC: attributes #[[ATTR5]] = { noreturn } -; CGSCC: attributes #[[ATTR6:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR7]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR8]] = { nounwind } -; CGSCC: attributes #[[ATTR9]] = { willreturn } +; CGSCC: attributes #[[ATTR5]] = { noinline nounwind memory(readwrite, argmem: none) uwtable } +; CGSCC: attributes #[[ATTR6]] = { noreturn } +; CGSCC: attributes #[[ATTR7:[0-9]+]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR8]] = { nofree nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR9]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR10]] = { nounwind } +; CGSCC: attributes #[[ATTR11]] = { nofree nosync nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR12]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/undefined_behavior.ll =================================================================== --- llvm/test/Transforms/Attributor/undefined_behavior.ll +++ llvm/test/Transforms/Attributor/undefined_behavior.ll @@ -160,7 +160,7 @@ ; TUNIT-SAME: () #[[ATTR0]] { ; TUNIT-NEXT: unreachable ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@store_null_propagated ; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: [[PTR:%.*]] = call noalias align 4294967296 ptr @ret_null() #[[ATTR10:[0-9]+]] @@ -241,7 +241,7 @@ ; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: unreachable ; -; CGSCC: Function Attrs: mustprogress nofree nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@atomicrmw_null_propagated ; CGSCC-SAME: () #[[ATTR7:[0-9]+]] { ; CGSCC-NEXT: [[PTR:%.*]] = call noalias ptr @ret_null() #[[ATTR10]] @@ -323,7 +323,7 @@ ; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: unreachable ; -; CGSCC: Function Attrs: mustprogress nofree nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@atomiccmpxchg_null_propagated ; CGSCC-SAME: () #[[ATTR7]] { ; CGSCC-NEXT: [[PTR:%.*]] = call noalias ptr @ret_null() #[[ATTR10]] @@ -611,7 +611,7 @@ define void @arg_nonnull_12(ptr nonnull %a, ptr nonnull %b, ptr %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@arg_nonnull_12 -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree nonnull writeonly [[B:%.*]], ptr nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree nonnull writeonly [[B:%.*]], ptr nofree readnone [[C:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: [[D:%.*]] = icmp eq ptr [[C]], null ; TUNIT-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -625,7 +625,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_12 -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree nonnull writeonly [[B:%.*]], ptr nofree writeonly [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree nonnull writeonly [[B:%.*]], ptr nofree readnone [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: [[D:%.*]] = icmp eq ptr [[C]], null ; CGSCC-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -652,7 +652,7 @@ define void @arg_nonnull_12_noundef_2(ptr nonnull %a, ptr noundef nonnull %b, ptr %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly [[B:%.*]], ptr nofree writeonly [[C:%.*]]) #[[ATTR6]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly [[B:%.*]], ptr nofree readnone [[C:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: [[D:%.*]] = icmp eq ptr [[C]], null ; TUNIT-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -666,7 +666,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@arg_nonnull_12_noundef_2 -; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly [[B:%.*]], ptr nofree writeonly [[C:%.*]]) #[[ATTR9]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull writeonly [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly [[B:%.*]], ptr nofree readnone [[C:%.*]]) #[[ATTR9]] { ; CGSCC-NEXT: [[D:%.*]] = icmp eq ptr [[C]], null ; CGSCC-NEXT: br i1 [[D]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -762,8 +762,8 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] -; TUNIT-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; TUNIT-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[PTR]]) #[[ATTR7:[0-9]+]] +; TUNIT-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR7]] ; TUNIT-NEXT: unreachable ; TUNIT: f: ; TUNIT-NEXT: unreachable @@ -776,8 +776,8 @@ ; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR11:[0-9]+]] -; CGSCC-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR11]] +; CGSCC-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[PTR]]) #[[ATTR11:[0-9]+]] +; CGSCC-NEXT: call void @arg_nonnull_12(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR11]] ; CGSCC-NEXT: unreachable ; CGSCC: f: ; CGSCC-NEXT: unreachable @@ -809,8 +809,8 @@ ; TUNIT-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] -; TUNIT-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR7]] +; TUNIT-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[PTR]]) #[[ATTR7]] +; TUNIT-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR7]] ; TUNIT-NEXT: unreachable ; TUNIT: f: ; TUNIT-NEXT: unreachable @@ -823,8 +823,8 @@ ; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]]) #[[ATTR11]] -; CGSCC-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef writeonly align 4294967296 null) #[[ATTR11]] +; CGSCC-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nofree noundef nonnull readnone align 4 dereferenceable(4) [[PTR]]) #[[ATTR11]] +; CGSCC-NEXT: call void @arg_nonnull_12_noundef_2(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[PTR]], ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR11]] ; CGSCC-NEXT: unreachable ; CGSCC: f: ; CGSCC-NEXT: unreachable @@ -1063,9 +1063,9 @@ ; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(write) } -; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nounwind null_pointer_is_valid willreturn } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nounwind willreturn } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nounwind willreturn memory(readwrite, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) } ; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR10]] = { willreturn } Index: llvm/test/Transforms/Attributor/value-simplify-assume.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-assume.ll +++ llvm/test/Transforms/Attributor/value-simplify-assume.ll @@ -47,13 +47,13 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@drop_assume_1c_nr ; TUNIT-SAME: () #[[ATTR3:[0-9]+]] { -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR6:[0-9]+]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7:[0-9]+]] ; TUNIT-NEXT: ret i1 true ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@drop_assume_1c_nr ; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { -; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8:[0-9]+]] ; CGSCC-NEXT: ret i1 true ; %stack = alloca i1 @@ -94,7 +94,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L]] ; @@ -104,7 +104,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L]] ; @@ -122,7 +122,7 @@ ; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 true ; @@ -131,7 +131,7 @@ ; CGSCC-SAME: () #[[ATTR2]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 true ; @@ -168,7 +168,7 @@ ; TUNIT-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: ret i1 [[ARG]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -176,7 +176,7 @@ ; CGSCC-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[ARG]] ; %stack = alloca i1 @@ -217,7 +217,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L]] ; @@ -227,7 +227,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L]] ; @@ -246,7 +246,7 @@ ; TUNIT-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[ARG]] ; @@ -255,7 +255,7 @@ ; CGSCC-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[ARG]] ; @@ -273,7 +273,7 @@ ; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: br label [[M:%.*]] @@ -287,7 +287,7 @@ ; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: br label [[M:%.*]] @@ -352,7 +352,7 @@ ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: ret i1 [[L]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -368,7 +368,7 @@ ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[L]] ; %stack = alloca i1 @@ -428,7 +428,7 @@ ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7:[0-9]+]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8:[0-9]+]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -437,7 +437,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 @@ -446,7 +446,7 @@ ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -479,8 +479,8 @@ ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -497,8 +497,8 @@ ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -526,17 +526,17 @@ ; TUNIT: t: ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M:%.*]] ; TUNIT: f: ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -545,22 +545,22 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M:%.*]] ; CGSCC: f: ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -590,22 +590,22 @@ ; TUNIT-LABEL: define {{[^@]+}}@assume_5c_nr ; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M:%.*]] ; TUNIT: f: ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -614,22 +614,22 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M:%.*]] ; CGSCC: f: ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -676,13 +676,13 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@drop_assume_1c ; TUNIT-SAME: () #[[ATTR3]] { -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] ; TUNIT-NEXT: ret i1 true ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@drop_assume_1c ; CGSCC-SAME: () #[[ATTR3]] { -; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR8]] ; CGSCC-NEXT: ret i1 true ; %stack = alloca i1 @@ -719,7 +719,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L]] ; @@ -727,7 +727,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L]] ; @@ -744,7 +744,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L4]] ; @@ -752,7 +752,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L4]] ; @@ -788,7 +788,7 @@ ; TUNIT-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: ret i1 [[ARG]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -796,7 +796,7 @@ ; CGSCC-SAME: (i1 returned [[ARG:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[ARG]] ; %stack = alloca i1 @@ -835,7 +835,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L]] ; @@ -844,7 +844,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L]] ; @@ -863,7 +863,7 @@ ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; TUNIT-NEXT: ret i1 [[L]] ; @@ -872,7 +872,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: call void @useI1p(ptr noalias nocapture noundef nonnull dereferenceable(1) [[STACK]]) ; CGSCC-NEXT: ret i1 [[L]] ; @@ -890,7 +890,7 @@ ; TUNIT-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: br label [[M:%.*]] @@ -904,7 +904,7 @@ ; CGSCC-SAME: (i1 returned [[ARG:%.*]], i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[ARG]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: br label [[M:%.*]] @@ -969,7 +969,7 @@ ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] ; TUNIT-NEXT: ret i1 [[L]] ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -985,7 +985,7 @@ ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[L]] ; %stack = alloca i1 @@ -1045,7 +1045,7 @@ ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -1054,7 +1054,7 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 @@ -1063,7 +1063,7 @@ ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -1096,8 +1096,8 @@ ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -1114,8 +1114,8 @@ ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -1143,17 +1143,17 @@ ; TUNIT: t: ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M:%.*]] ; TUNIT: f: ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -1162,22 +1162,22 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 [[ARG]], ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M:%.*]] ; CGSCC: f: ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -1207,22 +1207,22 @@ ; TUNIT-LABEL: define {{[^@]+}}@assume_5c ; TUNIT-SAME: (i1 noundef [[COND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i1, align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef true) #[[ATTR7]] ; TUNIT-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: ; TUNIT-NEXT: store i1 true, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M:%.*]] ; TUNIT: f: ; TUNIT-NEXT: store i1 false, ptr [[STACK]], align 1 ; TUNIT-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] ; TUNIT-NEXT: br label [[M]] ; TUNIT: m: ; TUNIT-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR6]] -; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) @@ -1231,22 +1231,22 @@ ; CGSCC-NEXT: [[STACK:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L1:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L1]]) #[[ATTR8]] ; CGSCC-NEXT: br i1 [[COND]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: ; CGSCC-NEXT: store i1 true, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L2:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L2]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M:%.*]] ; CGSCC: f: ; CGSCC-NEXT: store i1 false, ptr [[STACK]], align 1 ; CGSCC-NEXT: [[L3:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L3]]) #[[ATTR8]] ; CGSCC-NEXT: br label [[M]] ; CGSCC: m: ; CGSCC-NEXT: [[L4:%.*]] = load i1, ptr [[STACK]], align 1 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR7]] -; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[L4]]) #[[ATTR8]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @readI1p(ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[STACK]]) #[[ATTR8]] ; CGSCC-NEXT: ret i1 [[R]] ; %stack = alloca i1 @@ -1279,7 +1279,7 @@ ; TUNIT-SAME: () #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: [[LGS1:%.*]] = load i32, ptr @Gstatic_int1, align 4 ; TUNIT-NEXT: [[C:%.*]] = icmp eq i32 [[LGS1]], 42 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR7]] ; TUNIT-NEXT: [[LGS2:%.*]] = load i32, ptr @Gstatic_int1, align 4 ; TUNIT-NEXT: store i32 17, ptr @Gstatic_int1, align 4 ; TUNIT-NEXT: [[LGS3:%.*]] = load i32, ptr @Gstatic_int1, align 4 @@ -1291,7 +1291,7 @@ ; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: [[LGS1:%.*]] = load i32, ptr @Gstatic_int1, align 4 ; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[LGS1]], 42 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR8]] ; CGSCC-NEXT: [[LGS2:%.*]] = load i32, ptr @Gstatic_int1, align 4 ; CGSCC-NEXT: store i32 17, ptr @Gstatic_int1, align 4 ; CGSCC-NEXT: [[LGS3:%.*]] = load i32, ptr @Gstatic_int1, align 4 @@ -1312,24 +1312,24 @@ ; TODO: Technically we could still utilize the assumption if we employ AA. define i32 @assume_read_global_bad(ptr %p) { ; -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@assume_read_global_bad -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: [[LGS1:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: [[C:%.*]] = icmp eq i32 [[LGS1]], 42 ; TUNIT-NEXT: store i32 13, ptr [[P]], align 4 -; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR6]] +; TUNIT-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR7]] ; TUNIT-NEXT: [[LGS2:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: store i32 17, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: ret i32 [[LGS2]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@assume_read_global_bad -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: [[LGS1:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; CGSCC-NEXT: [[C:%.*]] = icmp eq i32 [[LGS1]], 42 ; CGSCC-NEXT: store i32 13, ptr [[P]], align 4 -; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR7]] +; CGSCC-NEXT: call void @llvm.assume(i1 noundef [[C]]) #[[ATTR8]] ; CGSCC-NEXT: [[LGS2:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; CGSCC-NEXT: store i32 17, ptr @Gstatic_int2, align 4 ; CGSCC-NEXT: ret i32 [[LGS2]] @@ -1345,16 +1345,16 @@ define void @assume_write_globals() { ; -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@assume_write_globals -; TUNIT-SAME: () #[[ATTR5:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR6:[0-9]+]] { ; TUNIT-NEXT: store i32 42, ptr @Gstatic_int1, align 4 ; TUNIT-NEXT: store i32 42, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@assume_write_globals -; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR7:[0-9]+]] { ; CGSCC-NEXT: store i32 42, ptr @Gstatic_int1, align 4 ; CGSCC-NEXT: store i32 42, ptr @Gstatic_int2, align 4 ; CGSCC-NEXT: ret void @@ -1370,9 +1370,10 @@ ; TUNIT: attributes #[[ATTR2]] = { norecurse } ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR6]] = { willreturn } -; TUNIT: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write) } +; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR7]] = { willreturn } +; TUNIT: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn } ;. ; CGSCC: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } @@ -1380,6 +1381,7 @@ ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR7]] = { willreturn } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: write) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR8]] = { willreturn } ;. Index: llvm/test/Transforms/Attributor/value-simplify-dbg.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-dbg.ll +++ llvm/test/Transforms/Attributor/value-simplify-dbg.ll @@ -24,7 +24,7 @@ declare void @use(i32 noundef) define void @src() norecurse !dbg !22 { -; CHECK: Function Attrs: norecurse nosync memory(write) +; CHECK: Function Attrs: norecurse nosync memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@src ; CHECK-SAME: () #[[ATTR0:[0-9]+]] !dbg [[DBG22:![0-9]+]] { ; CHECK-NEXT: entry: @@ -73,7 +73,7 @@ !24 = !DILocation(line: 10, column: 7, scope: !22) !25 = !DILocation(line: 11, column: 1, scope: !22) ;. -; CHECK: attributes #[[ATTR0]] = { norecurse nosync memory(write) } +; CHECK: attributes #[[ATTR0]] = { norecurse nosync memory(write, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR1:[0-9]+]] = { speculatable memory(none) } ;. ; CHECK: [[DBG0]] = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) Index: llvm/test/Transforms/Attributor/value-simplify-dominance.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-dominance.ll +++ llvm/test/Transforms/Attributor/value-simplify-dominance.ll @@ -139,9 +139,9 @@ declare void @usei32(i32) nocallback ; Ensure we use 42, not undef, for %l in the usei32 call and %r in the return. define internal i32 @remote_write_and_read(ptr %p) norecurse { -; TUNIT: Function Attrs: norecurse +; TUNIT: Function Attrs: norecurse memory(readwrite, argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@remote_write_and_read -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: call void @usei32(i32 noundef 42) ; TUNIT-NEXT: ret i32 undef ; @@ -164,7 +164,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@local_stack_remote_write_and_read ; TUNIT-SAME: () #[[ATTR2]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: [[R:%.*]] = call i32 @remote_write_and_read(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) +; TUNIT-NEXT: [[R:%.*]] = call i32 @remote_write_and_read(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR4:[0-9]+]] ; TUNIT-NEXT: ret i32 42 ; ; CGSCC: Function Attrs: norecurse @@ -179,7 +179,13 @@ ret i32 %r } ;. -; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback } -; CHECK: attributes #[[ATTR1]] = { norecurse nosync } -; CHECK: attributes #[[ATTR2]] = { norecurse } +; TUNIT: attributes #[[ATTR0:[0-9]+]] = { nocallback } +; TUNIT: attributes #[[ATTR1]] = { norecurse nosync } +; TUNIT: attributes #[[ATTR2]] = { norecurse } +; TUNIT: attributes #[[ATTR3]] = { norecurse memory(readwrite, argmem: write) } +; TUNIT: attributes #[[ATTR4]] = { memory(readwrite, argmem: write) } +;. +; CGSCC: attributes #[[ATTR0:[0-9]+]] = { nocallback } +; CGSCC: attributes #[[ATTR1]] = { norecurse nosync } +; CGSCC: attributes #[[ATTR2]] = { norecurse } ;. Index: llvm/test/Transforms/Attributor/value-simplify-gpu.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-gpu.ll +++ llvm/test/Transforms/Attributor/value-simplify-gpu.ll @@ -28,7 +28,7 @@ ; CGSCC-LABEL: define {{[^@]+}}@kernel ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: call void @level1Kernel(i32 [[C]]) #[[ATTR4:[0-9]+]] +; CGSCC-NEXT: call void @level1Kernel(i32 [[C]]) #[[ATTR5:[0-9]+]] ; CGSCC-NEXT: ret void ; entry: @@ -41,34 +41,34 @@ ; TUNIT-LABEL: define {{[^@]+}}@level1Kernel ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: call void @level2Kernelall_early() #[[ATTR3:[0-9]+]] +; TUNIT-NEXT: call void @level2Kernelall_early() #[[ATTR4:[0-9]+]] ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: call void @level2Kernela() #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: call void @level2Kernela() #[[ATTR5:[0-9]+]] ; TUNIT-NEXT: br label [[IF_END:%.*]] ; TUNIT: if.else: -; TUNIT-NEXT: call void @level2Kernelb() #[[ATTR4]] +; TUNIT-NEXT: call void @level2Kernelb() #[[ATTR5]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: -; TUNIT-NEXT: call void @level2Kernelall_late() #[[ATTR4]] +; TUNIT-NEXT: call void @level2Kernelall_late() #[[ATTR6:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: norecurse nosync nounwind ; CGSCC-LABEL: define {{[^@]+}}@level1Kernel ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: call void @level2Kernelall_early() #[[ATTR5:[0-9]+]] +; CGSCC-NEXT: call void @level2Kernelall_early() #[[ATTR6:[0-9]+]] ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: call void @level2Kernela() #[[ATTR4]] +; CGSCC-NEXT: call void @level2Kernela() #[[ATTR5]] ; CGSCC-NEXT: br label [[IF_END:%.*]] ; CGSCC: if.else: -; CGSCC-NEXT: call void @level2Kernelb() #[[ATTR4]] +; CGSCC-NEXT: call void @level2Kernelb() #[[ATTR5]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: -; CGSCC-NEXT: call void @level2Kernelall_late() #[[ATTR4]] +; CGSCC-NEXT: call void @level2Kernelall_late() #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -90,7 +90,7 @@ } define internal void @level2Kernelall_early() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@level2Kernelall_early ; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: @@ -112,7 +112,7 @@ ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4 -; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR5:[0-9]+]] +; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR7:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: nosync nounwind @@ -122,7 +122,7 @@ ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4 -; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -141,7 +141,7 @@ ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4 ; TUNIT-NEXT: [[TMP2:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4 -; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR5]] +; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR7]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: nosync nounwind @@ -151,7 +151,7 @@ ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableKernel to ptr), align 4 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr @ReachableKernelAS0, align 4 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableKernel to ptr), align 4 -; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 noundef [[TMP2]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -163,7 +163,7 @@ } define internal void @level2Kernelall_late() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@level2Kernelall_late ; CHECK-SAME: () #[[ATTR2]] { ; CHECK-NEXT: entry: @@ -190,7 +190,7 @@ ; CGSCC-LABEL: define {{[^@]+}}@non_kernel ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: call void @level1(i32 [[C]]) #[[ATTR4]] +; CGSCC-NEXT: call void @level1(i32 [[C]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -204,17 +204,17 @@ ; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[LOCAL:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR3]] +; TUNIT-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]] ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: -; TUNIT-NEXT: call void @level2a() #[[ATTR4]] +; TUNIT-NEXT: call void @level2a() #[[ATTR5]] ; TUNIT-NEXT: br label [[IF_END:%.*]] ; TUNIT: if.else: -; TUNIT-NEXT: call void @level2b() #[[ATTR4]] +; TUNIT-NEXT: call void @level2b() #[[ATTR5]] ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: -; TUNIT-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]] +; TUNIT-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: norecurse nosync nounwind @@ -222,17 +222,17 @@ ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[LOCAL:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]] +; CGSCC-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]] ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; CGSCC: if.then: -; CGSCC-NEXT: call void @level2a(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]] +; CGSCC-NEXT: call void @level2a(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]] ; CGSCC-NEXT: br label [[IF_END:%.*]] ; CGSCC: if.else: -; CGSCC-NEXT: call void @level2b(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]] +; CGSCC-NEXT: call void @level2b(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]] ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: -; CGSCC-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]] +; CGSCC-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -255,14 +255,14 @@ } define internal void @level2all_early(ptr %addr) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@level2all_early ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store i32 1, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@level2all_early ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: @@ -277,23 +277,23 @@ } define internal void @level2a(ptr %addr) { -; TUNIT: Function Attrs: norecurse nosync nounwind +; TUNIT: Function Attrs: norecurse nosync nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@level2a -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4 -; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR5]] +; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR7]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nosync nounwind +; CGSCC: Function Attrs: nosync nounwind memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@level2a -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4 ; CGSCC-NEXT: [[QQQQ2:%.*]] = load i32, ptr [[ADDR]], align 4 -; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[QQQQ2]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[QQQQ2]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -305,23 +305,23 @@ } define internal void @level2b(ptr %addr) { -; TUNIT: Function Attrs: norecurse nosync nounwind +; TUNIT: Function Attrs: norecurse nosync nounwind memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@level2b -; TUNIT-SAME: () #[[ATTR1]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4 -; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR5]] +; TUNIT-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 17) #[[ATTR7]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nosync nounwind +; CGSCC: Function Attrs: nosync nounwind memory(readwrite, argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@level2b -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @ReachableNonKernel to ptr), align 4 ; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4 ; CGSCC-NEXT: [[TMP2:%.*]] = load i32, ptr [[ADDR]], align 4 -; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[TMP2]]) #[[ATTR4]] +; CGSCC-NEXT: call void @use(i32 noundef [[TMP0]], i32 noundef [[TMP1]], i32 [[TMP2]]) #[[ATTR5]] ; CGSCC-NEXT: ret void ; entry: @@ -333,14 +333,14 @@ } define internal void @level2all_late(ptr %addr) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@level2all_late ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store i32 1, ptr addrspacecast (ptr addrspace(3) @UnreachableNonKernel to ptr), align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@level2all_late ; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: @@ -359,15 +359,18 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { norecurse nosync nounwind "kernel" } ; TUNIT: attributes #[[ATTR1]] = { norecurse nosync nounwind } -; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR4]] = { nosync nounwind } -; TUNIT: attributes #[[ATTR5]] = { nounwind } +; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR3]] = { norecurse nosync nounwind memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR5]] = { nosync nounwind } +; TUNIT: attributes #[[ATTR6]] = { nosync nounwind memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR7]] = { nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { norecurse nosync nounwind "kernel" } ; CGSCC: attributes #[[ATTR1]] = { norecurse nosync nounwind } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR3]] = { nosync nounwind } -; CGSCC: attributes #[[ATTR4]] = { nounwind } -; CGSCC: attributes #[[ATTR5]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR4]] = { nosync nounwind memory(readwrite, argmem: read) } +; CGSCC: attributes #[[ATTR5]] = { nounwind } +; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/value-simplify-instances.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-instances.ll +++ llvm/test/Transforms/Attributor/value-simplify-instances.ll @@ -24,26 +24,28 @@ } define internal i1 @recursive_inst_generator(i1 %c, ptr %p) { +; TUNIT: Function Attrs: memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_inst_generator -; TUNIT-SAME: (i1 [[C:%.*]], ptr nofree [[P:%.*]]) { +; TUNIT-SAME: (i1 [[C:%.*]], ptr noalias nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = call ptr @geti1Ptr() ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone [[P]]) #[[ATTR7:[0-9]+]] +; TUNIT-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone [[P]]) #[[ATTR8:[0-9]+]] ; TUNIT-NEXT: ret i1 [[R1]] ; TUNIT: f: -; TUNIT-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, ptr nofree [[A]]) +; TUNIT-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, ptr noalias nofree readnone [[A]]) ; TUNIT-NEXT: ret i1 [[R2]] ; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_generator -; CGSCC-SAME: (i1 [[C:%.*]], ptr nofree [[P:%.*]]) { +; CGSCC-SAME: (i1 [[C:%.*]], ptr noalias nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = call ptr @geti1Ptr() ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(ptr noalias nofree readnone [[A]], ptr noalias nofree readnone [[P]]) +; CGSCC-NEXT: [[R1:%.*]] = call i1 @recursive_inst_comparator(ptr noalias nofree [[A]], ptr noalias nofree [[P]]) ; CGSCC-NEXT: ret i1 [[R1]] ; CGSCC: f: -; CGSCC-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, ptr nofree [[A]]) +; CGSCC-NEXT: [[R2:%.*]] = call i1 @recursive_inst_generator(i1 noundef true, ptr noalias nofree readnone [[A]]) ; CGSCC-NEXT: ret i1 [[R2]] ; %a = call ptr @geti1Ptr() @@ -60,7 +62,7 @@ define i1 @recursive_inst_generator_caller(i1 %c) { ; CHECK-LABEL: define {{[^@]+}}@recursive_inst_generator_caller ; CHECK-SAME: (i1 [[C:%.*]]) { -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]], ptr undef) +; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_generator(i1 [[C]], ptr readnone undef) ; CHECK-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_generator(i1 %c, ptr undef) @@ -69,15 +71,16 @@ ; Make sure we do *not* return true. define internal i1 @recursive_inst_compare(i1 %c, ptr %p) { +; CHECK: Function Attrs: memory(readwrite, argmem: none) ; CHECK-LABEL: define {{[^@]+}}@recursive_inst_compare -; CHECK-SAME: (i1 [[C:%.*]], ptr [[P:%.*]]) { +; CHECK-SAME: (i1 [[C:%.*]], ptr noalias readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: [[A:%.*]] = call ptr @geti1Ptr() ; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CHECK: t: ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] ; CHECK-NEXT: ret i1 [[CMP]] ; CHECK: f: -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare(i1 noundef true, ptr [[A]]) +; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare(i1 noundef true, ptr noalias readnone [[A]]) ; CHECK-NEXT: ret i1 [[CALL]] ; %a = call ptr @geti1Ptr() @@ -94,7 +97,7 @@ define i1 @recursive_inst_compare_caller(i1 %c) { ; CHECK-LABEL: define {{[^@]+}}@recursive_inst_compare_caller ; CHECK-SAME: (i1 [[C:%.*]]) { -; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare(i1 [[C]], ptr undef) +; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare(i1 [[C]], ptr readnone undef) ; CHECK-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare(i1 %c, ptr undef) @@ -103,29 +106,17 @@ ; Make sure we do *not* return true. define internal i1 @recursive_alloca_compare(i1 %c, ptr %p) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(none) -; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 -; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; TUNIT: t: -; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] -; TUNIT-NEXT: ret i1 [[CMP]] -; TUNIT: f: -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, ptr noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR4:[0-9]+]] -; TUNIT-NEXT: ret i1 [[CALL]] -; -; CGSCC: Function Attrs: nofree nosync nounwind memory(none) -; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] { -; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 -; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] -; CGSCC: t: -; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] -; CGSCC-NEXT: ret i1 [[CMP]] -; CGSCC: f: -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, ptr noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR3:[0-9]+]] -; CGSCC-NEXT: ret i1 [[CALL]] +; CHECK: Function Attrs: nofree nosync nounwind memory(none) +; CHECK-LABEL: define {{[^@]+}}@recursive_alloca_compare +; CHECK-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree nonnull readnone [[P:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-NEXT: [[A:%.*]] = alloca i1, align 1 +; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] +; CHECK: t: +; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] +; CHECK-NEXT: ret i1 [[CMP]] +; CHECK: f: +; CHECK-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef true, ptr noalias nofree noundef nonnull readnone dereferenceable(1) [[A]]) #[[ATTR2]] +; CHECK-NEXT: ret i1 [[CALL]] ; %a = alloca i1 br i1 %c, label %t, label %f @@ -141,14 +132,14 @@ define i1 @recursive_alloca_compare_caller(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] { -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], ptr undef) #[[ATTR4]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 [[C]], ptr readnone undef) #[[ATTR9:[0-9]+]] ; TUNIT-NEXT: ret i1 [[CALL]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef [[C]], ptr undef) #[[ATTR5:[0-9]+]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare(i1 noundef [[C]], ptr readnone undef) #[[ATTR6:[0-9]+]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare(i1 %c, ptr undef) @@ -157,9 +148,9 @@ ; Make sure we do *not* simplify this to return 0 or 1, return 42 is ok though. define internal i8 @recursive_alloca_load_return(i1 %c, ptr %p, i8 %v) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_load_return -; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: store i8 [[V]], ptr [[A]], align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -171,9 +162,9 @@ ; TUNIT-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef true, ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[A]], i8 noundef 1) #[[ATTR4]] ; TUNIT-NEXT: ret i8 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_load_return -; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]], ptr nocapture nofree nonnull readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: store i8 [[V]], ptr [[A]], align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -200,14 +191,14 @@ define i8 @recursive_alloca_load_return_caller(i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; TUNIT-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], ptr undef, i8 noundef 42) #[[ATTR4]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR3]] { +; TUNIT-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 [[C]], ptr readonly undef, i8 noundef 42) #[[ATTR9]] ; TUNIT-NEXT: ret i8 [[CALL]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_load_return_caller -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef [[C]], ptr undef, i8 noundef 42) #[[ATTR5]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i8 @recursive_alloca_load_return(i1 noundef [[C]], ptr readonly undef, i8 noundef 42) #[[ATTR6]] ; CGSCC-NEXT: ret i8 [[CALL]] ; %call = call i8 @recursive_alloca_load_return(i1 %c, ptr undef, i8 42) @@ -220,9 +211,9 @@ ; Make sure we do *not* return true. define internal i1 @recursive_alloca_compare_global1(i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 -; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: @@ -231,12 +222,12 @@ ; TUNIT-NEXT: ret i1 [[CMP]] ; TUNIT: f: ; TUNIT-NEXT: store ptr [[A]], ptr @G1, align 8 -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR4]] +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR5]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_global1 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: @@ -245,7 +236,7 @@ ; CGSCC-NEXT: ret i1 [[CMP]] ; CGSCC: f: ; CGSCC-NEXT: store ptr [[A]], ptr @G1, align 8 -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR3]] +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef true) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %a = alloca i1 @@ -262,16 +253,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global1(i1 %c) { -; TUNIT: Function Attrs: nofree norecurse nosync nounwind +; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR5:[0-9]+]] { -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR4]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 [[C]]) #[[ATTR9]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global1 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef [[C]]) #[[ATTR5]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global1(i1 noundef [[C]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global1(i1 %c) @@ -279,9 +270,9 @@ } define internal i1 @recursive_alloca_compare_global2(i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 -; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i1, align 1 ; TUNIT-NEXT: [[P:%.*]] = load ptr, ptr @G2, align 8 ; TUNIT-NEXT: store ptr [[A]], ptr @G2, align 8 @@ -290,12 +281,12 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] ; TUNIT-NEXT: ret i1 [[CMP]] ; TUNIT: f: -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR4]] +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR5]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_global2 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i1, align 1 ; CGSCC-NEXT: [[P:%.*]] = load ptr, ptr @G2, align 8 ; CGSCC-NEXT: store ptr [[A]], ptr @G2, align 8 @@ -304,7 +295,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq ptr [[A]], [[P]] ; CGSCC-NEXT: ret i1 [[CMP]] ; CGSCC: f: -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR3]] +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef true) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %a = alloca i1 @@ -321,16 +312,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_alloca_compare_caller_global2(i1 %c) { -; TUNIT: Function Attrs: nofree norecurse nosync nounwind +; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR4]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 [[C]]) #[[ATTR9]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_alloca_compare_caller_global2 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef [[C]]) #[[ATTR5]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_alloca_compare_global2(i1 noundef [[C]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_alloca_compare_global2(i1 %c) @@ -338,9 +329,9 @@ } define internal i1 @recursive_inst_compare_global3(i1 %c) { ; -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 -; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR5]] { ; TUNIT-NEXT: [[P:%.*]] = load i1, ptr @G3, align 1 ; TUNIT-NEXT: store i1 [[C]], ptr @G3, align 1 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -348,12 +339,12 @@ ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i1 [[C]], [[P]] ; TUNIT-NEXT: ret i1 [[CMP]] ; TUNIT: f: -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR4]] +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR5]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_compare_global3 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { ; CGSCC-NEXT: [[P:%.*]] = load i1, ptr @G3, align 1 ; CGSCC-NEXT: store i1 [[C]], ptr @G3, align 1 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] @@ -361,7 +352,7 @@ ; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i1 [[C]], [[P]] ; CGSCC-NEXT: ret i1 [[CMP]] ; CGSCC: f: -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR3]] +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef true) #[[ATTR4]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %p = load i1, ptr @G3 @@ -377,16 +368,16 @@ ; FIXME: This should *not* return true. define i1 @recursive_inst_compare_caller_global3(i1 %c) { -; TUNIT: Function Attrs: nofree norecurse nosync nounwind +; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR5]] { -; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR4]] +; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 [[C]]) #[[ATTR9]] ; TUNIT-NEXT: ret i1 [[CALL]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_inst_compare_caller_global3 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef [[C]]) #[[ATTR5]] +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4]] { +; CGSCC-NEXT: [[CALL:%.*]] = call i1 @recursive_inst_compare_global3(i1 noundef [[C]]) #[[ATTR6]] ; CGSCC-NEXT: ret i1 [[CALL]] ; %call = call i1 @recursive_inst_compare_global3(i1 %c) @@ -396,7 +387,7 @@ define i32 @non_unique_phi_ops(ptr %ptr) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@non_unique_phi_ops -; TUNIT-SAME: (ptr nocapture nofree readonly [[PTR:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[PTR:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[HEADER:%.*]] ; TUNIT: header: @@ -418,7 +409,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@non_unique_phi_ops -; CGSCC-SAME: (ptr nocapture nofree readonly [[PTR:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree readonly [[PTR:%.*]]) #[[ATTR5:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[HEADER:%.*]] ; CGSCC: header: @@ -462,18 +453,21 @@ ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind } -; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR7]] = { nounwind } +; TUNIT: attributes #[[ATTR1]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR2]] = { nofree nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; TUNIT: attributes #[[ATTR8]] = { nounwind } +; TUNIT: attributes #[[ATTR9]] = { nofree nosync nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR1]] = { nofree nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR3]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR5]] = { nounwind } +; CGSCC: attributes #[[ATTR1]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR3]] = { nofree nosync nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR4]] = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR6]] = { nounwind } ;. Index: llvm/test/Transforms/Attributor/value-simplify-local-remote.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-local-remote.ll +++ llvm/test/Transforms/Attributor/value-simplify-local-remote.ll @@ -21,7 +21,7 @@ ; TUNIT-NEXT: store ptr [[FIRST]], ptr [[FIRST]], align 8 ; TUNIT-NEXT: br label [[IF_END:%.*]] ; TUNIT: if.end: -; TUNIT-NEXT: [[CALL:%.*]] = call ptr @foo.4(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FIRST]]) #[[ATTR3:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call ptr @foo.4(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FIRST]]) #[[ATTR2:[0-9]+]] ; TUNIT-NEXT: ret i64 0 ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) @@ -32,7 +32,7 @@ ; CGSCC-NEXT: store ptr [[FIRST]], ptr [[FIRST]], align 8 ; CGSCC-NEXT: br label [[IF_END:%.*]] ; CGSCC: if.end: -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @foo.4(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FIRST]]) #[[ATTR6:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call ptr @foo.4(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FIRST]]) #[[ATTR4:[0-9]+]] ; CGSCC-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds double, ptr [[CALL]], i64 -1 ; CGSCC-NEXT: ret i64 0 ; @@ -63,7 +63,7 @@ ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[__FIRST_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: store ptr [[__FIRST]], ptr [[__FIRST]], align 8 -; CGSCC-NEXT: [[CALL1:%.*]] = call noalias noundef nonnull align 8 dereferenceable(8) ptr @bar(ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[__FIRST]]) #[[ATTR7:[0-9]+]] +; CGSCC-NEXT: [[CALL1:%.*]] = call noalias noundef nonnull align 8 dereferenceable(8) ptr @bar(ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[__FIRST]]) #[[ATTR5:[0-9]+]] ; CGSCC-NEXT: ret ptr [[CALL1]] ; entry: @@ -101,21 +101,21 @@ } define ptr @t2(ptr %this, ptr %this.addr, ptr %this1) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@t2 -; TUNIT-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @foo.1(ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR4:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @foo.1(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR3:[0-9]+]] ; TUNIT-NEXT: [[TEST_RET:%.*]] = extractvalue [[S]] [[CALL]], 0 ; TUNIT-NEXT: ret ptr [[TEST_RET]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@t2 -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR2:[0-9]+]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @foo.1(ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR6]] +; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @foo.1(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[TEST_RET:%.*]] = extractvalue [[S]] [[CALL]], 0 ; CGSCC-NEXT: ret ptr [[TEST_RET]] ; @@ -128,23 +128,23 @@ } define internal %S @foo.1(ptr %foo.this) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@foo.1 -; TUNIT-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[FOO_THIS:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FOO_THIS:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; TUNIT-NEXT: store ptr [[FOO_THIS]], ptr [[FOO_THIS]], align 8 -; TUNIT-NEXT: call void @bar.2(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FOO_THIS]]) #[[ATTR4]] +; TUNIT-NEXT: call void @bar.2(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[FOO_THIS]]) #[[ATTR4:[0-9]+]] ; TUNIT-NEXT: [[FOO_RET:%.*]] = load [[S]], ptr [[RETVAL]], align 8 ; TUNIT-NEXT: ret [[S]] [[FOO_RET]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@foo.1 -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[FOO_THIS:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FOO_THIS:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; CGSCC-NEXT: store ptr [[FOO_THIS]], ptr [[FOO_THIS]], align 8 -; CGSCC-NEXT: call void @bar.2(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[FOO_THIS]]) #[[ATTR8:[0-9]+]] +; CGSCC-NEXT: call void @bar.2(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[FOO_THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[FOO_RET:%.*]] = load [[S]], ptr [[RETVAL]], align 8 ; CGSCC-NEXT: ret [[S]] [[FOO_RET]] ; @@ -159,18 +159,18 @@ define internal void @bar.2(ptr %bar.this, ptr %bar.data) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@bar.2 -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS:%.*]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_DATA:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[BAR_DATA:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store ptr [[BAR_DATA]], ptr [[BAR_THIS]], align 8 -; TUNIT-NEXT: call void @baz(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_DATA]]) #[[ATTR4]] +; TUNIT-NEXT: call void @baz(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[BAR_DATA]]) #[[ATTR4]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@bar.2 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS:%.*]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_DATA:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[BAR_DATA:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store ptr [[BAR_DATA]], ptr [[BAR_THIS]], align 8 -; CGSCC-NEXT: call void @baz(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_DATA]]) #[[ATTR8]] +; CGSCC-NEXT: call void @baz(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAR_THIS]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[BAR_DATA]]) #[[ATTR4]] ; CGSCC-NEXT: ret void ; entry: @@ -182,14 +182,14 @@ define internal void @baz(ptr %baz.this, ptr %baz.data) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@baz -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAZ_THIS:%.*]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAZ_DATA:%.*]]) #[[ATTR0]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAZ_THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[BAZ_DATA:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store ptr [[BAZ_DATA]], ptr [[BAZ_THIS]], align 8 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@baz -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAZ_THIS:%.*]], ptr nofree writeonly [[BAZ_DATA:%.*]]) #[[ATTR3:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[BAZ_THIS:%.*]], ptr noalias nofree readnone [[BAZ_DATA:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store ptr [[BAZ_DATA]], ptr [[BAZ_THIS]], align 8 ; CGSCC-NEXT: ret void @@ -200,21 +200,21 @@ } define ptr @foo(ptr %this, ptr %this.addr, ptr %this1) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@foo -; TUNIT-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @bar.5(ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @bar.5(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR2]] ; TUNIT-NEXT: [[FOO_RET:%.*]] = extractvalue [[S]] [[CALL]], 0 ; TUNIT-NEXT: ret ptr [[FOO_RET]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@foo -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @bar.5(ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR6]] +; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @bar.5(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[FOO_RET:%.*]] = extractvalue [[S]] [[CALL]], 0 ; CGSCC-NEXT: ret ptr [[FOO_RET]] ; @@ -227,23 +227,23 @@ } define internal %S @bar.5(ptr %this) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@bar.5 -; TUNIT-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; TUNIT-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; TUNIT-NEXT: call void @baz.6(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR3]] +; TUNIT-NEXT: call void @baz.6(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[THIS]]) #[[ATTR5:[0-9]+]] ; TUNIT-NEXT: [[BAR_RET:%.*]] = load [[S]], ptr [[RETVAL]], align 8 ; TUNIT-NEXT: ret [[S]] [[BAR_RET]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@bar.5 -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; CGSCC-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; CGSCC-NEXT: call void @baz.6(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR9:[0-9]+]] +; CGSCC-NEXT: call void @baz.6(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[BAR_RET:%.*]] = load [[S]], ptr [[RETVAL]], align 8 ; CGSCC-NEXT: ret [[S]] [[BAR_RET]] ; @@ -257,20 +257,20 @@ } define internal void @baz.6(ptr %this, ptr %data) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@baz.6 -; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store ptr [[DATA]], ptr [[THIS]], align 8 -; TUNIT-NEXT: call void @boom(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[DATA]]) #[[ATTR4]] +; TUNIT-NEXT: call void @boom(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA]]) #[[ATTR3]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@baz.6 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store ptr [[DATA]], ptr [[THIS]], align 8 -; CGSCC-NEXT: call void @boom(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[DATA]]) #[[ATTR9]] +; CGSCC-NEXT: call void @boom(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA]]) #[[ATTR4]] ; CGSCC-NEXT: ret void ; entry: @@ -280,9 +280,9 @@ } define internal void @boom(ptr %this, ptr %data) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@boom -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree noundef nonnull align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[DATA_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; TUNIT-NEXT: store ptr [[DATA]], ptr [[DATA_ADDR]], align 8 @@ -290,9 +290,9 @@ ; TUNIT-NEXT: store ptr [[V]], ptr [[THIS]], align 8 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@boom -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree [[DATA:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree readnone [[DATA:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[DATA_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: store ptr [[DATA]], ptr [[DATA_ADDR]], align 8 @@ -342,14 +342,6 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: [[RETVAL:%.*]] = alloca [[S_2:%.*]], align 8 ; CHECK-NEXT: call void @ext1(ptr noundef nonnull align 8 dereferenceable(24) [[RETVAL]]) -; CHECK-NEXT: [[DOTFCA_0_LOAD:%.*]] = load ptr, ptr [[RETVAL]], align 8 -; CHECK-NEXT: [[DOTFCA_0_INSERT:%.*]] = insertvalue [[S_2]] poison, ptr [[DOTFCA_0_LOAD]], 0 -; CHECK-NEXT: [[DOTFCA_1_GEP:%.*]] = getelementptr inbounds [[S_2]], ptr [[RETVAL]], i32 0, i32 1 -; CHECK-NEXT: [[DOTFCA_1_LOAD:%.*]] = load i64, ptr [[DOTFCA_1_GEP]], align 8 -; CHECK-NEXT: [[DOTFCA_1_INSERT:%.*]] = insertvalue [[S_2]] [[DOTFCA_0_INSERT]], i64 [[DOTFCA_1_LOAD]], 1 -; CHECK-NEXT: [[DOTFCA_2_GEP:%.*]] = getelementptr inbounds [[S_2]], ptr [[RETVAL]], i32 0, i32 2 -; CHECK-NEXT: [[DOTFCA_2_LOAD:%.*]] = load i64, ptr [[DOTFCA_2_GEP]], align 8 -; CHECK-NEXT: [[DOTFCA_2_INSERT:%.*]] = insertvalue [[S_2]] [[DOTFCA_1_INSERT]], i64 [[DOTFCA_2_LOAD]], 2 ; CHECK-NEXT: ret [[S_2]] zeroinitializer ; entry: @@ -373,7 +365,7 @@ define dso_local void @spam() { ; TUNIT: Function Attrs: nofree norecurse noreturn nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@spam -; TUNIT-SAME: () #[[ATTR2:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR1:[0-9]+]] { ; TUNIT-NEXT: bb: ; TUNIT-NEXT: [[TMP:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[X:%.*]] = fptosi float undef to i32 @@ -404,7 +396,7 @@ ; ; CGSCC: Function Attrs: nofree norecurse noreturn nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@spam -; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { ; CGSCC-NEXT: bb: ; CGSCC-NEXT: [[TMP:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[X:%.*]] = fptosi float undef to i32 @@ -481,16 +473,16 @@ ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[THIS_ADDR1:%.*]] = alloca ptr, i32 0, align 8 ; TUNIT-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @t4a(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR3]] +; TUNIT-NEXT: [[CALL:%.*]] = call [[S:%.*]] @t4a(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR2]] ; TUNIT-NEXT: ret double 0.000000e+00 ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@t4 -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nocapture nofree readnone [[THIS_ADDR:%.*]], ptr nocapture nofree readnone [[THIS1:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[THIS_ADDR1:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @t4a(ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS]]) #[[ATTR6]] +; CGSCC-NEXT: [[CALL:%.*]] = call [[S:%.*]] @t4a(ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[TMP0:%.*]] = extractvalue [[S]] [[CALL]], 0 ; CGSCC-NEXT: ret double 0.000000e+00 ; @@ -511,17 +503,17 @@ ; TUNIT-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; TUNIT-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; TUNIT-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; TUNIT-NEXT: call void @t4b(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]]) #[[ATTR4]] +; TUNIT-NEXT: call void @t4b(ptr noalias nocapture nofree noundef nonnull writeonly align 8 [[RETVAL]]) #[[ATTR3]] ; TUNIT-NEXT: ret [[S]] undef ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@t4a -; CGSCC-SAME: (ptr nofree noundef nonnull align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR2]] { +; CGSCC-SAME: (ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[RETVAL:%.*]] = alloca [[S:%.*]], i32 0, align 8 ; CGSCC-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: store ptr [[THIS]], ptr [[THIS]], align 8 -; CGSCC-NEXT: call void @t4b(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR8]] +; CGSCC-NEXT: call void @t4b(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[RETVAL]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] ; CGSCC-NEXT: [[TMP0:%.*]] = load [[S]], ptr [[RETVAL]], align 8 ; CGSCC-NEXT: ret [[S]] [[TMP0]] ; @@ -545,17 +537,17 @@ ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; TUNIT-NEXT: [[DATA_ADDR:%.*]] = alloca ptr, i32 0, align 8 -; TUNIT-NEXT: call void @t4c(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR4]] +; TUNIT-NEXT: call void @t4c(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]]) #[[ATTR3]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@t4b -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR0]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA:%.*]]) #[[ATTR0]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: [[DATA_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: store ptr [[DATA]], ptr [[THIS]], align 8 -; CGSCC-NEXT: call void @t4c(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr nofree noundef nonnull writeonly align 8 dereferenceable(8) [[DATA]]) #[[ATTR8]] +; CGSCC-NEXT: call void @t4c(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS]], ptr noalias nofree noundef nonnull readnone align 8 dereferenceable(8) [[DATA]]) #[[ATTR4]] ; CGSCC-NEXT: ret void ; entry: @@ -580,7 +572,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@t4c -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr nofree writeonly [[DATA:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[THIS:%.*]], ptr noalias nofree readnone [[DATA:%.*]]) #[[ATTR2]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, i32 0, align 8 ; CGSCC-NEXT: [[DATA_ADDR:%.*]] = alloca ptr, i32 0, align 8 @@ -612,21 +604,18 @@ !7 = !{i32 2, !"Debug Info Version", i32 3} ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR2]] = { nofree norecurse noreturn nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR1]] = { nofree norecurse noreturn nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn memory(argmem: write) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR5]] = { nofree norecurse noreturn nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR6]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR7]] = { willreturn } -; CGSCC: attributes #[[ATTR8]] = { nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR9]] = { nounwind willreturn memory(readwrite) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR3]] = { nofree norecurse noreturn nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR4]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR5]] = { willreturn } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 2, !"SDK Version", [2 x i32] [i32 11, i32 5]} ; CHECK: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} Index: llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll +++ llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll @@ -76,8 +76,9 @@ } define void @write_random(ptr %p) { +; CHECK: Function Attrs: memory(readwrite, argmem: write) ; CHECK-LABEL: define {{[^@]+}}@write_random -; CHECK-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) { +; CHECK-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL:%.*]] = call i32 (...) @random() ; CHECK-NEXT: store i32 [[CALL]], ptr [[P]], align 4, !tbaa [[TBAA3]] @@ -109,20 +110,20 @@ ; return r; ; } define void @local_alloca_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nocapture nofree nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR0]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR17:[0-9]+]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR22:[0-9]+]] ; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4 ; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5 -; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR18:[0-9]+]] +; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR23:[0-9]+]] ; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR23]] ; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR23]] ; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 ; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] ; TUNIT-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4 @@ -134,26 +135,26 @@ ; TUNIT-NEXT: store i32 4, ptr [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] ; TUNIT-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2 ; TUNIT-NEXT: store i32 4, ptr [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR22]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR20:[0-9]+]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR28:[0-9]+]] ; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7:![0-9]+]] ; CGSCC-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 4 ; CGSCC-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 4, !tbaa [[TBAA10:![0-9]+]] ; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5 ; CGSCC-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11:![0-9]+]] -; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR21:[0-9]+]] +; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR29:[0-9]+]] ; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR29]] ; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR29]] ; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; CGSCC-NEXT: [[I4:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]] ; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 @@ -183,7 +184,7 @@ ; CGSCC-NEXT: [[ADD15:%.*]] = add nsw i32 [[I10]], [[I11]] ; CGSCC-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 2 ; CGSCC-NEXT: store i32 [[ADD15]], ptr [[I316]], align 4, !tbaa [[TBAA14]] -; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 24, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(24) [[S]]) #[[ATTR28]] ; CGSCC-NEXT: ret void ; entry: @@ -253,12 +254,12 @@ ; } ; define void @local_alloca_simplifiable_2() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 ; TUNIT-SAME: () #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR22]] ; TUNIT-NEXT: br label [[FOR_COND:%.*]] ; TUNIT: for.cond: ; TUNIT-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] @@ -308,7 +309,7 @@ ; TUNIT: for.end24: ; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 1023 ; TUNIT-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 500 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR23]] ; TUNIT-NEXT: br label [[FOR_COND28:%.*]] ; TUNIT: for.cond28: ; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -324,15 +325,15 @@ ; TUNIT-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 ; TUNIT-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] ; TUNIT: for.end38: -; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR22]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 -; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR28]] ; CGSCC-NEXT: br label [[FOR_COND:%.*]] ; CGSCC: for.cond: ; CGSCC-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] @@ -386,7 +387,7 @@ ; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 1023 ; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] ; CGSCC-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 500 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[ARRAYIDX26]], i32 noundef 0) #[[ATTR29]] ; CGSCC-NEXT: br label [[FOR_COND28:%.*]] ; CGSCC: for.cond28: ; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -404,7 +405,7 @@ ; CGSCC-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 ; CGSCC-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] ; CGSCC: for.end38: -; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 1024, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[BYTES]]) #[[ATTR28]] ; CGSCC-NEXT: ret void ; entry: @@ -513,12 +514,19 @@ ; } ; define i32 @local_alloca_simplifiable_3() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 -; CHECK-SAME: () #[[ATTR4:[0-9]+]] { -; CHECK-NEXT: br label [[SPLIT:%.*]] -; CHECK: split: -; CHECK-NEXT: ret i32 2 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; TUNIT-SAME: () #[[ATTR4:[0-9]+]] { +; TUNIT-NEXT: br label [[SPLIT:%.*]] +; TUNIT: split: +; TUNIT-NEXT: ret i32 2 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 +; CGSCC-SAME: () #[[ATTR5:[0-9]+]] { +; CGSCC-NEXT: br label [[SPLIT:%.*]] +; CGSCC: split: +; CGSCC-NEXT: ret i32 2 ; %A = alloca i32, align 4 store i32 1, ptr %A @@ -534,10 +542,15 @@ ; } ; define i32 @local_alloca_simplifiable_4() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 -; CHECK-SAME: () #[[ATTR4]] { -; CHECK-NEXT: ret i32 undef +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-NEXT: ret i32 undef +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: ret i32 undef ; %A = alloca i32, align 4 %l = load i32, ptr %A, align 4 @@ -551,12 +564,12 @@ ; return *p; ; } define i32 @multi_obj_simplifiable_1(i32 %cnd) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 ; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[L:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR22]] ; TUNIT-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; TUNIT: cond.true: @@ -564,15 +577,15 @@ ; TUNIT: cond.false: ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: -; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR22]] ; TUNIT-NEXT: ret i32 5 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR5:[0-9]+]] { +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR28]] ; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; CGSCC: cond.true: @@ -580,7 +593,7 @@ ; CGSCC: cond.false: ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: -; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR28]] ; CGSCC-NEXT: ret i32 5 ; entry: @@ -613,12 +626,12 @@ ; } ; define i32 @multi_obj_simplifiable_2(i32 %cnd) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 ; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[L:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR22]] ; TUNIT-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; TUNIT: cond.true: @@ -626,15 +639,15 @@ ; TUNIT: cond.false: ; TUNIT-NEXT: br label [[COND_END]] ; TUNIT: cond.end: -; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR22]] ; TUNIT-NEXT: ret i32 5 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR6]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[L:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR28]] ; CGSCC-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] ; CGSCC: cond.true: @@ -642,7 +655,7 @@ ; CGSCC: cond.false: ; CGSCC-NEXT: br label [[COND_END]] ; CGSCC: cond.end: -; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[L]]) #[[ATTR28]] ; CGSCC-NEXT: ret i32 5 ; entry: @@ -684,13 +697,13 @@ ; } ; define void @static_global_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nocapture nofree nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR3]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR18]] -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR18]] -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR23]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR23]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR23]] ; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 ; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]] ; TUNIT-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 4 @@ -704,16 +717,16 @@ ; TUNIT-NEXT: store i32 4, ptr [[I3]], align 4, !tbaa [[TBAA14]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR7:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]] ; CGSCC-NEXT: store float 0x40019999A0000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 4), align 4, !tbaa [[TBAA10]] ; CGSCC-NEXT: store float 0x400A666660000000, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 5), align 4, !tbaa [[TBAA11]] -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR21]] -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR21]] -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) @Gs1, i32 noundef 1) #[[ATTR29]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR29]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR29]] ; CGSCC-NEXT: [[I:%.*]] = load float, ptr getelementptr inbounds ([[STRUCT_S]], ptr @Gs1, i64 0, i32 3), align 4, !tbaa [[TBAA7]] ; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 ; CGSCC-NEXT: store float [[I]], ptr [[F1]], align 4, !tbaa [[TBAA7]] @@ -773,14 +786,14 @@ } define i32 @test_range_merge1() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test_range_merge1 -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: ret i32 2 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test_range_merge1 -; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: ret i32 2 ; store <2 x i32> , ptr @Vs1 @@ -792,18 +805,18 @@ } define i32 @test_range_merge2() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@test_range_merge2 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: store <2 x i32> , ptr @Vs2, align 8 ; TUNIT-NEXT: [[L0:%.*]] = load i32, ptr @Vs2, align 4 ; TUNIT-NEXT: [[L1:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_S:%.*]], ptr @Vs2, i64 0, i32 1), align 4 ; TUNIT-NEXT: [[ADD:%.*]] = add i32 [[L0]], [[L1]] ; TUNIT-NEXT: ret i32 [[ADD]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@test_range_merge2 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8:[0-9]+]] { ; CGSCC-NEXT: store <2 x i32> , ptr @Vs2, align 8 ; CGSCC-NEXT: [[L0:%.*]] = load i32, ptr @Vs2, align 4 ; CGSCC-NEXT: [[L1:%.*]] = load i32, ptr getelementptr inbounds ([[STRUCT_S:%.*]], ptr @Vs2, i64 0, i32 1), align 4 @@ -834,9 +847,9 @@ ; } ; define void @static_global_simplifiable_2() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@static_global_simplifiable_2 -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[FOR_COND:%.*]] ; TUNIT: for.cond: @@ -885,7 +898,7 @@ ; TUNIT-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 ; TUNIT-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] ; TUNIT: for.end23: -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR23]] ; TUNIT-NEXT: br label [[FOR_COND25:%.*]] ; TUNIT: for.cond25: ; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] @@ -903,9 +916,9 @@ ; TUNIT: for.end35: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_2 -; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-SAME: () #[[ATTR9:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[FOR_COND:%.*]] ; CGSCC: for.cond: @@ -958,7 +971,7 @@ ; CGSCC-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] ; CGSCC: for.end23: ; CGSCC-NEXT: store i8 0, ptr getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) getelementptr inbounds ([1024 x i8], ptr @GBytes, i64 0, i64 500), i32 noundef 0) #[[ATTR29]] ; CGSCC-NEXT: br label [[FOR_COND25:%.*]] ; CGSCC: for.cond25: ; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1077,13 +1090,13 @@ ; return Flag3; ; } define i32 @static_global_simplifiable_3() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: store i32 1, ptr @Flag3, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: ret i32 1 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@static_global_simplifiable_3 ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: store i32 1, ptr @Flag3, align 4, !tbaa [[TBAA3]] @@ -1114,7 +1127,7 @@ define void @noalias_arg_simplifiable_1(ptr noalias sret(%struct.S) align 4 %agg.result, ptr byval(%struct.S) align 8 %s) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; TUNIT-SAME: (ptr noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr noalias nocapture nofree nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; TUNIT-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]] @@ -1122,11 +1135,11 @@ ; TUNIT-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 8, !tbaa [[TBAA10]] ; TUNIT-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5 ; TUNIT-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11]] -; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR23]] ; TUNIT-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR23]] ; TUNIT-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR23]] ; TUNIT-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; TUNIT-NEXT: [[I:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]] ; TUNIT-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 @@ -1160,7 +1173,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] { +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree noundef nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR10:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; CGSCC-NEXT: store float 0x3FF19999A0000000, ptr [[F1]], align 4, !tbaa [[TBAA7]] @@ -1168,11 +1181,11 @@ ; CGSCC-NEXT: store float 0x40019999A0000000, ptr [[F2]], align 8, !tbaa [[TBAA10]] ; CGSCC-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 5 ; CGSCC-NEXT: store float 0x400A666660000000, ptr [[F3]], align 4, !tbaa [[TBAA11]] -; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr noalias nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[S]], i32 noundef 1) #[[ATTR29]] ; CGSCC-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 1 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR29]] ; CGSCC-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR29]] ; CGSCC-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 3 ; CGSCC-NEXT: [[I:%.*]] = load float, ptr [[F11]], align 4, !tbaa [[TBAA7]] ; CGSCC-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[AGG_RESULT]], i64 0, i32 3 @@ -1263,9 +1276,9 @@ ; } ; define void @noalias_arg_simplifiable_2(ptr %Bytes) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; TUNIT-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR7:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[FOR_COND:%.*]] ; TUNIT: for.cond: @@ -1320,7 +1333,7 @@ ; TUNIT-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 1023 ; TUNIT-NEXT: store i8 0, ptr [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] ; TUNIT-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 500 -; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 [[ARRAYIDX25]], i32 noundef 0) #[[ATTR18]] +; TUNIT-NEXT: call void @write_arg(ptr nocapture nofree nonnull writeonly align 4 [[ARRAYIDX25]], i32 noundef 0) #[[ATTR23]] ; TUNIT-NEXT: br label [[FOR_COND27:%.*]] ; TUNIT: for.cond27: ; TUNIT-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1340,9 +1353,9 @@ ; TUNIT: for.end37: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; CGSCC-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR3]] { +; CGSCC-SAME: (ptr nocapture nofree [[BYTES:%.*]]) #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[FOR_COND:%.*]] ; CGSCC: for.cond: @@ -1397,7 +1410,7 @@ ; CGSCC-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 1023 ; CGSCC-NEXT: store i8 0, ptr [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] ; CGSCC-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, ptr [[BYTES]], i64 500 -; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARRAYIDX25]], i32 noundef 0) #[[ATTR21]] +; CGSCC-NEXT: call void @write_arg(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARRAYIDX25]], i32 noundef 0) #[[ATTR29]] ; CGSCC-NEXT: br label [[FOR_COND27:%.*]] ; CGSCC: for.cond27: ; CGSCC-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] @@ -1526,8 +1539,8 @@ ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[X:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[Y:%.*]] = alloca i32, align 4 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR17]] -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR22]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR22]] ; TUNIT-NEXT: store i32 1, ptr [[Y]], align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: store i32 1, ptr [[X]], align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: call void @escape(ptr noundef nonnull align 4 dereferenceable(4) [[X]]) @@ -1546,8 +1559,8 @@ ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[X:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[Y:%.*]] = alloca i32, align 4 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR20]] -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[X]]) #[[ATTR28]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[Y]]) #[[ATTR28]] ; CGSCC-NEXT: store i32 1, ptr [[Y]], align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: store i32 1, ptr [[X]], align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: call void @escape(ptr noundef nonnull align 4 dereferenceable(4) [[X]]) @@ -1583,9 +1596,9 @@ } define i8 @local_alloca_not_simplifiable_2(i64 %index1, i64 %index2, i1 %cnd) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; TUNIT-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_2 -; TUNIT-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; TUNIT-NEXT: store i8 7, ptr [[BYTES]], align 16 @@ -1602,9 +1615,9 @@ ; TUNIT-NEXT: [[I:%.*]] = load i8, ptr [[BYTES]], align 16 ; TUNIT-NEXT: ret i8 [[I]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_2 -; CGSCC-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i64 [[INDEX1:%.*]], i64 [[INDEX2:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; CGSCC-NEXT: store i8 7, ptr [[BYTES]], align 16 @@ -1646,23 +1659,41 @@ ; We could simplify these if we separate accessed bins wrt. alignment (here mod 4). define i32 @unknown_access_mixed_simplifiable(i32 %arg1, i32 %arg2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable -; CHECK-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] -; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] -; CHECK-NEXT: store i32 7, ptr [[GEP1]], align 4 -; CHECK-NEXT: store i32 7, ptr [[GEP2]], align 4 -; CHECK-NEXT: store i32 7, ptr [[GEP3]], align 4 -; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 -; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 -; CHECK-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 -; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; CHECK-NEXT: ret i32 [[ADD2]] +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; TUNIT-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR4]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; TUNIT-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 +; TUNIT-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] +; TUNIT-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] +; TUNIT-NEXT: store i32 7, ptr [[GEP1]], align 4 +; TUNIT-NEXT: store i32 7, ptr [[GEP2]], align 4 +; TUNIT-NEXT: store i32 7, ptr [[GEP3]], align 4 +; TUNIT-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 +; TUNIT-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 +; TUNIT-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 +; TUNIT-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; TUNIT-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; TUNIT-NEXT: ret i32 [[ADD2]] +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable +; CGSCC-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 +; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] +; CGSCC-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] +; CGSCC-NEXT: store i32 7, ptr [[GEP1]], align 4 +; CGSCC-NEXT: store i32 7, ptr [[GEP2]], align 4 +; CGSCC-NEXT: store i32 7, ptr [[GEP3]], align 4 +; CGSCC-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 +; CGSCC-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 +; CGSCC-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 +; CGSCC-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; CGSCC-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; CGSCC-NEXT: ret i32 [[ADD2]] ; entry: %s = alloca %struct.S, align 4 @@ -1682,27 +1713,49 @@ ; The access to bc4b could go anywhere, nothing is simplifiable. define i32 @unknown_access_mixed_not_simplifiable(i32 %arg1, i32 %arg2, i32 %arg3) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable -; CHECK-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 -; CHECK-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 -; CHECK-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] -; CHECK-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] -; CHECK-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, ptr [[S]], i32 [[ARG3]] -; CHECK-NEXT: store i32 7, ptr [[GEP1]], align 4 -; CHECK-NEXT: store i32 7, ptr [[GEP2]], align 4 -; CHECK-NEXT: store i32 7, ptr [[GEP3]], align 4 -; CHECK-NEXT: store i32 7, ptr [[GEP4]], align 4 -; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 -; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 -; CHECK-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 -; CHECK-NEXT: [[L4:%.*]] = load i32, ptr [[GEP4]], align 4 -; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] -; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] -; CHECK-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] -; CHECK-NEXT: ret i32 [[ADD3]] +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; TUNIT-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR4]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; TUNIT-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 +; TUNIT-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] +; TUNIT-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] +; TUNIT-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, ptr [[S]], i32 [[ARG3]] +; TUNIT-NEXT: store i32 7, ptr [[GEP1]], align 4 +; TUNIT-NEXT: store i32 7, ptr [[GEP2]], align 4 +; TUNIT-NEXT: store i32 7, ptr [[GEP3]], align 4 +; TUNIT-NEXT: store i32 7, ptr [[GEP4]], align 4 +; TUNIT-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 +; TUNIT-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 +; TUNIT-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 +; TUNIT-NEXT: [[L4:%.*]] = load i32, ptr [[GEP4]], align 4 +; TUNIT-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; TUNIT-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; TUNIT-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; TUNIT-NEXT: ret i32 [[ADD3]] +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable +; CGSCC-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 +; CGSCC-NEXT: [[GEP1:%.*]] = getelementptr inbounds [[STRUCT_S]], ptr [[S]], i64 0, i32 2 +; CGSCC-NEXT: [[GEP2:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG1]] +; CGSCC-NEXT: [[GEP3:%.*]] = getelementptr inbounds i32, ptr [[S]], i32 [[ARG2]] +; CGSCC-NEXT: [[GEP4:%.*]] = getelementptr inbounds i8, ptr [[S]], i32 [[ARG3]] +; CGSCC-NEXT: store i32 7, ptr [[GEP1]], align 4 +; CGSCC-NEXT: store i32 7, ptr [[GEP2]], align 4 +; CGSCC-NEXT: store i32 7, ptr [[GEP3]], align 4 +; CGSCC-NEXT: store i32 7, ptr [[GEP4]], align 4 +; CGSCC-NEXT: [[L1:%.*]] = load i32, ptr [[GEP1]], align 4 +; CGSCC-NEXT: [[L2:%.*]] = load i32, ptr [[GEP2]], align 4 +; CGSCC-NEXT: [[L3:%.*]] = load i32, ptr [[GEP3]], align 4 +; CGSCC-NEXT: [[L4:%.*]] = load i32, ptr [[GEP4]], align 4 +; CGSCC-NEXT: [[ADD1:%.*]] = add i32 [[L1]], [[L2]] +; CGSCC-NEXT: [[ADD2:%.*]] = add i32 [[ADD1]], [[L3]] +; CGSCC-NEXT: [[ADD3:%.*]] = add i32 [[ADD2]], [[L4]] +; CGSCC-NEXT: ret i32 [[ADD3]] ; entry: %s = alloca %struct.S, align 4 @@ -1732,16 +1785,16 @@ ; } ; define i32 @global_not_simplifiable_1(i32 %cnd) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR6:[0-9]+]] { +; TUNIT-SAME: (i32 [[CND:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag0, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: ret i32 [[I]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-SAME: (i32 [[CND:%.*]]) #[[ATTR13:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag0, align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: ret i32 [[I]] @@ -1827,7 +1880,7 @@ ; TUNIT-SAME: (i32 [[CND:%.*]]) { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: store i32 1, ptr @Flag4, align 4, !tbaa [[TBAA3]] -; TUNIT-NEXT: call void @sync() #[[ATTR19:[0-9]+]] +; TUNIT-NEXT: call void @sync() #[[ATTR24:[0-9]+]] ; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag4, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: ret i32 [[I]] @@ -1836,7 +1889,7 @@ ; CGSCC-SAME: (i32 [[CND:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: store i32 1, ptr @Flag4, align 4, !tbaa [[TBAA3]] -; CGSCC-NEXT: call void @sync() #[[ATTR22:[0-9]+]] +; CGSCC-NEXT: call void @sync() #[[ATTR30:[0-9]+]] ; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag4, align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: ret i32 [[I]] @@ -1849,13 +1902,13 @@ ret i32 %i } define void @static_global_not_simplifiable_2_helper() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2_helper -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@static_global_not_simplifiable_2_helper ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: store i32 2, ptr @Flag4, align 4, !tbaa [[TBAA3]] @@ -1867,17 +1920,17 @@ ; Similiar to static_global_simplifiable_3 but with a may-store. define i32 @static_global_not_simplifiable_3(i1 %c, ptr %p) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@static_global_not_simplifiable_3 -; TUNIT-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR10:[0-9]+]] { ; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], ptr @Flag3, ptr [[P]] ; TUNIT-NEXT: store i32 1, ptr [[SEL]], align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: [[I:%.*]] = load i32, ptr @Flag3, align 4, !tbaa [[TBAA3]] ; TUNIT-NEXT: ret i32 [[I]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@static_global_not_simplifiable_3 -; CGSCC-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (i1 [[C:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR14:[0-9]+]] { ; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], ptr @Flag3, ptr [[P]] ; CGSCC-NEXT: store i32 1, ptr [[SEL]], align 4, !tbaa [[TBAA3]] ; CGSCC-NEXT: [[I:%.*]] = load i32, ptr @Flag3, align 4, !tbaa [[TBAA3]] @@ -1903,16 +1956,16 @@ ; ; FIXME: We could replace these loads. define i32 @write_read_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_read_global -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: store i32 7, ptr @Gint1, align 4 ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gint1, align 4 ; TUNIT-NEXT: ret i32 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_read_global -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: store i32 7, ptr @Gint1, align 4 ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gint1, align 4 ; CGSCC-NEXT: ret i32 [[L]] @@ -1922,13 +1975,13 @@ ret i32 %l } define void @write_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_global -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: store i32 7, ptr @Gint2, align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_global ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: store i32 7, ptr @Gint2, align 4 @@ -1938,15 +1991,15 @@ ret void } define i32 @read_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@read_global -; TUNIT-SAME: () #[[ATTR6]] { +; TUNIT-SAME: () #[[ATTR9]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gint2, align 4 ; TUNIT-NEXT: ret i32 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@read_global -; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-SAME: () #[[ATTR13]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gint2, align 4 ; CGSCC-NEXT: ret i32 [[L]] ; @@ -1954,12 +2007,12 @@ ret i32 %l } define i32 @write_read_static_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_read_static_global -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: ret i32 7 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_read_static_global ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: ret i32 7 @@ -1969,13 +2022,13 @@ ret i32 %l } define void @write_static_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_static_global -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: store i32 7, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_static_global ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: store i32 7, ptr @Gstatic_int2, align 4 @@ -1985,15 +2038,15 @@ ret void } define i32 @read_static_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@read_static_global -; TUNIT-SAME: () #[[ATTR6]] { +; TUNIT-SAME: () #[[ATTR9]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; TUNIT-NEXT: ret i32 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@read_static_global -; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-SAME: () #[[ATTR13]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @Gstatic_int2, align 4 ; CGSCC-NEXT: ret i32 [[L]] ; @@ -2001,12 +2054,12 @@ ret i32 %l } define i32 @write_read_static_undef_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_read_static_undef_global -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: ret i32 7 ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_read_static_undef_global ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: ret i32 7 @@ -2016,12 +2069,12 @@ ret i32 %l } define void @write_static_undef_global() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@write_static_undef_global -; TUNIT-SAME: () #[[ATTR5]] { +; TUNIT-SAME: () #[[ATTR3]] { ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@write_static_undef_global ; CGSCC-SAME: () #[[ATTR6]] { ; CGSCC-NEXT: store i32 7, ptr @Gstatic_undef_int2, align 4 @@ -2031,44 +2084,73 @@ ret void } define i32 @read_static_undef_global() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@read_static_undef_global -; CHECK-SAME: () #[[ATTR4]] { -; CHECK-NEXT: ret i32 7 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@read_static_undef_global +; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-NEXT: ret i32 7 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@read_static_undef_global +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: ret i32 7 ; %l = load i32, ptr @Gstatic_undef_int2 ret i32 %l } define i32 @single_read_of_static_global() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@single_read_of_static_global -; CHECK-SAME: () #[[ATTR4]] { -; CHECK-NEXT: ret i32 0 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@single_read_of_static_global +; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-NEXT: ret i32 0 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@single_read_of_static_global +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: ret i32 0 ; %l = load i32, ptr @Gstatic_int3 ret i32 %l } define i8 @phi_store() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@phi_store -; CHECK-SAME: () #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[A:%.*]] = alloca i16, align 2 -; CHECK-NEXT: br label [[LOOP:%.*]] -; CHECK: loop: -; CHECK-NEXT: [[P:%.*]] = phi ptr [ [[A]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] -; CHECK-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] -; CHECK-NEXT: store i8 1, ptr [[P]], align 1 -; CHECK-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1 -; CHECK-NEXT: [[O]] = add nsw i8 [[I]], 1 -; CHECK-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 -; CHECK-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] -; CHECK: end: -; CHECK-NEXT: [[S:%.*]] = getelementptr i8, ptr [[A]], i64 1 -; CHECK-NEXT: [[L:%.*]] = load i8, ptr [[S]], align 1 -; CHECK-NEXT: ret i8 [[L]] +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@phi_store +; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[A:%.*]] = alloca i16, align 2 +; TUNIT-NEXT: br label [[LOOP:%.*]] +; TUNIT: loop: +; TUNIT-NEXT: [[P:%.*]] = phi ptr [ [[A]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; TUNIT-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; TUNIT-NEXT: store i8 1, ptr [[P]], align 1 +; TUNIT-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1 +; TUNIT-NEXT: [[O]] = add nsw i8 [[I]], 1 +; TUNIT-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; TUNIT-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; TUNIT: end: +; TUNIT-NEXT: [[S:%.*]] = getelementptr i8, ptr [[A]], i64 1 +; TUNIT-NEXT: [[L:%.*]] = load i8, ptr [[S]], align 1 +; TUNIT-NEXT: ret i8 [[L]] +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@phi_store +; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[A:%.*]] = alloca i16, align 2 +; CGSCC-NEXT: br label [[LOOP:%.*]] +; CGSCC: loop: +; CGSCC-NEXT: [[P:%.*]] = phi ptr [ [[A]], [[ENTRY:%.*]] ], [ [[G:%.*]], [[LOOP]] ] +; CGSCC-NEXT: [[I:%.*]] = phi i8 [ 0, [[ENTRY]] ], [ [[O:%.*]], [[LOOP]] ] +; CGSCC-NEXT: store i8 1, ptr [[P]], align 1 +; CGSCC-NEXT: [[G]] = getelementptr i8, ptr [[P]], i64 1 +; CGSCC-NEXT: [[O]] = add nsw i8 [[I]], 1 +; CGSCC-NEXT: [[C:%.*]] = icmp eq i8 [[O]], 2 +; CGSCC-NEXT: br i1 [[C]], label [[END:%.*]], label [[LOOP]] +; CGSCC: end: +; CGSCC-NEXT: [[S:%.*]] = getelementptr i8, ptr [[A]], i64 1 +; CGSCC-NEXT: [[L:%.*]] = load i8, ptr [[S]], align 1 +; CGSCC-NEXT: ret i8 [[L]] ; entry: %a = alloca i16 @@ -2090,9 +2172,9 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_1() { ; -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@phi_no_store_1 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[LOOP:%.*]] ; TUNIT: loop: @@ -2111,9 +2193,9 @@ ; TUNIT-NEXT: [[ADD:%.*]] = add i8 [[L11]], [[L12]] ; TUNIT-NEXT: ret i8 [[ADD]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_1 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[LOOP:%.*]] ; CGSCC: loop: @@ -2154,9 +2236,9 @@ ; FIXME: This function returns 1. define i8 @phi_no_store_2() { ; -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@phi_no_store_2 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[LOOP:%.*]] ; TUNIT: loop: @@ -2175,9 +2257,9 @@ ; TUNIT-NEXT: [[ADD:%.*]] = add i8 [[L21]], [[L22]] ; TUNIT-NEXT: ret i8 [[ADD]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_2 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[LOOP:%.*]] ; CGSCC: loop: @@ -2216,9 +2298,9 @@ } define i8 @phi_no_store_3() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@phi_no_store_3 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[S30:%.*]] = getelementptr i8, ptr @a3, i64 3 ; TUNIT-NEXT: store i8 0, ptr [[S30]], align 1 @@ -2242,9 +2324,9 @@ ; TUNIT-NEXT: [[ADD2:%.*]] = add i8 [[ADD]], [[L34]] ; TUNIT-NEXT: ret i8 [[ADD2]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@phi_no_store_3 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[S30:%.*]] = getelementptr i8, ptr @a3, i64 3 ; CGSCC-NEXT: store i8 0, ptr [[S30]], align 1 @@ -2293,16 +2375,16 @@ } define i8 @cast_and_load_1() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@cast_and_load_1 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: store i32 42, ptr @bytes1, align 4 ; TUNIT-NEXT: [[L:%.*]] = load i8, ptr @bytes1, align 4 ; TUNIT-NEXT: ret i8 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_1 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: store i32 42, ptr @bytes1, align 4 ; CGSCC-NEXT: [[L:%.*]] = load i8, ptr @bytes1, align 4 ; CGSCC-NEXT: ret i8 [[L]] @@ -2313,16 +2395,16 @@ } define i64 @cast_and_load_2() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@cast_and_load_2 -; TUNIT-SAME: () #[[ATTR3]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: store i32 42, ptr @bytes2, align 4 ; TUNIT-NEXT: [[L:%.*]] = load i64, ptr @bytes2, align 4 ; TUNIT-NEXT: ret i64 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@cast_and_load_2 -; CGSCC-SAME: () #[[ATTR5]] { +; CGSCC-SAME: () #[[ATTR8]] { ; CGSCC-NEXT: store i32 42, ptr @bytes2, align 4 ; CGSCC-NEXT: [[L:%.*]] = load i64, ptr @bytes2, align 4 ; CGSCC-NEXT: ret i64 [[L]] @@ -2334,9 +2416,9 @@ define void @recursive_load_store(i64 %N, i32 %v) { ; -; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(write) +; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@recursive_load_store -; TUNIT-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR11:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: br label [[FOR_COND:%.*]] ; TUNIT: for.cond: @@ -2349,9 +2431,9 @@ ; TUNIT: for.end: ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: nofree norecurse nosync nounwind memory(write) +; CGSCC: Function Attrs: nofree norecurse nosync nounwind memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@recursive_load_store -; CGSCC-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR8:[0-9]+]] { +; CGSCC-SAME: (i64 [[N:%.*]], i32 [[V:%.*]]) #[[ATTR15:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: br label [[FOR_COND:%.*]] ; CGSCC: for.cond: @@ -2538,14 +2620,14 @@ ; TUNIT-SAME: (i32 [[S:%.*]]) { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 -; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR20:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR25:[0-9]+]] ; TUNIT-NEXT: ret ptr [[CALL]] ; ; CGSCC-LABEL: define {{[^@]+}}@malloc_like ; CGSCC-SAME: (i32 [[S:%.*]]) { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[S]] to i64 -; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR23:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]]) #[[ATTR31:[0-9]+]] ; CGSCC-NEXT: ret ptr [[CALL]] ; entry: @@ -2558,19 +2640,19 @@ ; TUNIT-LABEL: define {{[^@]+}}@round_trip_malloc_like ; TUNIT-SAME: (i32 [[X:%.*]]) { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR20]] +; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR25]] ; TUNIT-NEXT: store i32 [[X]], ptr [[CALL]], align 4 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR20]] +; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR25]] ; TUNIT-NEXT: ret i32 [[TMP0]] ; ; CGSCC-LABEL: define {{[^@]+}}@round_trip_malloc_like ; CGSCC-SAME: (i32 [[X:%.*]]) { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR23]] +; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @malloc_like(i32 noundef 4) #[[ATTR31]] ; CGSCC-NEXT: store i32 [[X]], ptr [[CALL]], align 4 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR23]] +; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR31]] ; CGSCC-NEXT: ret i32 [[TMP0]] ; entry: @@ -2585,19 +2667,19 @@ ; TUNIT-LABEL: define {{[^@]+}}@round_trip_unknown_alloc ; TUNIT-SAME: (i32 [[X:%.*]]) { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR20]] +; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR25]] ; TUNIT-NEXT: store i32 [[X]], ptr [[CALL]], align 4 ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR20]] +; TUNIT-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR25]] ; TUNIT-NEXT: ret i32 [[TMP0]] ; ; CGSCC-LABEL: define {{[^@]+}}@round_trip_unknown_alloc ; CGSCC-SAME: (i32 [[X:%.*]]) { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR23]] +; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR31]] ; CGSCC-NEXT: store i32 [[X]], ptr [[CALL]], align 4 ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR23]] +; CGSCC-NEXT: call void @free(ptr noundef nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR31]] ; CGSCC-NEXT: ret i32 [[TMP0]] ; entry: @@ -2614,7 +2696,7 @@ ; TUNIT-LABEL: define {{[^@]+}}@conditional_unknown_alloc ; TUNIT-SAME: (i32 [[X:%.*]]) { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR20]] +; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR25]] ; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; TUNIT: if.then: @@ -2622,13 +2704,13 @@ ; TUNIT-NEXT: br label [[IF_END]] ; TUNIT: if.end: ; TUNIT-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; TUNIT-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR20]] +; TUNIT-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR25]] ; TUNIT-NEXT: ret i32 [[TMP0]] ; ; CGSCC-LABEL: define {{[^@]+}}@conditional_unknown_alloc ; CGSCC-SAME: (i32 [[X:%.*]]) { ; CGSCC-NEXT: entry: -; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR23]] +; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @unknown_alloc(i32 noundef 4) #[[ATTR31]] ; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[X]], 0 ; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]] ; CGSCC: if.then: @@ -2636,7 +2718,7 @@ ; CGSCC-NEXT: br label [[IF_END]] ; CGSCC: if.end: ; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[CALL]], align 4 -; CGSCC-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR23]] +; CGSCC-NEXT: call void @free(ptr nonnull align 4 dereferenceable(4) [[CALL]]) #[[ATTR31]] ; CGSCC-NEXT: ret i32 [[TMP0]] ; entry: @@ -2676,7 +2758,7 @@ ; TUNIT-NEXT: [[TMP1:%.*]] = load ptr, ptr [[LOCAL_0_1]], align 8 ; TUNIT-NEXT: [[LOCAL_0_2:%.*]] = getelementptr [[STRUCT_STY]], ptr [[LOCAL]], i64 0, i32 2 ; TUNIT-NEXT: [[TMP2:%.*]] = load ptr, ptr [[LOCAL_0_2]], align 8 -; TUNIT-NEXT: call fastcc void @nested_memory_callee(ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP2]]) #[[ATTR21:[0-9]+]] +; TUNIT-NEXT: call fastcc void @nested_memory_callee(ptr [[TMP0]], ptr [[TMP1]], ptr [[TMP2]]) #[[ATTR26:[0-9]+]] ; TUNIT-NEXT: ret void ; ; CGSCC-LABEL: define {{[^@]+}}@test_nested_memory @@ -2689,7 +2771,7 @@ ; CGSCC-NEXT: [[SRC2:%.*]] = getelementptr inbounds i8, ptr [[CALL]], i64 8 ; CGSCC-NEXT: store ptr [[SRC]], ptr [[SRC2]], align 8 ; CGSCC-NEXT: store ptr [[CALL]], ptr getelementptr inbounds ([[STRUCT_STY]], ptr @global, i64 0, i32 2), align 8 -; CGSCC-NEXT: call fastcc void @nested_memory_callee(ptr nofree nonnull align 4294967296 undef, ptr nofree nonnull align 4294967296 undef, ptr nofree noundef nonnull align 8 dereferenceable(24) @global) #[[ATTR24:[0-9]+]] +; CGSCC-NEXT: call fastcc void @nested_memory_callee(ptr nofree nonnull align 4294967296 undef, ptr nofree nonnull align 4294967296 undef, ptr nofree noundef nonnull align 8 dereferenceable(24) @global) #[[ATTR32:[0-9]+]] ; CGSCC-NEXT: ret void ; entry: @@ -2708,7 +2790,7 @@ define internal fastcc void @nested_memory_callee(ptr nocapture readonly %S) nofree norecurse nounwind uwtable { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn uwtable ; TUNIT-LABEL: define {{[^@]+}}@nested_memory_callee -; TUNIT-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR11:[0-9]+]] { +; TUNIT-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR15:[0-9]+]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[S_PRIV:%.*]] = alloca [[STRUCT_STY:%.*]], align 8 ; TUNIT-NEXT: store ptr [[TMP0]], ptr [[S_PRIV]], align 8 @@ -2730,7 +2812,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn uwtable ; CGSCC-LABEL: define {{[^@]+}}@nested_memory_callee -; CGSCC-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR12:[0-9]+]] { +; CGSCC-SAME: (ptr [[TMP0:%.*]], ptr [[TMP1:%.*]], ptr [[TMP2:%.*]]) #[[ATTR19:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[S_PRIV:%.*]] = alloca [[STRUCT_STY:%.*]], align 8 ; CGSCC-NEXT: store ptr [[TMP0]], ptr [[S_PRIV]], align 8 @@ -2769,10 +2851,10 @@ define hidden void @no_propagation_of_unknown_index_access(ptr %in, ptr %out, i32 %idx) #0 { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access -; TUNIT-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: entry: ; TUNIT-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 -; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR22]] ; TUNIT-NEXT: br label [[FOR_COND:%.*]] ; TUNIT: for.cond: ; TUNIT-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] @@ -2793,7 +2875,7 @@ ; TUNIT-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 ; TUNIT-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] ; TUNIT: for.cond.cleanup6: -; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR17]] +; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR22]] ; TUNIT-NEXT: ret void ; TUNIT: for.body7: ; TUNIT-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 @@ -2811,10 +2893,10 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@no_propagation_of_unknown_index_access -; CGSCC-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR13:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree readonly [[IN:%.*]], ptr nocapture nofree writeonly [[OUT:%.*]], i32 [[IDX:%.*]]) #[[ATTR20:[0-9]+]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[BUF:%.*]] = alloca [128 x i32], align 16 -; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR28]] ; CGSCC-NEXT: br label [[FOR_COND:%.*]] ; CGSCC: for.cond: ; CGSCC-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] @@ -2835,7 +2917,7 @@ ; CGSCC-NEXT: [[CMP5:%.*]] = icmp slt i32 [[I3_0]], 128 ; CGSCC-NEXT: br i1 [[CMP5]], label [[FOR_BODY7]], label [[FOR_COND_CLEANUP6:%.*]] ; CGSCC: for.cond.cleanup6: -; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR20]] +; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 512, ptr noalias nocapture nofree noundef nonnull align 16 dereferenceable(512) [[BUF]]) #[[ATTR28]] ; CGSCC-NEXT: ret void ; CGSCC: for.body7: ; CGSCC-NEXT: [[IDXPROM8:%.*]] = sext i32 [[I3_0]] to i64 @@ -2899,28 +2981,28 @@ ; Ensure we do not return true. define internal i1 @alloca_non_unique(ptr %p, i32 %in, i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@alloca_non_unique -; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR12:[0-9]+]] { +; TUNIT-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR16:[0-9]+]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store i32 [[IN]], ptr [[A]], align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR14:[0-9]+]] +; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR16]] ; TUNIT-NEXT: ret i1 [[R]] ; TUNIT: f: ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 4 ; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[IN]], [[L]] ; TUNIT-NEXT: ret i1 [[CMP]] ; -; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite) +; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique -; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[0-9]+]] { +; CGSCC-SAME: (ptr nocapture nofree nonnull readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR21:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 [[IN]], ptr [[A]], align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR17:[0-9]+]] +; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], i32 noundef 42, i1 noundef false) #[[ATTR21]] ; CGSCC-NEXT: ret i1 [[R]] ; CGSCC: f: ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[P]], align 4 @@ -2943,14 +3025,14 @@ define i1 @alloca_non_unique_caller(i32 %in, i1 %c) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@alloca_non_unique_caller -; TUNIT-SAME: (i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR13:[0-9]+]] { -; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr undef, i32 [[IN]], i1 [[C]]) #[[ATTR14]] +; TUNIT-SAME: (i32 [[IN:%.*]], i1 [[C:%.*]]) #[[ATTR17:[0-9]+]] { +; TUNIT-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr readonly undef, i32 [[IN]], i1 [[C]]) #[[ATTR27:[0-9]+]] ; TUNIT-NEXT: ret i1 [[R]] ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@alloca_non_unique_caller -; CGSCC-SAME: (i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR15:[0-9]+]] { -; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr undef, i32 [[IN]], i1 noundef [[C]]) #[[ATTR24]] +; CGSCC-SAME: (i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR22:[0-9]+]] { +; CGSCC-NEXT: [[R:%.*]] = call i1 @alloca_non_unique(ptr readonly undef, i32 [[IN]], i1 noundef [[C]]) #[[ATTR32]] ; CGSCC-NEXT: ret i1 [[R]] ; %r = call i1 @alloca_non_unique(ptr undef, i32 %in, i1 %c) @@ -2964,17 +3046,17 @@ ; TUNIT-SAME: (i32 [[BAD:%.*]], i1 [[C:%.*]], i1 [[C2:%.*]]) #[[ATTR4]] { ; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store i32 [[BAD]], ptr [[A]], align 4 -; TUNIT-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR18]] +; TUNIT-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR28:[0-9]+]] ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4 ; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[BAD]], i32 [[L]] ; TUNIT-NEXT: ret i32 [[SEL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@scope_value_traversal -; CGSCC-SAME: (i32 [[BAD:%.*]], i1 [[C:%.*]], i1 [[C2:%.*]]) #[[ATTR16:[0-9]+]] { +; CGSCC-SAME: (i32 [[BAD:%.*]], i1 [[C:%.*]], i1 [[C2:%.*]]) #[[ATTR23:[0-9]+]] { ; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 [[BAD]], ptr [[A]], align 4 -; CGSCC-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR21]] +; CGSCC-NEXT: call void @scope_value_traversal_helper(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]], i1 [[C2]]) #[[ATTR29]] ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4 ; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[BAD]], i32 [[L]] ; CGSCC-NEXT: ret i32 [[SEL]] @@ -2990,7 +3072,7 @@ define void @scope_value_traversal_helper(ptr %a, i1 %c) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; TUNIT-LABEL: define {{[^@]+}}@scope_value_traversal_helper -; TUNIT-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR1]] { +; TUNIT-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR6]] { ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4 ; TUNIT-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[L]], i32 42 ; TUNIT-NEXT: store i32 [[SEL]], ptr [[A]], align 4 @@ -2998,7 +3080,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) ; CGSCC-LABEL: define {{[^@]+}}@scope_value_traversal_helper -; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR13]] { +; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i1 [[C:%.*]]) #[[ATTR20]] { ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[A]], align 4 ; CGSCC-NEXT: [[SEL:%.*]] = select i1 [[C]], i32 [[L]], i32 42 ; CGSCC-NEXT: store i32 [[SEL]], ptr [[A]], align 4 @@ -3011,13 +3093,21 @@ } define i8 @gep_index_from_binary_operator(i1 %cnd1, i1 %cnd2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@gep_index_from_binary_operator -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; CHECK-NEXT: [[GEP_FIXED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 -; CHECK-NEXT: ret i8 100 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@gep_index_from_binary_operator +; TUNIT-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; TUNIT-NEXT: [[GEP_FIXED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 +; TUNIT-NEXT: ret i8 100 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@gep_index_from_binary_operator +; CGSCC-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; CGSCC-NEXT: [[GEP_FIXED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 +; CGSCC-NEXT: ret i8 100 ; entry: %Bytes = alloca [1024 x i8], align 16 @@ -3030,13 +3120,21 @@ } define i8 @gep_index_from_memory(i1 %cnd1, i1 %cnd2) { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) -; CHECK-LABEL: define {{[^@]+}}@gep_index_from_memory -; CHECK-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] { -; CHECK-NEXT: entry: -; CHECK-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 -; CHECK-NEXT: [[GEP_LOADED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 -; CHECK-NEXT: ret i8 100 +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@gep_index_from_memory +; TUNIT-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR4]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; TUNIT-NEXT: [[GEP_LOADED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 +; TUNIT-NEXT: ret i8 100 +; +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@gep_index_from_memory +; CGSCC-SAME: (i1 [[CND1:%.*]], i1 [[CND2:%.*]]) #[[ATTR5]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 +; CGSCC-NEXT: [[GEP_LOADED:%.*]] = getelementptr inbounds [1024 x i8], ptr [[BYTES]], i64 0, i64 12 +; CGSCC-NEXT: ret i8 100 ; entry: %Bytes = alloca [1024 x i8], align 16 @@ -3056,26 +3154,26 @@ ; Ensure this is not flattened to return 3 define i32 @a(i1 %c) { -; TUNIT: Function Attrs: nofree nosync nounwind +; TUNIT: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@a -; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR14]] { +; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR18:[0-9]+]] { ; TUNIT-NEXT: store i32 3, ptr @G, align 4 ; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; TUNIT: t: -; TUNIT-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR14]] +; TUNIT-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR18]] ; TUNIT-NEXT: br label [[F]] ; TUNIT: f: ; TUNIT-NEXT: [[R:%.*]] = load i32, ptr @G, align 4 ; TUNIT-NEXT: store i32 5, ptr @G, align 4 ; TUNIT-NEXT: ret i32 [[R]] ; -; CGSCC: Function Attrs: nofree nosync nounwind +; CGSCC: Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@a -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR17]] { +; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR24:[0-9]+]] { ; CGSCC-NEXT: store i32 3, ptr @G, align 4 ; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR17]] +; CGSCC-NEXT: [[REC:%.*]] = call i32 @a(i1 noundef false) #[[ATTR24]] ; CGSCC-NEXT: br label [[F]] ; CGSCC: f: ; CGSCC-NEXT: [[R:%.*]] = load i32, ptr @G, align 4 @@ -3097,9 +3195,9 @@ @GC = internal global i32 undef, align 4 define void @atomicrmw(ptr %p, i32 %i, i1 %cnd) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@atomicrmw -; TUNIT-SAME: (ptr nofree [[P:%.*]], i32 [[I:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR3]] { +; TUNIT-SAME: (ptr nofree readnone [[P:%.*]], i32 [[I:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR19:[0-9]+]] { ; TUNIT-NEXT: br i1 [[CND]], label [[T:%.*]], label [[M:%.*]] ; TUNIT: t: ; TUNIT-NEXT: br label [[M]] @@ -3107,9 +3205,9 @@ ; TUNIT-NEXT: [[ARMW:%.*]] = atomicrmw add ptr @GC, i32 [[I]] monotonic, align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@atomicrmw -; CGSCC-SAME: (ptr nofree [[P:%.*]], i32 [[I:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR5]] { +; CGSCC-SAME: (ptr nofree readnone [[P:%.*]], i32 [[I:%.*]], i1 noundef [[CND:%.*]]) #[[ATTR25:[0-9]+]] { ; CGSCC-NEXT: br i1 [[CND]], label [[T:%.*]], label [[M:%.*]] ; CGSCC: t: ; CGSCC-NEXT: br label [[M]] @@ -3175,53 +3273,68 @@ !31 = distinct !{!31, !17} ;. ; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR1]] = { memory(readwrite, argmem: write) } ; TUNIT: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } ; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; TUNIT: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind memory(write) } -; TUNIT: attributes #[[ATTR8:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" } -; TUNIT: attributes #[[ATTR9:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } -; TUNIT: attributes #[[ATTR10:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } -; TUNIT: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn uwtable } -; TUNIT: attributes #[[ATTR12]] = { nofree nosync nounwind memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR13]] = { nofree norecurse nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR14]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; TUNIT: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR17]] = { willreturn } -; TUNIT: attributes #[[ATTR18]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR19]] = { nocallback } -; TUNIT: attributes #[[ATTR20]] = { norecurse } -; TUNIT: attributes #[[ATTR21]] = { nounwind } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR12:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" } +; TUNIT: attributes #[[ATTR13:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } +; TUNIT: attributes #[[ATTR14:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } +; TUNIT: attributes #[[ATTR15]] = { mustprogress nofree norecurse nosync nounwind willreturn uwtable } +; TUNIT: attributes #[[ATTR16]] = { nofree nosync nounwind memory(argmem: read) } +; TUNIT: attributes #[[ATTR17]] = { nofree norecurse nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR18]] = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR19]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR20:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +; TUNIT: attributes #[[ATTR21:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; TUNIT: attributes #[[ATTR22]] = { willreturn } +; TUNIT: attributes #[[ATTR23]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR24]] = { nocallback } +; TUNIT: attributes #[[ATTR25]] = { norecurse } +; TUNIT: attributes #[[ATTR26]] = { nounwind } +; TUNIT: attributes #[[ATTR27]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR28]] = { nofree nosync nounwind willreturn memory(argmem: readwrite) } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read) } -; CGSCC: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind memory(write) } -; CGSCC: attributes #[[ATTR9:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" } -; CGSCC: attributes #[[ATTR10:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } -; CGSCC: attributes #[[ATTR11:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } -; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn uwtable } -; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR14]] = { nofree nosync nounwind memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR15]] = { nofree nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR16]] = { mustprogress nofree nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR17]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR18:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -; CGSCC: attributes #[[ATTR19:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR20]] = { willreturn } -; CGSCC: attributes #[[ATTR21]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR22]] = { nocallback } -; CGSCC: attributes #[[ATTR23]] = { norecurse } -; CGSCC: attributes #[[ATTR24]] = { nounwind } +; CGSCC: attributes #[[ATTR1]] = { memory(readwrite, argmem: write) } +; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR15]] = { nofree norecurse nosync nounwind memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR16:[0-9]+]] = { allockind("alloc,uninitialized") allocsize(0) "alloc-family"="malloc" } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } +; CGSCC: attributes #[[ATTR18:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } +; CGSCC: attributes #[[ATTR19]] = { mustprogress nofree norecurse nosync nounwind willreturn uwtable } +; CGSCC: attributes #[[ATTR20]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR21]] = { nofree nosync nounwind memory(argmem: read) } +; CGSCC: attributes #[[ATTR22]] = { nofree nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR23]] = { mustprogress nofree nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR24]] = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR25]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR26:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +; CGSCC: attributes #[[ATTR27:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } +; CGSCC: attributes #[[ATTR28]] = { willreturn } +; CGSCC: attributes #[[ATTR29]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR30]] = { nocallback } +; CGSCC: attributes #[[ATTR31]] = { norecurse } +; CGSCC: attributes #[[ATTR32]] = { nounwind } ;. ; TUNIT: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} ; TUNIT: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} Index: llvm/test/Transforms/Attributor/value-simplify-reachability.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify-reachability.ll +++ llvm/test/Transforms/Attributor/value-simplify-reachability.ll @@ -21,7 +21,7 @@ ; CHECK: @[[GINT5:[a-zA-Z0-9_$"\\.-]+]] = internal global i32 undef, align 4 ;. define internal void @write1ToGInt1() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@write1ToGInt1 ; CHECK-SAME: () #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: store i32 1, ptr @GInt1, align 4 @@ -32,7 +32,7 @@ } define internal void @write1ToGInt2() { -; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@write1ToGInt2 ; CHECK-SAME: () #[[ATTR4]] { ; CHECK-NEXT: store i32 1, ptr @GInt2, align 4 @@ -60,7 +60,7 @@ ; TUNIT: F: ; TUNIT-NEXT: [[L3:%.*]] = load i32, ptr @GInt1, align 4 ; TUNIT-NEXT: call void @useI32(i32 [[L3]]) -; TUNIT-NEXT: call void @write1ToGInt1() #[[ATTR10]] +; TUNIT-NEXT: call void @write1ToGInt1() #[[ATTR11:[0-9]+]] ; TUNIT-NEXT: [[L4:%.*]] = load i32, ptr @GInt1, align 4 ; TUNIT-NEXT: call void @useI32(i32 [[L4]]) ; TUNIT-NEXT: ret void @@ -125,7 +125,7 @@ ; TUNIT: F: ; TUNIT-NEXT: [[L3:%.*]] = load i32, ptr @GInt2, align 4 ; TUNIT-NEXT: call void @useI32(i32 [[L3]]) -; TUNIT-NEXT: call void @write1ToGInt2() #[[ATTR10]] +; TUNIT-NEXT: call void @write1ToGInt2() #[[ATTR11]] ; TUNIT-NEXT: [[L4:%.*]] = load i32, ptr @GInt2, align 4 ; TUNIT-NEXT: call void @useI32(i32 [[L4]]) ; TUNIT-NEXT: ret void @@ -795,19 +795,20 @@ ; TUNIT: attributes #[[ATTR1:[0-9]+]] = { nocallback nosync } ; TUNIT: attributes #[[ATTR2:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } ; TUNIT: attributes #[[ATTR3:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } -; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } ; TUNIT: attributes #[[ATTR5]] = { norecurse nosync } ; TUNIT: attributes #[[ATTR6]] = { nocallback } ; TUNIT: attributes #[[ATTR7]] = { norecurse } ; TUNIT: attributes #[[ATTR8]] = { nosync } ; TUNIT: attributes #[[ATTR9:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR10]] = { nosync nounwind } +; TUNIT: attributes #[[ATTR10]] = { nosync nounwind memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR11]] = { nosync nounwind } ;. ; CGSCC: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } ; CGSCC: attributes #[[ATTR1:[0-9]+]] = { nocallback nosync } ; CGSCC: attributes #[[ATTR2:[0-9]+]] = { allockind("free") "alloc-family"="malloc" } ; CGSCC: attributes #[[ATTR3:[0-9]+]] = { allockind("alloc,zeroed") allocsize(0,1) "alloc-family"="malloc" } -; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } ; CGSCC: attributes #[[ATTR5]] = { nosync } ; CGSCC: attributes #[[ATTR6]] = { norecurse nosync } ; CGSCC: attributes #[[ATTR7]] = { nocallback } Index: llvm/test/Transforms/Attributor/value-simplify.ll =================================================================== --- llvm/test/Transforms/Attributor/value-simplify.ll +++ llvm/test/Transforms/Attributor/value-simplify.ll @@ -91,11 +91,11 @@ ; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2:[0-9]+]] { ; CGSCC-NEXT: br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]] ; CGSCC: if.true: -; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @return0() #[[ATTR13:[0-9]+]] +; CGSCC-NEXT: [[CALL:%.*]] = tail call i32 @return0() #[[ATTR15:[0-9]+]] ; CGSCC-NEXT: [[RET0:%.*]] = add i32 [[CALL]], 1 ; CGSCC-NEXT: br label [[END:%.*]] ; CGSCC: if.false: -; CGSCC-NEXT: [[RET1:%.*]] = tail call i32 @return1() #[[ATTR13]] +; CGSCC-NEXT: [[RET1:%.*]] = tail call i32 @return1() #[[ATTR15]] ; CGSCC-NEXT: br label [[END]] ; CGSCC: end: ; CGSCC-NEXT: [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ] @@ -127,7 +127,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test2_2 ; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[RET:%.*]] = tail call noundef i32 @test2_1(i1 noundef [[C]]) #[[ATTR13]] +; CGSCC-NEXT: [[RET:%.*]] = tail call noundef i32 @test2_1(i1 noundef [[C]]) #[[ATTR15]] ; CGSCC-NEXT: ret i32 [[RET]] ; %ret = tail call i32 @test2_1(i1 %c) @@ -154,7 +154,7 @@ ; CGSCC: if.true: ; CGSCC-NEXT: br label [[END:%.*]] ; CGSCC: if.false: -; CGSCC-NEXT: [[RET1:%.*]] = tail call i32 @return1() #[[ATTR13]] +; CGSCC-NEXT: [[RET1:%.*]] = tail call i32 @return1() #[[ATTR15]] ; CGSCC-NEXT: br label [[END]] ; CGSCC: end: ; CGSCC-NEXT: [[R:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ] @@ -276,7 +276,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ipccp2 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[R:%.*]] = call noundef i1 @ipccp2i() #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call noundef i1 @ipccp2i() #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[R]] ; %r = call i1 @ipccp2i(i1 true) @@ -310,7 +310,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ipccp2b ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[R:%.*]] = call noundef i1 @ipccp2ib() #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call noundef i1 @ipccp2ib() #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[R]] ; %r = call i1 @ipccp2ib(i1 true) @@ -345,7 +345,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@ipccp3 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp3i() #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp3i() #[[ATTR15]] ; CGSCC-NEXT: ret i32 [[R]] ; %r = call i32 @ipccp3i(i32 7) @@ -374,7 +374,7 @@ ; CGSCC-SAME: () #[[ATTR2]] { ; CGSCC-NEXT: br label [[T:%.*]] ; CGSCC: t: -; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp4ia(i1 noundef true) #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp4ia(i1 noundef true) #[[ATTR15]] ; CGSCC-NEXT: ret i32 [[R]] ; CGSCC: f: ; CGSCC-NEXT: unreachable @@ -405,7 +405,7 @@ ; CGSCC: t: ; CGSCC-NEXT: br label [[F]] ; CGSCC: f: -; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp4ib() #[[ATTR13]] +; CGSCC-NEXT: [[R:%.*]] = call noundef i32 @ipccp4ib() #[[ATTR15]] ; CGSCC-NEXT: ret i32 [[R]] ; br i1 %c, label %t, label %f @@ -422,7 +422,7 @@ define internal ptr @test_inalloca(ptr inalloca(i32) %a) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@test_inalloca -; CHECK-SAME: (ptr noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr nofree nonnull returned inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: ret ptr [[A]] ; ret ptr %a @@ -431,13 +431,13 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@complicated_args_inalloca ; TUNIT-SAME: (ptr nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] { -; TUNIT-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) ptr @test_inalloca(ptr noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR9:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) ptr @test_inalloca(ptr nofree inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR11:[0-9]+]] ; TUNIT-NEXT: ret ptr [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@complicated_args_inalloca ; CGSCC-SAME: (ptr nofree noundef nonnull readnone dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[CALL:%.*]] = call noalias nonnull dereferenceable(4) ptr @test_inalloca(ptr noalias nofree noundef nonnull writeonly inalloca(i32) dereferenceable(4) [[ARG]]) #[[ATTR13]] +; CGSCC-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) ptr @test_inalloca(ptr noalias nofree noundef nonnull readnone inalloca(i32) dereferenceable(4) [[ARG]]) #[[ATTR15]] ; CGSCC-NEXT: ret ptr [[CALL]] ; %call = call ptr @test_inalloca(ptr inalloca(i32) %arg) @@ -447,7 +447,7 @@ define internal ptr @test_preallocated(ptr preallocated(i32) %a) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@test_preallocated -; CHECK-SAME: (ptr noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { +; CHECK-SAME: (ptr noalias nofree noundef nonnull returned preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] { ; CHECK-NEXT: ret ptr [[A]] ; ret ptr %a @@ -456,15 +456,14 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn ; TUNIT-LABEL: define {{[^@]+}}@complicated_args_preallocated ; TUNIT-SAME: () #[[ATTR2:[0-9]+]] { -; TUNIT-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR10:[0-9]+]] -; TUNIT-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) ptr @test_preallocated(ptr noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR9]] [ "preallocated"(token [[C]]) ] +; TUNIT-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR12:[0-9]+]] +; TUNIT-NEXT: [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) ptr @test_preallocated(ptr noalias nocapture nofree noundef preallocated(i32) align 4294967296 null) #[[ATTR11]] [ "preallocated"(token [[C]]) ] ; TUNIT-NEXT: ret ptr [[CALL]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn ; CGSCC-LABEL: define {{[^@]+}}@complicated_args_preallocated ; CGSCC-SAME: () #[[ATTR3:[0-9]+]] { -; CGSCC-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR13]] -; CGSCC-NEXT: [[CALL:%.*]] = call ptr @test_preallocated(ptr noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR14:[0-9]+]] [ "preallocated"(token [[C]]) ] +; CGSCC-NEXT: [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR15]] ; CGSCC-NEXT: ret ptr null ; %c = call token @llvm.call.preallocated.setup(i32 1) @@ -476,13 +475,13 @@ ; ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@test_sret -; TUNIT-SAME: (ptr noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3:[0-9]+]] { +; TUNIT-SAME: (ptr noalias nofree noundef nonnull sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3:[0-9]+]] { ; TUNIT-NEXT: store ptr [[A]], ptr [[B]], align 8 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; CGSCC-LABEL: define {{[^@]+}}@test_sret -; CGSCC-SAME: (ptr noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR4:[0-9]+]] { +; CGSCC-SAME: (ptr noalias nofree noundef nonnull sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR4:[0-9]+]] { ; CGSCC-NEXT: store ptr [[A]], ptr [[B]], align 8 ; CGSCC-NEXT: ret void ; @@ -496,7 +495,7 @@ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) ; TUNIT-LABEL: define {{[^@]+}}@complicated_args_sret ; TUNIT-SAME: (ptr nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] { -; TUNIT-NEXT: call void @test_sret(ptr noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, ptr nocapture nofree writeonly align 8 [[B]]) #[[ATTR9]] +; TUNIT-NEXT: call void @test_sret(ptr noalias nocapture nofree noundef sret([[STRUCT_X:%.*]]) align 4294967296 null, ptr nocapture nofree writeonly align 8 [[B]]) #[[ATTR11]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write) @@ -525,7 +524,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@complicated_args_nest ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[CALL:%.*]] = call noalias noundef align 4294967296 ptr @test_nest(ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR13]] +; CGSCC-NEXT: [[CALL:%.*]] = call noalias noundef align 4294967296 ptr @test_nest(ptr noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR15]] ; CGSCC-NEXT: ret ptr [[CALL]] ; %call = call ptr @test_nest(ptr null) @@ -554,18 +553,18 @@ ret void } define void @complicated_args_byval() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@complicated_args_byval ; TUNIT-SAME: () #[[ATTR4:[0-9]+]] { ; TUNIT-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8 -; TUNIT-NEXT: call void @test_byval(ptr [[TMP1]]) #[[ATTR9]] +; TUNIT-NEXT: call void @test_byval(ptr [[TMP1]]) #[[ATTR11]] ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) ; CGSCC-LABEL: define {{[^@]+}}@complicated_args_byval -; CGSCC-SAME: () #[[ATTR3]] { +; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { ; CGSCC-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8 -; CGSCC-NEXT: call void @test_byval(ptr nofree writeonly [[TMP1]]) #[[ATTR14]] +; CGSCC-NEXT: call void @test_byval(ptr nofree writeonly [[TMP1]]) #[[ATTR16:[0-9]+]] ; CGSCC-NEXT: ret void ; call void @test_byval(ptr byval(%struct.X) @S) @@ -681,7 +680,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller0 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 undef) @@ -696,7 +695,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller1 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 undef) @@ -711,7 +710,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller2 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 undef) @@ -726,7 +725,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller_middle ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 42) @@ -741,7 +740,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller3 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 undef) @@ -756,7 +755,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@caller4 ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i8 @callee() #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[C]] ; %c = call i8 @callee(i8 undef) @@ -773,16 +772,16 @@ } define void @user_as3() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@user_as3 -; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-SAME: () #[[ATTR5:[0-9]+]] { ; TUNIT-NEXT: store i32 0, ptr addrspace(3) @ConstAS3Ptr, align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@user_as3 -; CGSCC-SAME: () #[[ATTR6:[0-9]+]] { -; CGSCC-NEXT: [[CALL:%.*]] = call fastcc align 4 ptr addrspace(3) @const_ptr_return_as3() #[[ATTR13]] +; CGSCC-SAME: () #[[ATTR7:[0-9]+]] { +; CGSCC-NEXT: [[CALL:%.*]] = call fastcc align 4 ptr addrspace(3) @const_ptr_return_as3() #[[ATTR15]] ; CGSCC-NEXT: store i32 0, ptr addrspace(3) [[CALL]], align 4 ; CGSCC-NEXT: ret void ; @@ -791,16 +790,16 @@ ret void } define void @user() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@user -; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: store i32 0, ptr addrspacecast (ptr addrspace(3) @ConstAS3Ptr to ptr), align 4 ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write) ; CGSCC-LABEL: define {{[^@]+}}@user -; CGSCC-SAME: () #[[ATTR6]] { -; CGSCC-NEXT: [[CALL:%.*]] = call fastcc align 4 ptr @const_ptr_return() #[[ATTR13]] +; CGSCC-SAME: () #[[ATTR7]] { +; CGSCC-NEXT: [[CALL:%.*]] = call fastcc align 4 ptr @const_ptr_return() #[[ATTR15]] ; CGSCC-NEXT: store i32 0, ptr [[CALL]], align 4 ; CGSCC-NEXT: ret void ; @@ -819,7 +818,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr ; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR13]] +; CGSCC-NEXT: [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[R1]] ; %r1 = call i1 @undef_then_null(i1 %c, ptr undef, ptr undef) @@ -855,7 +854,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_merge_with_undef_values ; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR13]] +; CGSCC-NEXT: [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[R1]] ; %r1 = call i1 @undef_then_1(i1 %c, i32 undef, i32 undef) @@ -892,7 +891,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_select ; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR2]] { -; CGSCC-NEXT: [[CALL:%.*]] = call noundef i32 @select() #[[ATTR13]] +; CGSCC-NEXT: [[CALL:%.*]] = call noundef i32 @select() #[[ATTR15]] ; CGSCC-NEXT: ret i32 [[CALL]] ; %call = call i32 @select(i1 1, i32 42, i32 %c) @@ -920,16 +919,18 @@ } define void @test_callee_is_undef(ptr %fn) { +; TUNIT: Function Attrs: memory(readwrite, argmem: none) ; TUNIT-LABEL: define {{[^@]+}}@test_callee_is_undef -; TUNIT-SAME: (ptr nocapture nofree [[FN:%.*]]) { +; TUNIT-SAME: (ptr nocapture nofree readnone [[FN:%.*]]) #[[ATTR6:[0-9]+]] { ; TUNIT-NEXT: call void @callee_is_undef() -; TUNIT-NEXT: call void @unknown_calle_arg_is_undef(ptr nocapture nofree [[FN]]) +; TUNIT-NEXT: call void @unknown_calle_arg_is_undef(ptr noalias nocapture nofree readnone [[FN]]) ; TUNIT-NEXT: ret void ; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) ; CGSCC-LABEL: define {{[^@]+}}@test_callee_is_undef -; CGSCC-SAME: (ptr nocapture nofree [[FN:%.*]]) { +; CGSCC-SAME: (ptr nocapture nofree readnone [[FN:%.*]]) #[[ATTR8:[0-9]+]] { ; CGSCC-NEXT: call void @callee_is_undef() -; CGSCC-NEXT: call void @unknown_calle_arg_is_undef(ptr nocapture nofree noundef nonnull [[FN]]) +; CGSCC-NEXT: call void @unknown_calle_arg_is_undef(ptr noalias nocapture nofree noundef nonnull readnone [[FN]]) ; CGSCC-NEXT: ret void ; call void @callee_is_undef(ptr undef) @@ -938,19 +939,34 @@ } define internal void @callee_is_undef(ptr %fn) { ; -; CHECK-LABEL: define {{[^@]+}}@callee_is_undef() { -; CHECK-NEXT: call void undef() -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@callee_is_undef +; TUNIT-SAME: () #[[ATTR6]] { +; TUNIT-NEXT: call void undef() +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@callee_is_undef +; CGSCC-SAME: () #[[ATTR8]] { +; CGSCC-NEXT: call void undef() +; CGSCC-NEXT: ret void ; call void %fn() ret void } define internal void @unknown_calle_arg_is_undef(ptr %fn, i32 %arg) { ; -; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef -; CHECK-SAME: (ptr nocapture nofree noundef nonnull [[FN:%.*]]) { -; CHECK-NEXT: call void [[FN]](i32 undef) -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef +; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull readnone [[FN:%.*]]) #[[ATTR6]] { +; TUNIT-NEXT: call void [[FN]](i32 undef) +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef +; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull readnone [[FN:%.*]]) #[[ATTR8]] { +; CGSCC-NEXT: call void [[FN]](i32 undef) +; CGSCC-NEXT: ret void ; call void %fn(i32 %arg) ret void @@ -985,7 +1001,7 @@ ; CHECK-LABEL: define {{[^@]+}}@f2 ; CHECK-SAME: (ptr [[A:%.*]]) { ; CHECK-NEXT: cont461: -; CHECK-NEXT: call void @f3(ptr [[A]], ptr nocapture nofree [[A]]) +; CHECK-NEXT: call void @f3(ptr [[A]], ptr noalias nocapture nofree readnone [[A]]) ; CHECK-NEXT: ret void ; cont461: @@ -995,7 +1011,7 @@ define internal void @f3(ptr %a1, ptr %a) { ; CHECK-LABEL: define {{[^@]+}}@f3 -; CHECK-SAME: (ptr [[A1:%.*]], ptr nocapture nofree [[A:%.*]]) { +; CHECK-SAME: (ptr [[A1:%.*]], ptr noalias nocapture nofree readnone [[A:%.*]]) { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CALL20:%.*]] = call i1 @f9() ; CHECK-NEXT: br i1 [[CALL20]], label [[LAND_LHS_TRUE:%.*]], label [[IF_END40:%.*]] @@ -1038,7 +1054,7 @@ ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_cmp_null_after_cast ; CGSCC-SAME: () #[[ATTR2]] { -; CGSCC-NEXT: [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR13]] +; CGSCC-NEXT: [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[C]] ; %c = call i1 @cmp_null_after_cast(i32 0, i8 0) @@ -1147,7 +1163,7 @@ ; TUNIT-NEXT: br label [[F]] ; TUNIT: f: ; TUNIT-NEXT: [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ] -; TUNIT-NEXT: [[RC1:%.*]] = call i1 @ret(i1 noundef [[P]]) #[[ATTR9]] +; TUNIT-NEXT: [[RC1:%.*]] = call i1 @ret(i1 noundef [[P]]) #[[ATTR11]] ; TUNIT-NEXT: ret i1 [[RC1]] ; ; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) @@ -1159,7 +1175,7 @@ ; CGSCC-NEXT: br label [[F]] ; CGSCC: f: ; CGSCC-NEXT: [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ] -; CGSCC-NEXT: [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR13]] +; CGSCC-NEXT: [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR15]] ; CGSCC-NEXT: ret i1 [[RC1]] ; entry: @@ -1215,23 +1231,23 @@ declare void @llvm.memcpy(ptr %dest, ptr %src, i32 %len, i1 %isvolatile) define internal i8 @memcpy_uses_store(i8 %arg) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@memcpy_uses_store -; TUNIT-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] { +; TUNIT-SAME: (i8 [[ARG:%.*]]) #[[ATTR1]] { ; TUNIT-NEXT: [[SRC:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: [[DST:%.*]] = alloca i8, align 1 ; TUNIT-NEXT: store i8 [[ARG]], ptr [[SRC]], align 1 -; TUNIT-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR11:[0-9]+]] +; TUNIT-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR12]] ; TUNIT-NEXT: [[L:%.*]] = load i8, ptr [[DST]], align 1 ; TUNIT-NEXT: ret i8 [[L]] ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@memcpy_uses_store -; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR7:[0-9]+]] { +; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR1]] { ; CGSCC-NEXT: [[SRC:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: [[DST:%.*]] = alloca i8, align 1 ; CGSCC-NEXT: store i8 [[ARG]], ptr [[SRC]], align 1 -; CGSCC-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR15:[0-9]+]] +; CGSCC-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], ptr noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR15]] ; CGSCC-NEXT: [[L:%.*]] = load i8, ptr [[DST]], align 1 ; CGSCC-NEXT: ret i8 [[L]] ; @@ -1244,16 +1260,51 @@ } define i8 @memcpy_uses_store_caller(i8 %arg) { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@memcpy_uses_store_caller -; TUNIT-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] { -; TUNIT-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR9]] +; TUNIT-SAME: (i8 [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR11]] ; TUNIT-NEXT: ret i8 [[R]] ; -; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@memcpy_uses_store_caller -; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] { -; CGSCC-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR14]] +; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR15]] +; CGSCC-NEXT: ret i8 [[R]] +; + %r = call i8 @memcpy_uses_store(i8 %arg) + ret i8 %r +} +define internal i8 @memcpy_uses_store2(i8 %arg) readnone { +; CGSCC: Function Attrs: memory(none) +; CGSCC-LABEL: define {{[^@]+}}@memcpy_uses_store2 +; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR9:[0-9]+]] { +; CGSCC-NEXT: [[SRC:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: [[DST:%.*]] = alloca i8, align 1 +; CGSCC-NEXT: store i8 [[ARG]], ptr [[SRC]], align 1 +; CGSCC-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr [[DST]], ptr [[SRC]], i32 1, i1 false) +; CGSCC-NEXT: [[L:%.*]] = load i8, ptr [[DST]], align 1 +; CGSCC-NEXT: ret i8 [[L]] +; + %src = alloca i8 + %dst = alloca i8 + store i8 %arg, ptr %src + call void @llvm.memcpy(ptr %dst, ptr %src, i32 1, i1 false) + %l = load i8, ptr %dst + ret i8 %l +} + +define i8 @memcpy_uses_store_caller2(i8 %arg) readnone { +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; TUNIT-LABEL: define {{[^@]+}}@memcpy_uses_store_caller2 +; TUNIT-SAME: (i8 [[ARG:%.*]]) #[[ATTR1]] { +; TUNIT-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR11]] +; TUNIT-NEXT: ret i8 [[R]] +; +; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) +; CGSCC-LABEL: define {{[^@]+}}@memcpy_uses_store_caller2 +; CGSCC-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] { +; CGSCC-NEXT: [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR15]] ; CGSCC-NEXT: ret i8 [[R]] ; %r = call i8 @memcpy_uses_store(i8 %arg) @@ -1266,18 +1317,18 @@ define i32 @test_speculatable_expr() norecurse { ; TUNIT: Function Attrs: norecurse nosync memory(none) ; TUNIT-LABEL: define {{[^@]+}}@test_speculatable_expr -; TUNIT-SAME: () #[[ATTR6:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR8:[0-9]+]] { ; TUNIT-NEXT: [[STACK:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: [[SPEC_RESULT:%.*]] = call i32 @speculatable() ; TUNIT-NEXT: [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1 ; TUNIT-NEXT: store i32 [[PLUS1]], ptr [[STACK]], align 4 ; TUNIT-NEXT: [[TMP1:%.*]] = load i32, ptr [[STACK]], align 4 -; TUNIT-NEXT: [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[TMP1]]) #[[ATTR12:[0-9]+]] +; TUNIT-NEXT: [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[TMP1]]) #[[ATTR13:[0-9]+]] ; TUNIT-NEXT: ret i32 [[RSPEC]] ; ; CGSCC: Function Attrs: norecurse nosync memory(none) ; CGSCC-LABEL: define {{[^@]+}}@test_speculatable_expr -; CGSCC-SAME: () #[[ATTR9:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { ; CGSCC-NEXT: [[STACK:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: [[SPEC_RESULT:%.*]] = call i32 @speculatable() ; CGSCC-NEXT: [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1 @@ -1296,7 +1347,7 @@ define internal i32 @ret_speculatable_expr(ptr %mem, i32 %a2) { ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; TUNIT-LABEL: define {{[^@]+}}@ret_speculatable_expr -; TUNIT-SAME: (i32 [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] { +; TUNIT-SAME: (i32 [[TMP0:%.*]]) #[[ATTR9:[0-9]+]] { ; TUNIT-NEXT: [[MEM_PRIV:%.*]] = alloca i32, align 4 ; TUNIT-NEXT: store i32 [[TMP0]], ptr [[MEM_PRIV]], align 4 ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr [[MEM_PRIV]], align 4 @@ -1306,7 +1357,7 @@ ; ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) ; CGSCC-LABEL: define {{[^@]+}}@ret_speculatable_expr -; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] { +; CGSCC-SAME: (i32 [[TMP0:%.*]]) #[[ATTR12:[0-9]+]] { ; CGSCC-NEXT: [[MEM_PRIV:%.*]] = alloca i32, align 4 ; CGSCC-NEXT: store i32 [[TMP0]], ptr [[MEM_PRIV]], align 4 ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr [[MEM_PRIV]], align 4 @@ -1369,15 +1420,15 @@ @x = external global i32 define internal void @indirect() { -; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; TUNIT-LABEL: define {{[^@]+}}@indirect -; TUNIT-SAME: () #[[ATTR4]] { +; TUNIT-SAME: () #[[ATTR5]] { ; TUNIT-NEXT: store i32 0, ptr @x, align 4 ; TUNIT-NEXT: ret void ; -; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) +; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) ; CGSCC-LABEL: define {{[^@]+}}@indirect -; CGSCC-SAME: () #[[ATTR11:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR13:[0-9]+]] { ; CGSCC-NEXT: store i32 0, ptr @x, align 4 ; CGSCC-NEXT: ret void ; @@ -1386,11 +1437,21 @@ } define internal void @broker(void ()* %ptr) { -; CHECK-LABEL: define {{[^@]+}}@broker() { -; CHECK-NEXT: entry: -; CHECK-NEXT: call void @indirect() -; CHECK-NEXT: call void @unknown() -; CHECK-NEXT: ret void +; TUNIT: Function Attrs: memory(readwrite, argmem: none) +; TUNIT-LABEL: define {{[^@]+}}@broker +; TUNIT-SAME: () #[[ATTR6]] { +; TUNIT-NEXT: entry: +; TUNIT-NEXT: call void @indirect() +; TUNIT-NEXT: call void @unknown() +; TUNIT-NEXT: ret void +; +; CGSCC: Function Attrs: memory(readwrite, argmem: none) +; CGSCC-LABEL: define {{[^@]+}}@broker +; CGSCC-SAME: () #[[ATTR8]] { +; CGSCC-NEXT: entry: +; CGSCC-NEXT: call void @indirect() +; CGSCC-NEXT: call void @unknown() +; CGSCC-NEXT: ret void ; entry: call void %ptr() @@ -1432,15 +1493,16 @@ ; TUNIT: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } ; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn } ; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } -; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; TUNIT: attributes #[[ATTR5:[0-9]+]] = { speculatable memory(none) } -; TUNIT: attributes #[[ATTR6]] = { norecurse nosync memory(none) } -; TUNIT: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -; TUNIT: attributes #[[ATTR9]] = { nofree nosync nounwind willreturn } -; TUNIT: attributes #[[ATTR10]] = { willreturn } -; TUNIT: attributes #[[ATTR11]] = { willreturn memory(readwrite) } -; TUNIT: attributes #[[ATTR12]] = { nosync nounwind } +; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; TUNIT: attributes #[[ATTR6]] = { memory(readwrite, argmem: none) } +; TUNIT: attributes #[[ATTR7:[0-9]+]] = { speculatable memory(none) } +; TUNIT: attributes #[[ATTR8]] = { norecurse nosync memory(none) } +; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; TUNIT: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn } +; TUNIT: attributes #[[ATTR12]] = { willreturn } +; TUNIT: attributes #[[ATTR13]] = { nosync nounwind memory(argmem: read) } ;. ; CGSCC: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn } ; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } @@ -1448,14 +1510,15 @@ ; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn } ; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) } ; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: write) } -; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree norecurse nosync nounwind willreturn } -; CGSCC: attributes #[[ATTR8:[0-9]+]] = { speculatable memory(none) } -; CGSCC: attributes #[[ATTR9]] = { norecurse nosync memory(none) } -; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } -; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) } -; CGSCC: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } -; CGSCC: attributes #[[ATTR13]] = { willreturn } -; CGSCC: attributes #[[ATTR14]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR15]] = { willreturn memory(readwrite) } +; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: write) } +; CGSCC: attributes #[[ATTR7]] = { mustprogress nofree nosync nounwind willreturn memory(write) } +; CGSCC: attributes #[[ATTR8]] = { memory(readwrite, argmem: none) } +; CGSCC: attributes #[[ATTR9]] = { memory(none) } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { speculatable memory(none) } +; CGSCC: attributes #[[ATTR11]] = { norecurse nosync memory(none) } +; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, inaccessiblemem: none) } +; CGSCC: attributes #[[ATTR14:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } +; CGSCC: attributes #[[ATTR15]] = { willreturn } +; CGSCC: attributes #[[ATTR16]] = { nounwind willreturn } ;. Index: llvm/test/Transforms/Attributor/willreturn.ll =================================================================== --- llvm/test/Transforms/Attributor/willreturn.ll +++ llvm/test/Transforms/Attributor/willreturn.ll @@ -35,9 +35,9 @@ ; TUNIT-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] ; TUNIT: 3: ; TUNIT-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR25:[0-9]+]] +; TUNIT-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR26:[0-9]+]] ; TUNIT-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; TUNIT-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR25]] +; TUNIT-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR27:[0-9]+]] ; TUNIT-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; TUNIT-NEXT: ret i32 [[TMP8]] ; TUNIT: 9: @@ -50,9 +50,9 @@ ; CGSCC-NEXT: br i1 [[TMP2]], label [[TMP9:%.*]], label [[TMP3:%.*]] ; CGSCC: 3: ; CGSCC-NEXT: [[TMP4:%.*]] = add nsw i32 [[TMP0]], -1 -; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR26:[0-9]+]] +; CGSCC-NEXT: [[TMP5:%.*]] = tail call i32 @fib(i32 [[TMP4]]) #[[ATTR20:[0-9]+]] ; CGSCC-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], -2 -; CGSCC-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR26]] +; CGSCC-NEXT: [[TMP7:%.*]] = tail call i32 @fib(i32 [[TMP6]]) #[[ATTR27:[0-9]+]] ; CGSCC-NEXT: [[TMP8:%.*]] = add nsw i32 [[TMP7]], [[TMP5]] ; CGSCC-NEXT: ret i32 [[TMP8]] ; CGSCC: 9: @@ -176,27 +176,16 @@ declare void @sink() nounwind willreturn nosync nofree define void @mutual_recursion1(i1 %c) #0 { -; TUNIT: Function Attrs: nofree noinline nosync nounwind uwtable -; TUNIT-LABEL: define {{[^@]+}}@mutual_recursion1 -; TUNIT-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; TUNIT-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; TUNIT: rec: -; TUNIT-NEXT: call void @sink() #[[ATTR26:[0-9]+]] -; TUNIT-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR25]] -; TUNIT-NEXT: br label [[END]] -; TUNIT: end: -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: nofree noinline nosync nounwind uwtable -; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion1 -; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { -; CGSCC-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] -; CGSCC: rec: -; CGSCC-NEXT: call void @sink() #[[ATTR27:[0-9]+]] -; CGSCC-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR26]] -; CGSCC-NEXT: br label [[END]] -; CGSCC: end: -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: nofree noinline nosync nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion1 +; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-NEXT: br i1 [[C]], label [[REC:%.*]], label [[END:%.*]] +; CHECK: rec: +; CHECK-NEXT: call void @sink() #[[ATTR28:[0-9]+]] +; CHECK-NEXT: call void @mutual_recursion2(i1 noundef [[C]]) #[[ATTR27:[0-9]+]] +; CHECK-NEXT: br label [[END]] +; CHECK: end: +; CHECK-NEXT: ret void ; br i1 %c, label %rec, label %end rec: @@ -209,17 +198,11 @@ define void @mutual_recursion2(i1 %c) #0 { -; TUNIT: Function Attrs: nofree noinline nosync nounwind uwtable -; TUNIT-LABEL: define {{[^@]+}}@mutual_recursion2 -; TUNIT-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; TUNIT-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR25]] -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: nofree noinline nosync nounwind uwtable -; CGSCC-LABEL: define {{[^@]+}}@mutual_recursion2 -; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { -; CGSCC-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR26]] -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: nofree noinline nosync nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@mutual_recursion2 +; CHECK-SAME: (i1 [[C:%.*]]) #[[ATTR4]] { +; CHECK-NEXT: call void @mutual_recursion1(i1 [[C]]) #[[ATTR27]] +; CHECK-NEXT: ret void ; call void @mutual_recursion1(i1 %c) ret void @@ -254,7 +237,7 @@ ; return; ; } define void @conditional_exit(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { -; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK: Function Attrs: noinline nounwind memory(readwrite, argmem: read) uwtable ; CHECK-LABEL: define {{[^@]+}}@conditional_exit ; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0 @@ -309,17 +292,11 @@ } define float @call_floor2(float %a) #0 { -; TUNIT: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable -; TUNIT-LABEL: define {{[^@]+}}@call_floor2 -; TUNIT-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; TUNIT-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR27:[0-9]+]] -; TUNIT-NEXT: ret float [[C]] -; -; CGSCC: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable -; CGSCC-LABEL: define {{[^@]+}}@call_floor2 -; CGSCC-SAME: (float [[A:%.*]]) #[[ATTR0]] { -; CGSCC-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR28:[0-9]+]] -; CGSCC-NEXT: ret float [[C]] +; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable +; CHECK-LABEL: define {{[^@]+}}@call_floor2 +; CHECK-SAME: (float [[A:%.*]]) #[[ATTR0]] { +; CHECK-NEXT: [[C:%.*]] = tail call nofpclass(sub) float @llvm.floor.f32(float [[A]]) #[[ATTR29:[0-9]+]] +; CHECK-NEXT: ret float [[C]] ; %c = tail call float @llvm.floor.f32(float %a) ret float %c @@ -335,17 +312,11 @@ declare void @maybe_noreturn() #0 define void @call_maybe_noreturn() #0 { -; TUNIT: Function Attrs: noinline nounwind uwtable -; TUNIT-LABEL: define {{[^@]+}}@call_maybe_noreturn -; TUNIT-SAME: () #[[ATTR7]] { -; TUNIT-NEXT: tail call void @maybe_noreturn() #[[ATTR28:[0-9]+]] -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: noinline nounwind uwtable -; CGSCC-LABEL: define {{[^@]+}}@call_maybe_noreturn -; CGSCC-SAME: () #[[ATTR7]] { -; CGSCC-NEXT: tail call void @maybe_noreturn() #[[ATTR29:[0-9]+]] -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: noinline nounwind uwtable +; CHECK-LABEL: define {{[^@]+}}@call_maybe_noreturn +; CHECK-SAME: () #[[ATTR9:[0-9]+]] { +; CHECK-NEXT: tail call void @maybe_noreturn() #[[ATTR30:[0-9]+]] +; CHECK-NEXT: ret void ; tail call void @maybe_noreturn() ret void @@ -360,34 +331,22 @@ declare void @will_return() willreturn norecurse define void @f1() #0 { -; TUNIT: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; TUNIT-LABEL: define {{[^@]+}}@f1 -; TUNIT-SAME: () #[[ATTR10:[0-9]+]] { -; TUNIT-NEXT: tail call void @will_return() #[[ATTR27]] -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; CGSCC-LABEL: define {{[^@]+}}@f1 -; CGSCC-SAME: () #[[ATTR10:[0-9]+]] { -; CGSCC-NEXT: tail call void @will_return() #[[ATTR28]] -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: mustprogress noinline nounwind willreturn uwtable +; CHECK-LABEL: define {{[^@]+}}@f1 +; CHECK-SAME: () #[[ATTR11:[0-9]+]] { +; CHECK-NEXT: tail call void @will_return() #[[ATTR29]] +; CHECK-NEXT: ret void ; tail call void @will_return() ret void } define void @f2() #0 { -; TUNIT: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; TUNIT-LABEL: define {{[^@]+}}@f2 -; TUNIT-SAME: () #[[ATTR10]] { -; TUNIT-NEXT: tail call void @f1() #[[ATTR26]] -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; CGSCC-LABEL: define {{[^@]+}}@f2 -; CGSCC-SAME: () #[[ATTR10]] { -; CGSCC-NEXT: tail call void @f1() #[[ATTR27]] -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: mustprogress noinline nounwind willreturn uwtable +; CHECK-LABEL: define {{[^@]+}}@f2 +; CHECK-SAME: () #[[ATTR11]] { +; CHECK-NEXT: tail call void @f1() #[[ATTR28]] +; CHECK-NEXT: ret void ; tail call void @f1() ret void @@ -425,29 +384,17 @@ declare i1 @maybe_raise_exception() #1 willreturn define void @invoke_test() personality i32 (...)* @__gxx_personality_v0 { -; TUNIT: Function Attrs: mustprogress nounwind willreturn -; TUNIT-LABEL: define {{[^@]+}}@invoke_test -; TUNIT-SAME: () #[[ATTR12:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; TUNIT-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR27]] -; TUNIT-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; TUNIT: N: -; TUNIT-NEXT: ret void -; TUNIT: F: -; TUNIT-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; TUNIT-NEXT: catch i8* null -; TUNIT-NEXT: ret void -; -; CGSCC: Function Attrs: mustprogress nounwind willreturn -; CGSCC-LABEL: define {{[^@]+}}@invoke_test -; CGSCC-SAME: () #[[ATTR12:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { -; CGSCC-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR28]] -; CGSCC-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] -; CGSCC: N: -; CGSCC-NEXT: ret void -; CGSCC: F: -; CGSCC-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } -; CGSCC-NEXT: catch i8* null -; CGSCC-NEXT: ret void +; CHECK: Function Attrs: mustprogress nounwind willreturn +; CHECK-LABEL: define {{[^@]+}}@invoke_test +; CHECK-SAME: () #[[ATTR13:[0-9]+]] personality i32 (...)* @__gxx_personality_v0 { +; CHECK-NEXT: [[TMP1:%.*]] = invoke i1 @maybe_raise_exception() #[[ATTR29]] +; CHECK-NEXT: to label [[N:%.*]] unwind label [[F:%.*]] +; CHECK: N: +; CHECK-NEXT: ret void +; CHECK: F: +; CHECK-NEXT: [[VAL:%.*]] = landingpad { i8*, i32 } +; CHECK-NEXT: catch i8* null +; CHECK-NEXT: ret void ; invoke i1 @maybe_raise_exception() to label %N unwind label %F @@ -475,7 +422,7 @@ define i32 @loop_constant_trip_count(i32* nocapture readonly %0) #0 { ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable ; CHECK-LABEL: define {{[^@]+}}@loop_constant_trip_count -; CHECK-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR13:[0-9]+]] { +; CHECK-SAME: (i32* nocapture nofree nonnull readonly dereferenceable(4) [[TMP0:%.*]]) #[[ATTR14:[0-9]+]] { ; CHECK-NEXT: br label [[TMP3:%.*]] ; CHECK: 2: ; CHECK-NEXT: ret i32 [[TMP8:%.*]] @@ -519,7 +466,7 @@ define i32 @loop_trip_count_unbound(i32 %0, i32 %1, i32* nocapture readonly %2, i32 %3) local_unnamed_addr #0 { ; CHECK: Function Attrs: nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable ; CHECK-LABEL: define {{[^@]+}}@loop_trip_count_unbound -; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR14:[0-9]+]] { +; CHECK-SAME: (i32 [[TMP0:%.*]], i32 [[TMP1:%.*]], i32* nocapture nofree readonly [[TMP2:%.*]], i32 [[TMP3:%.*]]) local_unnamed_addr #[[ATTR15:[0-9]+]] { ; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]] ; CHECK-NEXT: br i1 [[TMP5]], label [[TMP6:%.*]], label [[TMP8:%.*]] ; CHECK: 6: @@ -570,7 +517,7 @@ define i32 @loop_trip_dec(i32 %0, i32* nocapture readonly %1) local_unnamed_addr #0 { ; CHECK: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable ; CHECK-LABEL: define {{[^@]+}}@loop_trip_dec -; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR13]] { +; CHECK-SAME: (i32 [[TMP0:%.*]], i32* nocapture nofree readonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR14]] { ; CHECK-NEXT: [[TMP3:%.*]] = icmp sgt i32 [[TMP0]], -1 ; CHECK-NEXT: br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP14:%.*]] ; CHECK: 4: @@ -639,21 +586,13 @@ ; 15.1 (positive case) define void @unreachable_exit_positive1() #0 { -; TUNIT: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; TUNIT-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; TUNIT-SAME: () #[[ATTR10]] { -; TUNIT-NEXT: tail call void @will_return() #[[ATTR27]] -; TUNIT-NEXT: ret void -; TUNIT: unreachable_label: -; TUNIT-NEXT: unreachable -; -; CGSCC: Function Attrs: mustprogress noinline nounwind willreturn uwtable -; CGSCC-LABEL: define {{[^@]+}}@unreachable_exit_positive1 -; CGSCC-SAME: () #[[ATTR10]] { -; CGSCC-NEXT: tail call void @will_return() #[[ATTR28]] -; CGSCC-NEXT: ret void -; CGSCC: unreachable_label: -; CGSCC-NEXT: unreachable +; CHECK: Function Attrs: mustprogress noinline nounwind willreturn uwtable +; CHECK-LABEL: define {{[^@]+}}@unreachable_exit_positive1 +; CHECK-SAME: () #[[ATTR11]] { +; CHECK-NEXT: tail call void @will_return() #[[ATTR29]] +; CHECK-NEXT: ret void +; CHECK: unreachable_label: +; CHECK-NEXT: unreachable ; tail call void @will_return() ret void @@ -708,7 +647,7 @@ define void @unreachable_exit_negative1() #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@unreachable_exit_negative1 -; CHECK-SAME: () #[[ATTR7]] { +; CHECK-SAME: () #[[ATTR9]] { ; CHECK-NEXT: tail call void @exit(i32 noundef 0) #[[ATTR5]] ; CHECK-NEXT: unreachable ; CHECK: unreachable_label: @@ -725,7 +664,7 @@ define void @unreachable_exit_negative2() #0 { ; CHECK: Function Attrs: nofree noinline norecurse noreturn nosync nounwind memory(none) uwtable ; CHECK-LABEL: define {{[^@]+}}@unreachable_exit_negative2 -; CHECK-SAME: () #[[ATTR15:[0-9]+]] { +; CHECK-SAME: () #[[ATTR16:[0-9]+]] { ; CHECK-NEXT: br label [[L1:%.*]] ; CHECK: L1: ; CHECK-NEXT: br label [[L2:%.*]] @@ -752,7 +691,7 @@ define void @call_longjmp(i8* nocapture readnone %0) local_unnamed_addr #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@call_longjmp -; CHECK-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR7]] { +; CHECK-SAME: (i8* nocapture readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR9]] { ; CHECK-NEXT: tail call void @llvm.eh.sjlj.longjmp(i8* noalias readnone [[TMP0]]) #[[ATTR5]] ; CHECK-NEXT: unreachable ; @@ -774,7 +713,7 @@ define i32 @infinite_loop_inside_bounded_loop(i32 %n) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(none) ; CHECK-LABEL: define {{[^@]+}}@infinite_loop_inside_bounded_loop -; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR17:[0-9]+]] { +; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[FOR_COND:%.*]] ; CHECK: for.cond: @@ -835,7 +774,7 @@ define i32 @bounded_nested_loops(i32 %n) { ; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) ; CHECK-LABEL: define {{[^@]+}}@bounded_nested_loops -; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR18:[0-9]+]] { +; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[FOR_COND:%.*]] ; CHECK: for.cond: @@ -912,7 +851,7 @@ define i32 @bounded_loop_inside_unbounded_loop(i32 %n) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(none) ; CHECK-LABEL: define {{[^@]+}}@bounded_loop_inside_unbounded_loop -; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[WHILE_COND:%.*]] ; CHECK: while.cond: @@ -996,7 +935,7 @@ define i32 @nested_unbounded_loops(i32 %n) { ; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(none) ; CHECK-LABEL: define {{[^@]+}}@nested_unbounded_loops -; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; CHECK-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[WHILE_COND:%.*]] ; CHECK: while.cond: @@ -1086,9 +1025,9 @@ define void @non_loop_cycle(i32 %n) { ; TUNIT: Function Attrs: nofree norecurse nosync nounwind memory(none) ; TUNIT-LABEL: define {{[^@]+}}@non_loop_cycle -; TUNIT-SAME: (i32 [[N:%.*]]) #[[ATTR17]] { +; TUNIT-SAME: (i32 [[N:%.*]]) #[[ATTR18]] { ; TUNIT-NEXT: entry: -; TUNIT-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] +; TUNIT-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; TUNIT-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 ; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] ; TUNIT: if.then: @@ -1096,7 +1035,7 @@ ; TUNIT: if.else: ; TUNIT-NEXT: br label [[ENTRY2:%.*]] ; TUNIT: entry1: -; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] +; TUNIT-NEXT: [[CALL1:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; TUNIT-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[CALL1]], 5 ; TUNIT-NEXT: br i1 [[CMP2]], label [[IF_THEN3:%.*]], label [[IF_ELSE4:%.*]] ; TUNIT: if.then3: @@ -1104,7 +1043,7 @@ ; TUNIT: if.else4: ; TUNIT-NEXT: br label [[ENTRY2]] ; TUNIT: entry2: -; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR25]] +; TUNIT-NEXT: [[CALL5:%.*]] = call i32 @fact_loop(i32 [[N]]) #[[ATTR27]] ; TUNIT-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[CALL5]], 5 ; TUNIT-NEXT: br i1 [[CMP6]], label [[IF_THEN7:%.*]], label [[IF_ELSE8:%.*]] ; TUNIT: if.then7: @@ -1116,7 +1055,7 @@ ; ; CGSCC: Function Attrs: nofree nosync nounwind memory(none) ; CGSCC-LABEL: define {{[^@]+}}@non_loop_cycle -; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR19:[0-9]+]] { +; CGSCC-SAME: (i32 [[N:%.*]]) #[[ATTR20]] { ; CGSCC-NEXT: entry: ; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fact_loop(i32 [[N]]) ; CGSCC-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CALL]], 5 @@ -1190,13 +1129,13 @@ define void @willreturn_mustprogress_caller_1() mustprogress { ; TUNIT: Function Attrs: mustprogress ; TUNIT-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; TUNIT-SAME: () #[[ATTR21:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR22:[0-9]+]] { ; TUNIT-NEXT: call void @unknown() ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress ; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_1 -; CGSCC-SAME: () #[[ATTR22:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR23:[0-9]+]] { ; CGSCC-NEXT: call void @unknown() ; CGSCC-NEXT: ret void ; @@ -1206,13 +1145,13 @@ define void @willreturn_mustprogress_caller_2() mustprogress { ; TUNIT: Function Attrs: mustprogress willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; TUNIT-SAME: () #[[ATTR23:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR24:[0-9]+]] { ; TUNIT-NEXT: call void @readonly() ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2 -; CGSCC-SAME: () #[[ATTR24:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR25:[0-9]+]] { ; CGSCC-NEXT: call void @readonly() ; CGSCC-NEXT: ret void ; @@ -1222,13 +1161,13 @@ define void @willreturn_mustprogress_caller_3() mustprogress { ; TUNIT: Function Attrs: mustprogress nosync willreturn memory(none) ; TUNIT-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; TUNIT-SAME: () #[[ATTR24:[0-9]+]] { +; TUNIT-SAME: () #[[ATTR25:[0-9]+]] { ; TUNIT-NEXT: call void @readnone() ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress nosync willreturn memory(none) ; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3 -; CGSCC-SAME: () #[[ATTR25:[0-9]+]] { +; CGSCC-SAME: () #[[ATTR26:[0-9]+]] { ; CGSCC-NEXT: call void @readnone() ; CGSCC-NEXT: ret void ; @@ -1246,14 +1185,14 @@ define void @willreturn_mustprogress_callee_2() { ; TUNIT: Function Attrs: mustprogress willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; TUNIT-SAME: () #[[ATTR23]] { -; TUNIT-NEXT: call void @readonly_mustprogress() #[[ATTR27]] +; TUNIT-SAME: () #[[ATTR24]] { +; TUNIT-NEXT: call void @readonly_mustprogress() #[[ATTR29]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_2 -; CGSCC-SAME: () #[[ATTR24]] { -; CGSCC-NEXT: call void @readonly_mustprogress() #[[ATTR28]] +; CGSCC-SAME: () #[[ATTR25]] { +; CGSCC-NEXT: call void @readonly_mustprogress() #[[ATTR29]] ; CGSCC-NEXT: ret void ; call void @readonly_mustprogress() @@ -1270,14 +1209,14 @@ define void @willreturn_mustprogress_callee_4() { ; TUNIT: Function Attrs: mustprogress willreturn memory(read) ; TUNIT-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; TUNIT-SAME: () #[[ATTR23]] { -; TUNIT-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR27]] +; TUNIT-SAME: () #[[ATTR24]] { +; TUNIT-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR29]] ; TUNIT-NEXT: ret void ; ; CGSCC: Function Attrs: mustprogress willreturn memory(read) ; CGSCC-LABEL: define {{[^@]+}}@willreturn_mustprogress_callee_4 -; CGSCC-SAME: () #[[ATTR24]] { -; CGSCC-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR28]] +; CGSCC-SAME: () #[[ATTR25]] { +; CGSCC-NEXT: call void @willreturn_mustprogress_callee_2() #[[ATTR29]] ; CGSCC-NEXT: ret void ; call void @willreturn_mustprogress_callee_2() @@ -1294,28 +1233,30 @@ ; TUNIT: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } ; TUNIT: attributes #[[ATTR5]] = { noreturn } ; TUNIT: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } -; TUNIT: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; TUNIT: attributes #[[ATTR7]] = { noinline nounwind memory(readwrite, argmem: read) uwtable } ; TUNIT: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; TUNIT: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn } -; TUNIT: attributes #[[ATTR10]] = { mustprogress noinline nounwind willreturn uwtable } -; TUNIT: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable } -; TUNIT: attributes #[[ATTR12]] = { mustprogress nounwind willreturn } -; TUNIT: attributes #[[ATTR13]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } -; TUNIT: attributes #[[ATTR14]] = { nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable } -; TUNIT: attributes #[[ATTR15]] = { nofree noinline norecurse noreturn nosync nounwind memory(none) uwtable } -; TUNIT: attributes #[[ATTR16:[0-9]+]] = { noreturn nounwind } -; TUNIT: attributes #[[ATTR17]] = { nofree norecurse nosync nounwind memory(none) } -; TUNIT: attributes #[[ATTR18]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; TUNIT: attributes #[[ATTR19:[0-9]+]] = { memory(read) } -; TUNIT: attributes #[[ATTR20:[0-9]+]] = { memory(none) } -; TUNIT: attributes #[[ATTR21]] = { mustprogress } -; TUNIT: attributes #[[ATTR22:[0-9]+]] = { mustprogress memory(read) } -; TUNIT: attributes #[[ATTR23]] = { mustprogress willreturn memory(read) } -; TUNIT: attributes #[[ATTR24]] = { mustprogress nosync willreturn memory(none) } -; TUNIT: attributes #[[ATTR25]] = { nofree nosync nounwind } -; TUNIT: attributes #[[ATTR26]] = { nounwind willreturn } -; TUNIT: attributes #[[ATTR27]] = { willreturn } -; TUNIT: attributes #[[ATTR28]] = { nounwind } +; TUNIT: attributes #[[ATTR9]] = { noinline nounwind uwtable } +; TUNIT: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; TUNIT: attributes #[[ATTR11]] = { mustprogress noinline nounwind willreturn uwtable } +; TUNIT: attributes #[[ATTR12:[0-9]+]] = { noinline willreturn uwtable } +; TUNIT: attributes #[[ATTR13]] = { mustprogress nounwind willreturn } +; TUNIT: attributes #[[ATTR14]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } +; TUNIT: attributes #[[ATTR15]] = { nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable } +; TUNIT: attributes #[[ATTR16]] = { nofree noinline norecurse noreturn nosync nounwind memory(none) uwtable } +; TUNIT: attributes #[[ATTR17:[0-9]+]] = { noreturn nounwind } +; TUNIT: attributes #[[ATTR18]] = { nofree norecurse nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR19]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; TUNIT: attributes #[[ATTR20:[0-9]+]] = { memory(read) } +; TUNIT: attributes #[[ATTR21:[0-9]+]] = { memory(none) } +; TUNIT: attributes #[[ATTR22]] = { mustprogress } +; TUNIT: attributes #[[ATTR23:[0-9]+]] = { mustprogress memory(read) } +; TUNIT: attributes #[[ATTR24]] = { mustprogress willreturn memory(read) } +; TUNIT: attributes #[[ATTR25]] = { mustprogress nosync willreturn memory(none) } +; TUNIT: attributes #[[ATTR26]] = { nofree nosync nounwind memory(none) } +; TUNIT: attributes #[[ATTR27]] = { nofree nosync nounwind } +; TUNIT: attributes #[[ATTR28]] = { nounwind willreturn } +; TUNIT: attributes #[[ATTR29]] = { willreturn } +; TUNIT: attributes #[[ATTR30]] = { nounwind } ;. ; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(none) uwtable } ; CGSCC: attributes #[[ATTR1]] = { nofree noinline nosync nounwind memory(none) uwtable } @@ -1324,27 +1265,28 @@ ; CGSCC: attributes #[[ATTR4]] = { nofree noinline nosync nounwind uwtable } ; CGSCC: attributes #[[ATTR5]] = { noreturn } ; CGSCC: attributes #[[ATTR6]] = { noinline noreturn nounwind uwtable } -; CGSCC: attributes #[[ATTR7]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR7]] = { noinline nounwind memory(readwrite, argmem: read) uwtable } ; CGSCC: attributes #[[ATTR8:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -; CGSCC: attributes #[[ATTR9:[0-9]+]] = { norecurse willreturn } -; CGSCC: attributes #[[ATTR10]] = { mustprogress noinline nounwind willreturn uwtable } -; CGSCC: attributes #[[ATTR11:[0-9]+]] = { noinline willreturn uwtable } -; CGSCC: attributes #[[ATTR12]] = { mustprogress nounwind willreturn } -; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } -; CGSCC: attributes #[[ATTR14]] = { nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable } -; CGSCC: attributes #[[ATTR15]] = { nofree noinline norecurse noreturn nosync nounwind memory(none) uwtable } -; CGSCC: attributes #[[ATTR16:[0-9]+]] = { noreturn nounwind } -; CGSCC: attributes #[[ATTR17]] = { nofree norecurse nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR18]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } -; CGSCC: attributes #[[ATTR19]] = { nofree nosync nounwind memory(none) } -; CGSCC: attributes #[[ATTR20:[0-9]+]] = { memory(read) } -; CGSCC: attributes #[[ATTR21:[0-9]+]] = { memory(none) } -; CGSCC: attributes #[[ATTR22]] = { mustprogress } -; CGSCC: attributes #[[ATTR23:[0-9]+]] = { mustprogress memory(read) } -; CGSCC: attributes #[[ATTR24]] = { mustprogress willreturn memory(read) } -; CGSCC: attributes #[[ATTR25]] = { mustprogress nosync willreturn memory(none) } -; CGSCC: attributes #[[ATTR26]] = { nofree nosync nounwind } -; CGSCC: attributes #[[ATTR27]] = { nounwind willreturn } -; CGSCC: attributes #[[ATTR28]] = { willreturn } -; CGSCC: attributes #[[ATTR29]] = { nounwind } +; CGSCC: attributes #[[ATTR9]] = { noinline nounwind uwtable } +; CGSCC: attributes #[[ATTR10:[0-9]+]] = { norecurse willreturn } +; CGSCC: attributes #[[ATTR11]] = { mustprogress noinline nounwind willreturn uwtable } +; CGSCC: attributes #[[ATTR12:[0-9]+]] = { noinline willreturn uwtable } +; CGSCC: attributes #[[ATTR13]] = { mustprogress nounwind willreturn } +; CGSCC: attributes #[[ATTR14]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable } +; CGSCC: attributes #[[ATTR15]] = { nofree noinline norecurse nosync nounwind memory(argmem: read) uwtable } +; CGSCC: attributes #[[ATTR16]] = { nofree noinline norecurse noreturn nosync nounwind memory(none) uwtable } +; CGSCC: attributes #[[ATTR17:[0-9]+]] = { noreturn nounwind } +; CGSCC: attributes #[[ATTR18]] = { nofree norecurse nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR19]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) } +; CGSCC: attributes #[[ATTR20]] = { nofree nosync nounwind memory(none) } +; CGSCC: attributes #[[ATTR21:[0-9]+]] = { memory(read) } +; CGSCC: attributes #[[ATTR22:[0-9]+]] = { memory(none) } +; CGSCC: attributes #[[ATTR23]] = { mustprogress } +; CGSCC: attributes #[[ATTR24:[0-9]+]] = { mustprogress memory(read) } +; CGSCC: attributes #[[ATTR25]] = { mustprogress willreturn memory(read) } +; CGSCC: attributes #[[ATTR26]] = { mustprogress nosync willreturn memory(none) } +; CGSCC: attributes #[[ATTR27]] = { nofree nosync nounwind } +; CGSCC: attributes #[[ATTR28]] = { nounwind willreturn } +; CGSCC: attributes #[[ATTR29]] = { willreturn } +; CGSCC: attributes #[[ATTR30]] = { nounwind } ;. Index: llvm/test/Transforms/OpenMP/barrier_removal.ll =================================================================== --- llvm/test/Transforms/OpenMP/barrier_removal.ll +++ llvm/test/Transforms/OpenMP/barrier_removal.ll @@ -91,7 +91,6 @@ ; CHECK-LABEL: define {{[^@]+}}@pos_empty_7b ; CHECK-SAME: () #[[ATTR4]] { ; CHECK-NEXT: call void @unknown() #[[ATTR5:[0-9]+]] -; CHECK-NEXT: call void @llvm.amdgcn.s.barrier() ; CHECK-NEXT: call void @unknown() ; CHECK-NEXT: ret void ; Index: llvm/test/Transforms/OpenMP/custom_state_machines.ll =================================================================== --- llvm/test/Transforms/OpenMP/custom_state_machines.ll +++ llvm/test/Transforms/OpenMP/custom_state_machines.ll @@ -842,8 +842,8 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; AMDGPU-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; AMDGPU-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: @@ -855,37 +855,37 @@ ; AMDGPU-NEXT: ret i32 0 ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__ -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; AMDGPU-SAME: () #[[ATTR1:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR2:[0-9]+]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; AMDGPU-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; AMDGPU: omp_if.then: ; AMDGPU-NEXT: store i32 0, ptr @G, align 4 -; AMDGPU-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: br label [[OMP_IF_END]] ; AMDGPU: omp_if.end: -; AMDGPU-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -951,35 +951,35 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__1 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__2 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; @@ -992,17 +992,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__3 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1015,7 +1015,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1076,41 +1076,41 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__4 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; AMDGPU-SAME: () #[[ATTR6:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR7:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1118,13 +1118,13 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__5 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1137,23 +1137,23 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1214,34 +1214,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__6 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__7 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1254,17 +1254,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__8 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1277,7 +1277,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1332,34 +1332,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__9 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__10 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1372,17 +1372,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__11 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1395,7 +1395,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1450,34 +1450,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__12 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__13 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1490,17 +1490,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__14 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1513,7 +1513,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1564,28 +1564,28 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__15 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -1597,8 +1597,8 @@ ; AMDGPU: if.end: ; AMDGPU-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; AMDGPU-NEXT: br label [[RETURN]] ; AMDGPU: return: ; AMDGPU-NEXT: ret void @@ -1606,7 +1606,7 @@ ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -1618,8 +1618,8 @@ ; AMDGPU: if.end: ; AMDGPU-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; AMDGPU-NEXT: br label [[RETURN]] ; AMDGPU: return: ; AMDGPU-NEXT: ret void @@ -1627,7 +1627,7 @@ ; ; AMDGPU: Function Attrs: noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; AMDGPU-SAME: () #[[ATTR9:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR10:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8, addrspace(5) ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1666,38 +1666,38 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: noinline norecurse nounwind +; AMDGPU: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__16 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; AMDGPU-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@weak_callee_empty -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__17 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1710,17 +1710,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__18 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1733,23 +1733,23 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1757,13 +1757,13 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__19 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1776,7 +1776,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1790,8 +1790,8 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; NVPTX-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; NVPTX-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: @@ -1803,37 +1803,37 @@ ; NVPTX-NEXT: ret i32 0 ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__ -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; NVPTX-SAME: () #[[ATTR1:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR2:[0-9]+]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; NVPTX-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; NVPTX: omp_if.then: ; NVPTX-NEXT: store i32 0, ptr @G, align 4 -; NVPTX-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: br label [[OMP_IF_END]] ; NVPTX: omp_if.end: -; NVPTX-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -1898,35 +1898,35 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__2 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; NVPTX-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; NVPTX-NEXT: ret void ; ; @@ -1939,17 +1939,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1962,7 +1962,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -2022,41 +2022,41 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__4 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; NVPTX-SAME: () #[[ATTR6:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR7:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2064,13 +2064,13 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2083,23 +2083,23 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2159,34 +2159,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__6 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; NVPTX-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2199,17 +2199,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__8 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2222,7 +2222,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -2276,34 +2276,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__10 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2316,17 +2316,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__11 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2339,7 +2339,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -2393,34 +2393,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__12 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__13 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2433,17 +2433,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__14 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2456,7 +2456,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -2506,28 +2506,28 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__15 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; NVPTX-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -2539,8 +2539,8 @@ ; NVPTX: if.end: ; NVPTX-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; NVPTX-NEXT: br label [[RETURN]] ; NVPTX: return: ; NVPTX-NEXT: ret void @@ -2548,7 +2548,7 @@ ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -2560,8 +2560,8 @@ ; NVPTX: if.end: ; NVPTX-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; NVPTX-NEXT: br label [[RETURN]] ; NVPTX: return: ; NVPTX-NEXT: ret void @@ -2569,7 +2569,7 @@ ; ; NVPTX: Function Attrs: noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; NVPTX-SAME: () #[[ATTR9:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR10:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -2607,38 +2607,38 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: noinline norecurse nounwind +; NVPTX: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__16 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; NVPTX-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@weak_callee_empty -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__17 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2651,17 +2651,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__18 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2674,23 +2674,23 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2698,13 +2698,13 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__19 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2717,7 +2717,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -2731,8 +2731,8 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: @@ -2744,37 +2744,37 @@ ; AMDGPU-DISABLED-NEXT: ret i32 0 ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__ -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR2:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; AMDGPU-DISABLED-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; AMDGPU-DISABLED: omp_if.then: ; AMDGPU-DISABLED-NEXT: store i32 0, ptr @G, align 4 -; AMDGPU-DISABLED-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: br label [[OMP_IF_END]] ; AMDGPU-DISABLED: omp_if.end: -; AMDGPU-DISABLED-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR2]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -2799,35 +2799,35 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -2840,17 +2840,17 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -2863,7 +2863,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -2877,41 +2877,41 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__4 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR6:[0-9]+]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR7:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR2]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2919,13 +2919,13 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -2938,23 +2938,23 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR6]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR7]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR2]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2972,34 +2972,34 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__6 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-DISABLED-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3012,17 +3012,17 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3035,7 +3035,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3049,34 +3049,34 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__10 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3089,17 +3089,17 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__11 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3112,7 +3112,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3126,34 +3126,34 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__12 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__13 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3166,17 +3166,17 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__14 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3189,7 +3189,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3203,28 +3203,28 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__15 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -3236,8 +3236,8 @@ ; AMDGPU-DISABLED: if.end: ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: br label [[RETURN]] ; AMDGPU-DISABLED: return: ; AMDGPU-DISABLED-NEXT: ret void @@ -3245,7 +3245,7 @@ ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -3257,8 +3257,8 @@ ; AMDGPU-DISABLED: if.end: ; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; AMDGPU-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: br label [[RETURN]] ; AMDGPU-DISABLED: return: ; AMDGPU-DISABLED-NEXT: ret void @@ -3266,7 +3266,7 @@ ; ; AMDGPU-DISABLED: Function Attrs: noinline norecurse nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; AMDGPU-DISABLED-SAME: () #[[ATTR9:[0-9]+]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR10:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 @@ -3274,38 +3274,38 @@ ; AMDGPU-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: worker.exit: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__16 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; AMDGPU-DISABLED-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@weak_callee_empty -; AMDGPU-DISABLED-SAME: () #[[ATTR6]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR7]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__17 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3318,17 +3318,17 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__18 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3341,23 +3341,23 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; AMDGPU-DISABLED-SAME: () #[[ATTR6]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR7]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-DISABLED-NEXT: ret void ; ; ; AMDGPU-DISABLED: Function Attrs: convergent noinline nounwind ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; AMDGPU-DISABLED-SAME: () #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR2]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -3365,13 +3365,13 @@ ; AMDGPU-DISABLED-NEXT: ret void ; ; -; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__19 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3384,7 +3384,7 @@ ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-DISABLED-NEXT: ret void ; ; @@ -3398,8 +3398,8 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: @@ -3411,37 +3411,37 @@ ; NVPTX-DISABLED-NEXT: ret i32 0 ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__ -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR1:[0-9]+]] { +; NVPTX-DISABLED-SAME: () #[[ATTR2:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; NVPTX-DISABLED-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; NVPTX-DISABLED: omp_if.then: ; NVPTX-DISABLED-NEXT: store i32 0, ptr @G, align 4 -; NVPTX-DISABLED-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: br label [[OMP_IF_END]] ; NVPTX-DISABLED: omp_if.end: -; NVPTX-DISABLED-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR2]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -3466,35 +3466,35 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3507,17 +3507,17 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3530,7 +3530,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3544,41 +3544,41 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__4 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR6:[0-9]+]] { +; NVPTX-DISABLED-SAME: () #[[ATTR7:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR2]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -3586,13 +3586,13 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3605,23 +3605,23 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR6]] { +; NVPTX-DISABLED-SAME: () #[[ATTR7]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR2]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -3639,34 +3639,34 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__6 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-DISABLED-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3679,17 +3679,17 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3702,7 +3702,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3716,34 +3716,34 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__10 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3756,17 +3756,17 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__11 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3779,7 +3779,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3793,34 +3793,34 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__12 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-DISABLED-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__13 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3833,17 +3833,17 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__14 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3856,7 +3856,7 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3870,28 +3870,28 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__15 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; NVPTX-DISABLED-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -3903,8 +3903,8 @@ ; NVPTX-DISABLED: if.end: ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; NVPTX-DISABLED-NEXT: br label [[RETURN]] ; NVPTX-DISABLED: return: ; NVPTX-DISABLED-NEXT: ret void @@ -3912,7 +3912,7 @@ ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -3924,8 +3924,8 @@ ; NVPTX-DISABLED: if.end: ; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-DISABLED-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; NVPTX-DISABLED-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: br label [[RETURN]] ; NVPTX-DISABLED: return: ; NVPTX-DISABLED-NEXT: ret void @@ -3933,7 +3933,7 @@ ; ; NVPTX-DISABLED: Function Attrs: noinline norecurse nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; NVPTX-DISABLED-SAME: () #[[ATTR9:[0-9]+]] { +; NVPTX-DISABLED-SAME: () #[[ATTR10:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 @@ -3941,38 +3941,38 @@ ; NVPTX-DISABLED-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-DISABLED-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: worker.exit: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__16 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; NVPTX-DISABLED-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@weak_callee_empty -; NVPTX-DISABLED-SAME: () #[[ATTR6]] { +; NVPTX-DISABLED-SAME: () #[[ATTR7]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__17 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -3985,17 +3985,17 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__18 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -4008,23 +4008,23 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; NVPTX-DISABLED-SAME: () #[[ATTR6]] { +; NVPTX-DISABLED-SAME: () #[[ATTR7]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-DISABLED-NEXT: ret void ; ; ; NVPTX-DISABLED: Function Attrs: convergent noinline nounwind ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; NVPTX-DISABLED-SAME: () #[[ATTR1]] { +; NVPTX-DISABLED-SAME: () #[[ATTR2]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -4032,13 +4032,13 @@ ; NVPTX-DISABLED-NEXT: ret void ; ; -; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind +; NVPTX-DISABLED: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__19 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-DISABLED-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-DISABLED-NEXT: ret void ; ; @@ -4051,6 +4051,6 @@ ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-DISABLED-NEXT: ret void ; Index: llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll =================================================================== --- llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll +++ llvm/test/Transforms/OpenMP/custom_state_machines_pre_lto.ll @@ -842,45 +842,45 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; AMDGPU-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; AMDGPU-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__ -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; AMDGPU-SAME: () #[[ATTR1:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR2:[0-9]+]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; AMDGPU-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; AMDGPU: omp_if.then: ; AMDGPU-NEXT: store i32 0, ptr @G, align 4 -; AMDGPU-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: br label [[OMP_IF_END]] ; AMDGPU: omp_if.end: -; AMDGPU-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -905,35 +905,35 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__1 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__2 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; @@ -946,17 +946,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__3 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -969,7 +969,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -983,41 +983,41 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__4 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; AMDGPU-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; AMDGPU-SAME: () #[[ATTR6:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR7:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1025,13 +1025,13 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__5 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1044,23 +1044,23 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1078,34 +1078,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__6 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__7 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1118,17 +1118,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__8 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1141,7 +1141,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1155,34 +1155,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__9 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__10 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1195,17 +1195,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__11 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1218,7 +1218,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1232,34 +1232,34 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__12 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; AMDGPU-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__13 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1272,17 +1272,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__14 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p1() #[[ATTR12]] +; AMDGPU-NEXT: call void @p1() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1295,7 +1295,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1309,28 +1309,28 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__15 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; AMDGPU-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -1342,8 +1342,8 @@ ; AMDGPU: if.end: ; AMDGPU-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; AMDGPU-NEXT: br label [[RETURN]] ; AMDGPU: return: ; AMDGPU-NEXT: ret void @@ -1351,7 +1351,7 @@ ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -1363,8 +1363,8 @@ ; AMDGPU: if.end: ; AMDGPU-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; AMDGPU-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; AMDGPU-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; AMDGPU-NEXT: br label [[RETURN]] ; AMDGPU: return: ; AMDGPU-NEXT: ret void @@ -1372,7 +1372,7 @@ ; ; AMDGPU: Function Attrs: noinline norecurse nounwind ; AMDGPU-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; AMDGPU-SAME: () #[[ATTR9:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR10:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 @@ -1380,38 +1380,38 @@ ; AMDGPU-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; AMDGPU-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; AMDGPU-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; AMDGPU-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: ret void ; AMDGPU: worker.exit: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: noinline norecurse nounwind +; AMDGPU: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__16 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; AMDGPU-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@weak_callee_empty -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__17 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1424,17 +1424,17 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__18 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1447,23 +1447,23 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; AMDGPU-SAME: () #[[ATTR6]] { +; AMDGPU-SAME: () #[[ATTR7]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: ret void ; ; ; AMDGPU: Function Attrs: convergent noinline nounwind ; AMDGPU-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; AMDGPU-SAME: () #[[ATTR1]] { +; AMDGPU-SAME: () #[[ATTR2]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1471,13 +1471,13 @@ ; AMDGPU-NEXT: ret void ; ; -; AMDGPU: Function Attrs: convergent noinline norecurse nounwind +; AMDGPU: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__19 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; AMDGPU-NEXT: call void @p0() #[[ATTR12]] +; AMDGPU-NEXT: call void @p0() #[[ATTR15]] ; AMDGPU-NEXT: ret void ; ; @@ -1490,7 +1490,7 @@ ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; AMDGPU-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; AMDGPU-NEXT: ret void ; ; @@ -1504,45 +1504,45 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3:[0-9]+]] -; NVPTX-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4:[0-9]+]] +; NVPTX-NEXT: call void @__omp_outlined__(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13:[0-9]+]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__ -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10:[0-9]+]] -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11:[0-9]+]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12:[0-9]+]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14:[0-9]+]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here.internalized -; NVPTX-SAME: () #[[ATTR1:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR2:[0-9]+]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR3]] -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]]) #[[ATTR4]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0 ; NVPTX-NEXT: br i1 [[TMP2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_END:%.*]] ; NVPTX: omp_if.then: ; NVPTX-NEXT: store i32 0, ptr @G, align 4 -; NVPTX-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__kmpc_end_single(ptr @[[GLOB2]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: br label [[OMP_IF_END]] ; NVPTX: omp_if.end: -; NVPTX-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[TMP0]]) #[[ATTR4]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@no_parallel_region_in_here -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr @[[GLOB2]], i32 [[TMP0]]) @@ -1567,35 +1567,35 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__1(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__2, ptr @__omp_outlined__2_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__3, ptr @__omp_outlined__3_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__2 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12:[0-9]+]] +; NVPTX-NEXT: call void @p0() #[[ATTR15:[0-9]+]] ; NVPTX-NEXT: ret void ; ; @@ -1608,17 +1608,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__2(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__2(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1631,7 +1631,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -1645,41 +1645,41 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__4(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__4 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR10]] -; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_before.internalized() #[[ATTR12]] +; NVPTX-NEXT: call void @no_parallel_region_in_here.internalized() #[[ATTR12]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__5, ptr @__omp_outlined__5_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_after.internalized() #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before.internalized -; NVPTX-SAME: () #[[ATTR6:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR7:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__17, ptr @__omp_outlined__17_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_before -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1687,13 +1687,13 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1706,23 +1706,23 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after.internalized -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__18, ptr @__omp_outlined__18_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_after -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -1740,34 +1740,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__6(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__6 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__7, ptr @__omp_outlined__7_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR12]] +; NVPTX-NEXT: [[CALL:%.*]] = call i32 @unknown() #[[ATTR15]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__8, ptr @__omp_outlined__8_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1780,17 +1780,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__8 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1803,7 +1803,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__8(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -1817,34 +1817,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__9(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__10, ptr @__omp_outlined__10_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__11, ptr @__omp_outlined__11_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__10 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1857,17 +1857,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__10(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__10(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__11 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1880,7 +1880,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__11(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__11(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -1894,34 +1894,34 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__12(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__12(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__12 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS1:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR11]] +; NVPTX-NEXT: call void @unknown_no_openmp() #[[ATTR14]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__13, ptr @__omp_outlined__13_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 undef, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__14, ptr @__omp_outlined__14_wrapper, ptr [[CAPTURED_VARS_ADDRS1]], i64 0) ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__13 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1934,17 +1934,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__13(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__13(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__14 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p1() #[[ATTR12]] +; NVPTX-NEXT: call void @p1() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -1957,7 +1957,7 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__14(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__14(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; @@ -1971,28 +1971,28 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__15(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__15(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__15 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR12]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR10]] +; NVPTX-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[CALL]]) #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after.internalized -; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR6]] { +; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -2004,8 +2004,8 @@ ; NVPTX: if.end: ; NVPTX-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR10]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR10]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after.internalized(i32 [[SUB]]) #[[ATTR12]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after.internalized() #[[ATTR12]] ; NVPTX-NEXT: br label [[RETURN]] ; NVPTX: return: ; NVPTX-NEXT: ret void @@ -2013,7 +2013,7 @@ ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after -; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (i32 [[A:%.*]]) #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 @@ -2025,8 +2025,8 @@ ; NVPTX: if.end: ; NVPTX-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4 ; NVPTX-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP1]], 1 -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR12]] -; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR12]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after(i32 [[SUB]]) #[[ATTR15]] +; NVPTX-NEXT: call void @simple_state_machine_interprocedural_nested_recursive_after_after() #[[ATTR15]] ; NVPTX-NEXT: br label [[RETURN]] ; NVPTX: return: ; NVPTX-NEXT: ret void @@ -2034,7 +2034,7 @@ ; ; NVPTX: Function Attrs: noinline norecurse nounwind ; NVPTX-LABEL: define {{[^@]+}}@__omp_offloading_14_a36502b_no_state_machine_weak_callee_l112 -; NVPTX-SAME: () #[[ATTR9:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR10:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4 @@ -2042,38 +2042,38 @@ ; NVPTX-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; NVPTX-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR3]] -; NVPTX-NEXT: call void @__omp_outlined__16(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR4]] +; NVPTX-NEXT: call void @__omp_outlined__16(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: ret void ; NVPTX: worker.exit: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: noinline norecurse nounwind +; NVPTX: Function Attrs: noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__16 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR9]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR11:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @weak_callee_empty() #[[ATTR10]] +; NVPTX-NEXT: call void @weak_callee_empty() #[[ATTR12]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@weak_callee_empty -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__17 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2086,17 +2086,17 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__17(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__17(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__18 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2109,23 +2109,23 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__18(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__18(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after.internalized -; NVPTX-SAME: () #[[ATTR6]] { +; NVPTX-SAME: () #[[ATTR7]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3]] +; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__19, ptr @__omp_outlined__19_wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: ret void ; ; ; NVPTX: Function Attrs: convergent noinline nounwind ; NVPTX-LABEL: define {{[^@]+}}@simple_state_machine_interprocedural_nested_recursive_after_after -; NVPTX-SAME: () #[[ATTR1]] { +; NVPTX-SAME: () #[[ATTR2]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -2133,13 +2133,13 @@ ; NVPTX-NEXT: ret void ; ; -; NVPTX: Function Attrs: convergent noinline norecurse nounwind +; NVPTX: Function Attrs: convergent noinline norecurse nounwind memory(readwrite, argmem: none) ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__19 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR0]] { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; NVPTX-NEXT: call void @p0() #[[ATTR12]] +; NVPTX-NEXT: call void @p0() #[[ATTR15]] ; NVPTX-NEXT: ret void ; ; @@ -2152,6 +2152,6 @@ ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__19(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; NVPTX-NEXT: call void @__omp_outlined__19(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR13]] ; NVPTX-NEXT: ret void ; Index: llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll =================================================================== --- llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll +++ llvm/test/Transforms/OpenMP/get_hardware_num_threads_in_block_fold.ll @@ -31,7 +31,7 @@ ; CHECK-NEXT: call void @helper0() #[[ATTR1:[0-9]+]] ; CHECK-NEXT: call void @helper1() #[[ATTR1]] ; CHECK-NEXT: call void @helper2() #[[ATTR1]] -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; @@ -56,7 +56,7 @@ ; CHECK-NEXT: ret void ; CHECK: main.thread.user_code: ; CHECK-NEXT: call void @helper1() #[[ATTR1]] -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; @@ -84,7 +84,7 @@ ; CHECK-NEXT: call void @helper1() #[[ATTR1]] ; CHECK-NEXT: call void @helper2() #[[ATTR1]] ; CHECK-NEXT: call void @__kmpc_parallel_51(ptr null, i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; entry: Index: llvm/test/Transforms/OpenMP/heap-to-shared-missing-declarations.ll =================================================================== --- llvm/test/Transforms/OpenMP/heap-to-shared-missing-declarations.ll +++ llvm/test/Transforms/OpenMP/heap-to-shared-missing-declarations.ll @@ -18,7 +18,7 @@ } define internal void @func() { -; CHECK: Function Attrs: nosync nounwind +; CHECK: Function Attrs: nosync nounwind memory(write) ; CHECK-LABEL: define {{[^@]+}}@func ; CHECK-SAME: () #[[ATTR1]] { ; CHECK-NEXT: bb: @@ -35,14 +35,14 @@ define internal void @outlined1() { ; CHECK: Function Attrs: nosync nounwind ; CHECK-LABEL: define {{[^@]+}}@outlined1 -; CHECK-SAME: () #[[ATTR1]] { +; CHECK-SAME: () #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: bb: ; CHECK-NEXT: [[I:%.*]] = icmp sle i32 1, 0 ; CHECK-NEXT: br i1 [[I]], label [[BB1:%.*]], label [[BB2:%.*]] ; CHECK: common.ret: ; CHECK-NEXT: ret void ; CHECK: bb1: -; CHECK-NEXT: call void @func() #[[ATTR1]] +; CHECK-NEXT: call void @func() #[[ATTR2]] ; CHECK-NEXT: br label [[COMMON_RET:%.*]] ; CHECK: bb2: ; CHECK-NEXT: call void @__kmpc_free_shared(ptr null, i64 0) #[[ATTR0]] @@ -67,7 +67,7 @@ define void @user() { ; CHECK-LABEL: define {{[^@]+}}@user() { ; CHECK-NEXT: call void @outlined0() #[[ATTR0]] -; CHECK-NEXT: call void @outlined1() #[[ATTR1]] +; CHECK-NEXT: call void @outlined1() #[[ATTR2]] ; CHECK-NEXT: ret void ; call void @outlined0() @@ -84,7 +84,8 @@ !1 = !{i32 7, !"openmp-device", i32 50} ;. ; CHECK: attributes #[[ATTR0]] = { nounwind } -; CHECK: attributes #[[ATTR1]] = { nosync nounwind } +; CHECK: attributes #[[ATTR1]] = { nosync nounwind memory(write) } +; CHECK: attributes #[[ATTR2]] = { nosync nounwind } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} ; CHECK: [[META1:![0-9]+]] = !{i32 7, !"openmp-device", i32 50} Index: llvm/test/Transforms/OpenMP/is_spmd_exec_mode_fold.ll =================================================================== --- llvm/test/Transforms/OpenMP/is_spmd_exec_mode_fold.ll +++ llvm/test/Transforms/OpenMP/is_spmd_exec_mode_fold.ll @@ -30,7 +30,7 @@ ; CHECK-NEXT: call void @is_spmd_helper1() ; CHECK-NEXT: call void @is_spmd_helper2() ; CHECK-NEXT: call void @is_mixed_helper() -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 2, i1 false) @@ -55,7 +55,7 @@ ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr null) #[[ATTR3:[0-9]+]] ; CHECK-NEXT: call void @is_spmd_helper2() ; CHECK-NEXT: call void @__kmpc_parallel_51(ptr null, i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; entry: @@ -82,7 +82,7 @@ ; CHECK-NEXT: call void @is_generic_helper1() ; CHECK-NEXT: call void @is_generic_helper2() ; CHECK-NEXT: call void @is_mixed_helper() -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 1) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 1) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 1, i1 false) @@ -100,7 +100,7 @@ ; CHECK-NEXT: call void @is_generic_helper1() ; CHECK-NEXT: call void @is_generic_helper2() ; CHECK-NEXT: call void @is_mixed_helper() -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 1) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 1) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 1, i1 false) Index: llvm/test/Transforms/OpenMP/parallel_deletion.ll =================================================================== --- llvm/test/Transforms/OpenMP/parallel_deletion.ll +++ llvm/test/Transforms/OpenMP/parallel_deletion.ll @@ -49,7 +49,7 @@ ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.willreturn ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: call void @unknown() #[[ATTR14:[0-9]+]] +; CHECK-NEXT: call void @unknown() #[[ATTR16:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.willreturn @@ -93,7 +93,7 @@ ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.willreturn.1 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: call void @readnone() #[[ATTR14]] +; CHECK-NEXT: call void @readnone() #[[ATTR16]] ; CHECK-NEXT: ret void ; ; CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.willreturn.1 @@ -171,7 +171,7 @@ define internal void @.omp_outlined.(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined. -; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) { +; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @unknown() ; CHECK-NEXT: ret void @@ -193,7 +193,7 @@ define internal void @.omp_outlined..0(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..0 -; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR4:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR5:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @readonly() ; CHECK-NEXT: ret void @@ -215,7 +215,7 @@ define internal void @.omp_outlined..1(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1 -; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR5:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @readnone() ; CHECK-NEXT: ret void @@ -282,7 +282,7 @@ ; CHECK-LABEL: define {{[^@]+}}@delete_parallel_2() { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4 -; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 dereferenceable(4) [[A]]) #[[ATTR14]] +; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 dereferenceable(4) [[A]]) #[[ATTR16]] ; CHECK-NEXT: store i32 0, ptr [[A]], align 4 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]]) ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A]]) @@ -327,9 +327,9 @@ define internal void @.omp_outlined..3(ptr noalias %.global_tid., ptr noalias %.bound_tid., ptr dereferenceable(4) %a) { ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..3 -; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR6:[0-9]+]] { +; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR7:[0-9]+]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR9:[0-9]+]] +; CHECK-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR10:[0-9]+]] ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[CALL]], 0 ; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]] ; CHECK: if.then: @@ -457,7 +457,7 @@ ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..5 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) { ; CHECK-NEXT: entry: -; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull @[[GLOB0]]) #[[ATTR9]] +; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull readonly @[[GLOB0]]) #[[ATTR10]] ; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_single(ptr noundef nonnull @[[GLOB0]], i32 [[TMP]]) ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0 @@ -531,7 +531,7 @@ ; CHECK-NEXT: entry: ; CHECK-NEXT: [[A1:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8 -; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 [[A1]]) #[[ATTR15:[0-9]+]] +; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 [[A1]]) #[[ATTR16]] ; CHECK-NEXT: store i32 1, ptr [[A1]], align 4 ; CHECK-NEXT: store ptr [[A1]], ptr [[DOTOMP_REDUCTION_RED_LIST]], align 8 ; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4 @@ -644,7 +644,7 @@ define internal void @.omp.reduction.reduction_func(ptr %arg, ptr %arg1) { ; CHECK-LABEL: define {{[^@]+}}@.omp.reduction.reduction_func -; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #[[ATTR10:[0-9]+]] { +; CHECK-SAME: (ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[ARG:%.*]], ptr nocapture nofree noundef nonnull readonly align 8 dereferenceable(8) [[ARG1:%.*]]) #[[ATTR11:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP2:%.*]] = load ptr, ptr [[ARG1]], align 8 ; CHECK-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARG]], align 8 Index: llvm/test/Transforms/OpenMP/parallel_level_fold.ll =================================================================== --- llvm/test/Transforms/OpenMP/parallel_level_fold.ll +++ llvm/test/Transforms/OpenMP/parallel_level_fold.ll @@ -26,7 +26,7 @@ ; CHECK-NEXT: [[I:%.*]] = call i32 @__kmpc_target_init(ptr null, i8 1, i1 false) ; CHECK-NEXT: call void @none_spmd_helper() ; CHECK-NEXT: call void @mixed_helper() -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 1) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 1) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 1, i1 false) @@ -42,7 +42,7 @@ ; CHECK-NEXT: [[I:%.*]] = call i32 @__kmpc_target_init(ptr null, i8 2, i1 false) ; CHECK-NEXT: call void @spmd_helper() ; CHECK-NEXT: call void @mixed_helper() -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 2, i1 false) @@ -58,7 +58,7 @@ ; CHECK-NEXT: [[I:%.*]] = call i32 @__kmpc_target_init(ptr null, i8 2, i1 false) ; CHECK-NEXT: call void @spmd_helper() ; CHECK-NEXT: call void @__kmpc_parallel_51(ptr null, i32 0, i32 0, i32 0, i32 0, ptr null, ptr null, ptr null, i64 0) -; CHECK-NEXT: call void @__kmpc_target_deinit(ptr null, i8 2) +; CHECK-NEXT: call void @__kmpc_target_deinit(ptr readnone null, i8 2) ; CHECK-NEXT: ret void ; %i = call i32 @__kmpc_target_init(ptr null, i8 2, i1 false) Index: llvm/test/Transforms/OpenMP/parallel_region_merging.ll =================================================================== --- llvm/test/Transforms/OpenMP/parallel_region_merging.ll +++ llvm/test/Transforms/OpenMP/parallel_region_merging.ll @@ -4704,10 +4704,10 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[OMP_GLOBAL_THREAD_NUM]]) -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -4720,7 +4720,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined. -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4728,7 +4728,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..1 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4742,13 +4742,13 @@ ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1:[0-9]+]]) ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 ; CHECK2-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..2, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..3, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..2 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4756,7 +4756,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..3 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4770,13 +4770,13 @@ ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]]) ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 ; CHECK2-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..4, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..5, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..4 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4784,7 +4784,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..5 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4796,14 +4796,14 @@ ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..6, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: call void (...) @foo() -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..7, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..6 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4811,7 +4811,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..7 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4854,7 +4854,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -4866,7 +4866,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -4891,7 +4891,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..8 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4899,7 +4899,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..9 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -4907,7 +4907,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_float -; CHECK2-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr { +; CHECK2-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr, ptr }, align 8 ; CHECK2-NEXT: [[F_RELOADED:%.*]] = alloca float, align 4 @@ -4951,7 +4951,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_F_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_F_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -4963,7 +4963,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_F_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_F_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -4987,7 +4987,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..10 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4 ; CHECK2-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32 @@ -4996,7 +4996,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..11 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4 ; CHECK2-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32 @@ -5045,7 +5045,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5085,7 +5085,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..12 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5093,7 +5093,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..13 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) #[[ATTR4:[0-9]+]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32 ; CHECK2-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]]) @@ -5135,7 +5135,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5147,7 +5147,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5174,7 +5174,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..14 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5182,7 +5182,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..15 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5237,7 +5237,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5249,7 +5249,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_B]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_B]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5273,7 +5273,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..16 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5281,7 +5281,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..17 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5330,10 +5330,10 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]]) -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5346,7 +5346,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..18 -; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0 @@ -5360,7 +5360,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..19 -; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0 @@ -5420,7 +5420,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5432,7 +5432,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5457,7 +5457,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..20 -; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0 @@ -5471,7 +5471,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..21 -; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0 @@ -5518,13 +5518,13 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]]) -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5537,7 +5537,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..22 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5545,7 +5545,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..23 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5553,7 +5553,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..24 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5613,7 +5613,7 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5625,7 +5625,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM4]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) @@ -5637,7 +5637,7 @@ ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM6]]) ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]] ; CHECK2: omp.par.merged.split.split.split.split: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5673,7 +5673,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..25 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5681,7 +5681,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..26 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5689,7 +5689,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..27 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5701,16 +5701,16 @@ ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..28, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: call void (...) @foo() -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..29, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: call void (...) @foo() -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..30, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..28 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5718,7 +5718,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..29 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5726,7 +5726,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..30 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5739,15 +5739,15 @@ ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]]) ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..31, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..32, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..33, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..31 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5755,7 +5755,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..32 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5763,7 +5763,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..33 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5776,15 +5776,15 @@ ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]]) ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4 -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..34, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..35, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..36, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..34 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5792,7 +5792,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..35 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5800,7 +5800,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..36 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5826,7 +5826,7 @@ ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]] ; CHECK2: entry.split.split: ; CHECK2-NEXT: call void (...) @foo() -; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]]) +; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef readonly @.omp_outlined..39, ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[A_ADDR]]) ; CHECK2-NEXT: ret void ; ; @@ -5843,10 +5843,10 @@ ; CHECK2: omp.par.region: ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]] ; CHECK2: omp.par.merged: -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]]) -; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) +; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[LOADGEP_A_ADDR]]) ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]] ; CHECK2: entry.split: ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]] @@ -5859,7 +5859,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..37 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5867,7 +5867,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..38 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) @@ -5875,7 +5875,7 @@ ; ; ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..39 -; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) { +; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR1]] { ; CHECK2-NEXT: entry: ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4 ; CHECK2-NEXT: call void @use(i32 [[TMP0]]) Index: llvm/test/Transforms/OpenMP/reduced_pointer_info_assertion.ll =================================================================== --- llvm/test/Transforms/OpenMP/reduced_pointer_info_assertion.ll +++ llvm/test/Transforms/OpenMP/reduced_pointer_info_assertion.ll @@ -38,9 +38,9 @@ ; ; ; CGSCC-LABEL: define {{[^@]+}}@rec -; CGSCC-SAME: (ptr nocapture writeonly [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { +; CGSCC-SAME: (ptr writeonly [[TMP0:%.*]], i64 [[TMP1:%.*]]) #[[ATTR0:[0-9]+]] { ; CGSCC-NEXT: [[TMP3:%.*]] = getelementptr i32, ptr [[TMP0]], i64 [[TMP1]] ; CGSCC-NEXT: store i32 0, ptr [[TMP3]], align 4 -; CGSCC-NEXT: call fastcc void @rec(ptr nocapture writeonly [[TMP0]], i64 0) #[[ATTR1:[0-9]+]] +; CGSCC-NEXT: call fastcc void @rec(ptr writeonly [[TMP0]], i64 0) #[[ATTR0]] ; CGSCC-NEXT: ret void ; Index: llvm/test/Transforms/OpenMP/remove_globalization.ll =================================================================== --- llvm/test/Transforms/OpenMP/remove_globalization.ll +++ llvm/test/Transforms/OpenMP/remove_globalization.ll @@ -95,7 +95,7 @@ ; CHECK-SAME: () #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[TMP0:%.*]] = call align 4 ptr @__kmpc_alloc_shared(i64 4) #[[ATTR5:[0-9]+]], !dbg [[DBG8:![0-9]+]] -; CHECK-NEXT: call void @share(ptr nofree [[TMP0]]) #[[ATTR1]], !dbg [[DBG8]] +; CHECK-NEXT: call void @share(ptr nofree readnone [[TMP0]]) #[[ATTR1]], !dbg [[DBG8]] ; CHECK-NEXT: call void @__kmpc_free_shared(ptr [[TMP0]], i64 4) #[[ATTR5]] ; CHECK-NEXT: ret void ; @@ -103,7 +103,7 @@ ; CHECK-DISABLED-SAME: () #[[ATTR1]] { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: [[TMP0:%.*]] = call align 4 ptr @__kmpc_alloc_shared(i64 4) #[[ATTR5:[0-9]+]], !dbg [[DBG8:![0-9]+]] -; CHECK-DISABLED-NEXT: call void @share(ptr nofree [[TMP0]]) #[[ATTR1]], !dbg [[DBG8]] +; CHECK-DISABLED-NEXT: call void @share(ptr nofree readnone [[TMP0]]) #[[ATTR6:[0-9]+]], !dbg [[DBG8]] ; CHECK-DISABLED-NEXT: call void @__kmpc_free_shared(ptr [[TMP0]], i64 4) #[[ATTR5]] ; CHECK-DISABLED-NEXT: ret void ; @@ -121,13 +121,13 @@ define internal void @share(ptr %x) { ; CHECK-LABEL: define {{[^@]+}}@share -; CHECK-SAME: (ptr nofree [[X:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (ptr nofree readnone [[X:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store ptr [[X]], ptr @S, align 8 ; CHECK-NEXT: ret void ; ; CHECK-DISABLED-LABEL: define {{[^@]+}}@share -; CHECK-DISABLED-SAME: (ptr nofree [[X:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-DISABLED-SAME: (ptr nofree readnone [[X:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-DISABLED-NEXT: entry: ; CHECK-DISABLED-NEXT: store ptr [[X]], ptr @S, align 8 ; CHECK-DISABLED-NEXT: ret void @@ -257,17 +257,18 @@ ;. ; CHECK: attributes #[[ATTR0]] = { "kernel" } ; CHECK: attributes #[[ATTR1]] = { nosync nounwind } -; CHECK: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(write) } +; CHECK: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind allocsize(0) } ; CHECK: attributes #[[ATTR4:[0-9]+]] = { "llvm.assume"="omp_no_openmp" } ; CHECK: attributes #[[ATTR5]] = { nounwind } ;. ; CHECK-DISABLED: attributes #[[ATTR0]] = { "kernel" } ; CHECK-DISABLED: attributes #[[ATTR1]] = { nosync nounwind } -; CHECK-DISABLED: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(write) } +; CHECK-DISABLED: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ; CHECK-DISABLED: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind allocsize(0) } ; CHECK-DISABLED: attributes #[[ATTR4:[0-9]+]] = { "llvm.assume"="omp_no_openmp" } ; CHECK-DISABLED: attributes #[[ATTR5]] = { nounwind } +; CHECK-DISABLED: attributes #[[ATTR6]] = { nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "remove_globalization.c", directory: "/tmp/remove_globalization.c") Index: llvm/test/Transforms/OpenMP/replace_globalization.ll =================================================================== --- llvm/test/Transforms/OpenMP/replace_globalization.ll +++ llvm/test/Transforms/OpenMP/replace_globalization.ll @@ -144,7 +144,7 @@ ; CHECK-NEXT: [[C:%.*]] = call i32 @__kmpc_target_init(ptr @[[GLOB1]], i8 1, i1 false) ; CHECK-NEXT: [[X:%.*]] = call align 4 ptr @__kmpc_alloc_shared(i64 4) #[[ATTR6:[0-9]+]] ; CHECK-NEXT: call void @unknown_no_openmp() -; CHECK-NEXT: call void @use.internalized(ptr nofree [[X]]) #[[ATTR3:[0-9]+]] +; CHECK-NEXT: call void @use.internalized(ptr nofree readnone [[X]]) #[[ATTR3:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_free_shared(ptr [[X]], i64 4) #[[ATTR6]] ; CHECK-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; CHECK-NEXT: ret void @@ -157,14 +157,14 @@ ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[C]], -1 ; CHECK-NEXT: br i1 [[CMP]], label [[MASTER1:%.*]], label [[EXIT:%.*]] ; CHECK: master1: -; CHECK-NEXT: call void @use.internalized(ptr nofree addrspacecast (ptr addrspace(3) @x_shared to ptr)) #[[ATTR3]] +; CHECK-NEXT: call void @use.internalized(ptr nofree readnone addrspacecast (ptr addrspace(3) @x_shared to ptr)) #[[ATTR7:[0-9]+]] ; CHECK-NEXT: br label [[NEXT:%.*]] ; CHECK: next: ; CHECK-NEXT: call void @unknown_no_openmp() ; CHECK-NEXT: [[B0:%.*]] = icmp eq i32 [[C]], -1 ; CHECK-NEXT: br i1 [[B0]], label [[MASTER2:%.*]], label [[EXIT]] ; CHECK: master2: -; CHECK-NEXT: call void @use.internalized(ptr nofree addrspacecast (ptr addrspace(3) @y_shared to ptr)) #[[ATTR3]] +; CHECK-NEXT: call void @use.internalized(ptr nofree readnone addrspacecast (ptr addrspace(3) @y_shared to ptr)) #[[ATTR3]] ; CHECK-NEXT: br label [[EXIT]] ; CHECK: exit: ; CHECK-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) @@ -179,7 +179,7 @@ ; CHECK-NEXT: br i1 [[C0]], label [[MASTER3:%.*]], label [[EXIT:%.*]] ; CHECK: master3: ; CHECK-NEXT: [[Z:%.*]] = call align 4 ptr @__kmpc_alloc_shared(i64 24) #[[ATTR6]], !dbg [[DBG10:![0-9]+]] -; CHECK-NEXT: call void @use.internalized(ptr nofree [[Z]]) #[[ATTR3]] +; CHECK-NEXT: call void @use.internalized(ptr nofree readnone [[Z]]) #[[ATTR3]] ; CHECK-NEXT: call void @__kmpc_free_shared(ptr [[Z]], i64 24) #[[ATTR6]] ; CHECK-NEXT: br label [[EXIT]] ; CHECK: exit: @@ -187,9 +187,9 @@ ; CHECK-NEXT: ret void ; ; -; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(write) +; CHECK: Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@use.internalized -; CHECK-SAME: (ptr nofree [[X:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-SAME: (ptr nofree readnone [[X:%.*]]) #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: store ptr [[X]], ptr @S, align 8 ; CHECK-NEXT: ret void @@ -202,7 +202,7 @@ ; CHECK-NEXT: ret void ; ; -; CHECK: Function Attrs: norecurse nosync nounwind allocsize(0) memory(read) +; CHECK: Function Attrs: norecurse nosync nounwind allocsize(0) memory(read, inaccessiblemem: none) ; CHECK-LABEL: define {{[^@]+}}@__kmpc_alloc_shared ; CHECK-SAME: (i64 [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: [[L:%.*]] = load i32, ptr @offset, align 4 @@ -216,12 +216,13 @@ ; ;. ; CHECK: attributes #[[ATTR0]] = { "kernel" } -; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind memory(write) } -; CHECK: attributes #[[ATTR2]] = { norecurse nosync nounwind allocsize(0) memory(read) } +; CHECK: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } +; CHECK: attributes #[[ATTR2]] = { norecurse nosync nounwind allocsize(0) memory(read, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR3]] = { nosync nounwind } ; CHECK: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } ; CHECK: attributes #[[ATTR5:[0-9]+]] = { "llvm.assume"="omp_no_openmp" } ; CHECK: attributes #[[ATTR6]] = { nounwind } +; CHECK: attributes #[[ATTR7]] = { nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) ; CHECK: [[META1:![0-9]+]] = !DIFile(filename: "replace_globalization.c", directory: "/tmp/replace_globalization.c") Index: llvm/test/Transforms/OpenMP/spmdization.ll =================================================================== --- llvm/test/Transforms/OpenMP/spmdization.ll +++ llvm/test/Transforms/OpenMP/spmdization.ll @@ -229,9 +229,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5:[0-9]+]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7:[0-9]+]] ; AMDGPU-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; AMDGPU-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR15:[0-9]+]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -246,9 +246,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5:[0-9]+]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7:[0-9]+]] ; NVPTX-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; NVPTX-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR15:[0-9]+]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -300,9 +300,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5:[0-9]+]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7:[0-9]+]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR15:[0-9]+]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -353,9 +353,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5:[0-9]+]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7:[0-9]+]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18:![0-9]+]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR15:[0-9]+]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -381,7 +381,7 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__ -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: br label [[FOR_COND:%.*]] @@ -390,7 +390,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR8:[0-9]+]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR10:[0-9]+]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -399,7 +399,7 @@ ; AMDGPU-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP22:![0-9]+]] ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__ -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-NEXT: br label [[FOR_COND:%.*]] @@ -408,7 +408,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR8:[0-9]+]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR10:[0-9]+]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -417,7 +417,7 @@ ; NVPTX-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP22:![0-9]+]] ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__ -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND:%.*]] @@ -426,7 +426,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -435,7 +435,7 @@ ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP22:![0-9]+]] ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__ -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; NVPTX-DISABLED-NEXT: br label [[FOR_COND:%.*]] @@ -444,7 +444,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -475,27 +475,27 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__1(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__1 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR11:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] +; NVPTX-NEXT: call void @unknown() #[[ATTR11:[0-9]+]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR11:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR11:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -506,43 +506,43 @@ ; Function Attrs: convergent norecurse nounwind define internal void @__omp_outlined__1_wrapper(i16 zeroext %0, i32 %1) #3 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper -; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__1(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16:[0-9]+]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper -; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__1(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16:[0-9]+]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper -; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16:[0-9]+]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__1_wrapper -; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__1(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16:[0-9]+]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -569,9 +569,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__2(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__2(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -586,9 +586,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__2(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__2(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -640,9 +640,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__2(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -693,9 +693,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__2(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -721,19 +721,19 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__2(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__2 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[X_H2S:%.*]] = alloca i8, i64 4, align 4, addrspace(5) ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[X_H2S]] to ptr -; AMDGPU-NEXT: call void @use(ptr nocapture [[MALLOC_CAST]]) #[[ATTR8]] +; AMDGPU-NEXT: call void @use(ptr nocapture [[MALLOC_CAST]]) #[[ATTR10]] ; AMDGPU-NEXT: br label [[FOR_COND:%.*]] ; AMDGPU: for.cond: ; AMDGPU-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -742,18 +742,18 @@ ; AMDGPU-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__2 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[X_H2S:%.*]] = alloca i8, i64 4, align 4 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-NEXT: call void @use(ptr nocapture [[X_H2S]]) #[[ATTR8]] +; NVPTX-NEXT: call void @use(ptr nocapture [[X_H2S]]) #[[ATTR10]] ; NVPTX-NEXT: br label [[FOR_COND:%.*]] ; NVPTX: for.cond: ; NVPTX-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -762,19 +762,19 @@ ; NVPTX-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[X_H2S:%.*]] = alloca i8, i64 4, align 4, addrspace(5) ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: [[MALLOC_CAST:%.*]] = addrspacecast ptr addrspace(5) [[X_H2S]] to ptr -; AMDGPU-DISABLED-NEXT: call void @use(ptr nocapture [[MALLOC_CAST]]) #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @use(ptr nocapture [[MALLOC_CAST]]) #[[ATTR10]] ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND:%.*]] ; AMDGPU-DISABLED: for.cond: ; AMDGPU-DISABLED-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -783,18 +783,18 @@ ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__2 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[X_H2S:%.*]] = alloca i8, i64 4, align 4 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; NVPTX-DISABLED-NEXT: call void @use(ptr nocapture [[X_H2S]]) #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @use(ptr nocapture [[X_H2S]]) #[[ATTR10]] ; NVPTX-DISABLED-NEXT: br label [[FOR_COND:%.*]] ; NVPTX-DISABLED: for.cond: ; NVPTX-DISABLED-NEXT: [[I_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_BODY:%.*]] ] ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4, !tbaa [[TBAA18]] @@ -827,27 +827,27 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__3(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__3 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -858,43 +858,43 @@ ; Function Attrs: convergent norecurse nounwind define internal void @__omp_outlined__3_wrapper(i16 zeroext %0, i32 %1) #3 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper -; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper -; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper -; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__3_wrapper -; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__3(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -922,9 +922,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__4(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -939,9 +939,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__4(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -993,9 +993,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__4(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1046,9 +1046,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__4(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1074,7 +1074,7 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__4(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__4 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; AMDGPU-NEXT: br label [[FOR_COND:%.*]] @@ -1083,7 +1083,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26:![0-9]+]] @@ -1093,7 +1093,7 @@ ; AMDGPU-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__4 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; NVPTX-NEXT: br label [[FOR_COND:%.*]] @@ -1102,7 +1102,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26:![0-9]+]] @@ -1112,7 +1112,7 @@ ; NVPTX-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__4 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND:%.*]] @@ -1121,7 +1121,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26:![0-9]+]] @@ -1131,7 +1131,7 @@ ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__4 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; NVPTX-DISABLED-NEXT: br label [[FOR_COND:%.*]] @@ -1140,7 +1140,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26:![0-9]+]] @@ -1175,39 +1175,39 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__5(ptr noalias %.global_tid., ptr noalias %.bound_tid., ptr nonnull align 4 dereferenceable(4) %x) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__5 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-DISABLED-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-DISABLED-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1221,7 +1221,7 @@ ; Function Attrs: convergent norecurse nounwind define internal void @__omp_outlined__5_wrapper(i16 zeroext %0, i32 %1) #3 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper -; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1229,11 +1229,11 @@ ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; AMDGPU-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; AMDGPU-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; AMDGPU-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper -; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1241,11 +1241,11 @@ ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; NVPTX-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; NVPTX-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; NVPTX-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper -; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1253,11 +1253,11 @@ ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__5_wrapper -; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1265,7 +1265,7 @@ ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__5(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1294,9 +1294,9 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__6(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -1311,9 +1311,9 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__6(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -1365,9 +1365,9 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__6(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1418,9 +1418,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__6(ptr readonly [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1446,7 +1446,7 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__6(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__6 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; AMDGPU-NEXT: br label [[REGION_CHECK_TID:%.*]] @@ -1469,7 +1469,7 @@ ; AMDGPU-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU: for.cond.cleanup: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-NEXT: ret void ; AMDGPU: for.body: ; AMDGPU-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared.1 to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26]] @@ -1479,7 +1479,7 @@ ; AMDGPU-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP29:![0-9]+]] ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__6 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; NVPTX-NEXT: br label [[REGION_CHECK_TID:%.*]] @@ -1502,7 +1502,7 @@ ; NVPTX-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX: for.cond.cleanup: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-NEXT: ret void ; NVPTX: for.body: ; NVPTX-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared1 to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26]] @@ -1512,7 +1512,7 @@ ; NVPTX-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP29:![0-9]+]] ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__6 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; AMDGPU-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; AMDGPU-DISABLED-NEXT: store i32 42, ptr addrspacecast (ptr addrspace(3) @x_shared.1 to ptr), align 4, !tbaa [[TBAA18]] @@ -1522,7 +1522,7 @@ ; AMDGPU-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; AMDGPU-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; AMDGPU-DISABLED: for.cond.cleanup: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: for.body: ; AMDGPU-DISABLED-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared.1 to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26]] @@ -1532,7 +1532,7 @@ ; AMDGPU-DISABLED-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP29:![0-9]+]] ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__6 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { +; NVPTX-DISABLED-SAME: (ptr noalias readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [1 x ptr], align 8 ; NVPTX-DISABLED-NEXT: store i32 42, ptr addrspacecast (ptr addrspace(3) @x_shared1 to ptr), align 4, !tbaa [[TBAA18]] @@ -1542,7 +1542,7 @@ ; NVPTX-DISABLED-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_0]], 100 ; NVPTX-DISABLED-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP:%.*]] ; NVPTX-DISABLED: for.cond.cleanup: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: for.body: ; NVPTX-DISABLED-NEXT: store ptr addrspacecast (ptr addrspace(3) @x_shared1 to ptr), ptr [[CAPTURED_VARS_ADDRS]], align 8, !tbaa [[TBAA26]] @@ -1578,39 +1578,39 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__7(ptr noalias %.global_tid., ptr noalias %.bound_tid., ptr nonnull align 4 dereferenceable(4) %x) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__7 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR9]] +; AMDGPU-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR11]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR9]] +; NVPTX-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR11]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; AMDGPU-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; AMDGPU-DISABLED-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; AMDGPU-DISABLED-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR9]] +; AMDGPU-DISABLED-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR11]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]], ptr nonnull align 4 dereferenceable(4) [[X:%.*]]) { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[TMP0:%.*]] = load i32, ptr [[X]], align 4, !tbaa [[TBAA18]] ; NVPTX-DISABLED-NEXT: [[INC:%.*]] = add nsw i32 [[TMP0]], 1 ; NVPTX-DISABLED-NEXT: store i32 [[INC]], ptr [[X]], align 4, !tbaa [[TBAA18]] -; NVPTX-DISABLED-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR9]] +; NVPTX-DISABLED-NEXT: call void @unknowni32p(ptr [[X]]) #[[ATTR11]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1624,7 +1624,7 @@ ; Function Attrs: convergent norecurse nounwind define internal void @__omp_outlined__7_wrapper(i16 zeroext %0, i32 %1) #3 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper -; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1632,11 +1632,11 @@ ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; AMDGPU-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; AMDGPU-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; AMDGPU-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper -; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1644,11 +1644,11 @@ ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; NVPTX-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; NVPTX-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; NVPTX-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper -; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1656,11 +1656,11 @@ ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__7_wrapper -; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 @@ -1668,7 +1668,7 @@ ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) ; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ARGS]], align 8 ; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = load ptr, ptr [[TMP2]], align 8, !tbaa [[TBAA26]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__7(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]], ptr [[TMP3]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1728,8 +1728,8 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; AMDGPU-NEXT: call void @__omp_outlined__8(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; AMDGPU-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; @@ -1774,8 +1774,8 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; NVPTX-NEXT: call void @__omp_outlined__8(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; NVPTX-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: br label [[COMMON_RET]] ; @@ -1821,8 +1821,8 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1867,8 +1867,8 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__8(ptr readnone [[DOTTHREADID_TEMP_]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] ; @@ -1894,27 +1894,27 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__8(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__8 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__8 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__8 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -1925,7 +1925,7 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define weak void @__omp_offloading_fd02_2044372e_do_not_spmdize_task_l74() #0 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_offloading_fd02_2044372e_do_not_spmdize_task_l74 -; AMDGPU-SAME: () #[[ATTR3:[0-9]+]] { +; AMDGPU-SAME: () #[[ATTR5:[0-9]+]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8, addrspace(5) ; AMDGPU-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 @@ -1971,15 +1971,15 @@ ; AMDGPU: common.ret: ; AMDGPU-NEXT: ret void ; AMDGPU: user_code.entry: -; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; AMDGPU-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR5]] -; AMDGPU-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR5]] +; AMDGPU-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; AMDGPU-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR7]] +; AMDGPU-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR7]] ; AMDGPU-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__9, ptr @__omp_outlined__9_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-NEXT: br label [[COMMON_RET]] ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_offloading_fd02_2044372e_do_not_spmdize_task_l74 -; NVPTX-SAME: () #[[ATTR3:[0-9]+]] { +; NVPTX-SAME: () #[[ATTR5:[0-9]+]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 @@ -2024,15 +2024,15 @@ ; NVPTX: common.ret: ; NVPTX-NEXT: ret void ; NVPTX: user_code.entry: -; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; NVPTX-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR5]] -; NVPTX-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR5]] +; NVPTX-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; NVPTX-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR7]] +; NVPTX-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR7]] ; NVPTX-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__9, ptr @__omp_outlined__9_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-NEXT: br label [[COMMON_RET]] ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_offloading_fd02_2044372e_do_not_spmdize_task_l74 -; AMDGPU-DISABLED-SAME: () #[[ATTR3:[0-9]+]] { +; AMDGPU-DISABLED-SAME: () #[[ATTR5:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8, addrspace(5) ; AMDGPU-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 @@ -2078,15 +2078,15 @@ ; AMDGPU-DISABLED: common.ret: ; AMDGPU-DISABLED-NEXT: ret void ; AMDGPU-DISABLED: user_code.entry: -; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR5]] -; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR7]] +; AMDGPU-DISABLED-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR7]] ; AMDGPU-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__9, ptr @__omp_outlined__9_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; AMDGPU-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; AMDGPU-DISABLED-NEXT: br label [[COMMON_RET]] ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_offloading_fd02_2044372e_do_not_spmdize_task_l74 -; NVPTX-DISABLED-SAME: () #[[ATTR3:[0-9]+]] { +; NVPTX-DISABLED-SAME: () #[[ATTR5:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[WORKER_WORK_FN_ADDR:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 @@ -2131,9 +2131,9 @@ ; NVPTX-DISABLED: common.ret: ; NVPTX-DISABLED-NEXT: ret void ; NVPTX-DISABLED: user_code.entry: -; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR5]] -; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR5]] -; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]]) #[[ATTR7]] +; NVPTX-DISABLED-NEXT: [[TMP2:%.*]] = call ptr @__kmpc_omp_task_alloc(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i64 40, i64 0, ptr @"_omp_task_entry$") #[[ATTR7]] +; NVPTX-DISABLED-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_omp_task(ptr @[[GLOB1]], i32 [[TMP1]], ptr [[TMP2]]) #[[ATTR7]] ; NVPTX-DISABLED-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP1]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__9, ptr @__omp_outlined__9_wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; NVPTX-DISABLED-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; NVPTX-DISABLED-NEXT: br label [[COMMON_RET]] @@ -2159,27 +2159,27 @@ ; Function Attrs: alwaysinline convergent nounwind define internal void @.omp_outlined.(i32 %.global_tid., ptr noalias %.part_id., ptr noalias %.privates., ptr noalias %.copy_fn., ptr %.task_t., ptr noalias %__context) #9 { ; AMDGPU-LABEL: define {{[^@]+}}@.omp_outlined. -; AMDGPU-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTPART_ID_:%.*]], ptr noalias [[DOTPRIVATES_:%.*]], ptr noalias [[DOTCOPY_FN_:%.*]], ptr [[DOTTASK_T_:%.*]], ptr noalias [[__CONTEXT:%.*]]) #[[ATTR4:[0-9]+]] { +; AMDGPU-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTPART_ID_:%.*]], ptr noalias readnone [[DOTPRIVATES_:%.*]], ptr noalias readnone [[DOTCOPY_FN_:%.*]], ptr readnone [[DOTTASK_T_:%.*]], ptr noalias readnone [[__CONTEXT:%.*]]) #[[ATTR6:[0-9]+]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@.omp_outlined. -; NVPTX-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTPART_ID_:%.*]], ptr noalias [[DOTPRIVATES_:%.*]], ptr noalias [[DOTCOPY_FN_:%.*]], ptr [[DOTTASK_T_:%.*]], ptr noalias [[__CONTEXT:%.*]]) #[[ATTR4:[0-9]+]] { +; NVPTX-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTPART_ID_:%.*]], ptr noalias readnone [[DOTPRIVATES_:%.*]], ptr noalias readnone [[DOTCOPY_FN_:%.*]], ptr readnone [[DOTTASK_T_:%.*]], ptr noalias readnone [[__CONTEXT:%.*]]) #[[ATTR6:[0-9]+]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@.omp_outlined. -; AMDGPU-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTPART_ID_:%.*]], ptr noalias [[DOTPRIVATES_:%.*]], ptr noalias [[DOTCOPY_FN_:%.*]], ptr [[DOTTASK_T_:%.*]], ptr noalias [[__CONTEXT:%.*]]) #[[ATTR4:[0-9]+]] { +; AMDGPU-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTPART_ID_:%.*]], ptr noalias readnone [[DOTPRIVATES_:%.*]], ptr noalias readnone [[DOTCOPY_FN_:%.*]], ptr readnone [[DOTTASK_T_:%.*]], ptr noalias readnone [[__CONTEXT:%.*]]) #[[ATTR6:[0-9]+]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; AMDGPU-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@.omp_outlined. -; NVPTX-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTPART_ID_:%.*]], ptr noalias [[DOTPRIVATES_:%.*]], ptr noalias [[DOTCOPY_FN_:%.*]], ptr [[DOTTASK_T_:%.*]], ptr noalias [[__CONTEXT:%.*]]) #[[ATTR4:[0-9]+]] { +; NVPTX-DISABLED-SAME: (i32 [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTPART_ID_:%.*]], ptr noalias readnone [[DOTPRIVATES_:%.*]], ptr noalias readnone [[DOTCOPY_FN_:%.*]], ptr readnone [[DOTTASK_T_:%.*]], ptr noalias readnone [[__CONTEXT:%.*]]) #[[ATTR6:[0-9]+]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR8]] +; NVPTX-DISABLED-NEXT: call void @spmd_amenable() #[[ATTR10]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2259,27 +2259,27 @@ ; Function Attrs: alwaysinline convergent norecurse nounwind define internal void @__omp_outlined__9(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__9 -; AMDGPU-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-NEXT: entry: -; AMDGPU-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9 -; NVPTX-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-NEXT: entry: -; NVPTX-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 -; AMDGPU-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; AMDGPU-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; AMDGPU-DISABLED-NEXT: entry: -; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; AMDGPU-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9 -; NVPTX-DISABLED-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; NVPTX-DISABLED-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR3]] { ; NVPTX-DISABLED-NEXT: entry: -; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR9]] +; NVPTX-DISABLED-NEXT: call void @unknown() #[[ATTR11]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2290,43 +2290,43 @@ ; Function Attrs: convergent norecurse nounwind define internal void @__omp_outlined__9_wrapper(i16 zeroext %0, i32 %1) #3 { ; AMDGPU-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper -; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-NEXT: entry: ; AMDGPU-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-NEXT: call void @__omp_outlined__9(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-NEXT: ret void ; ; NVPTX-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper -; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-NEXT: entry: ; NVPTX-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-NEXT: call void @__omp_outlined__9(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-NEXT: ret void ; ; AMDGPU-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper -; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; AMDGPU-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; AMDGPU-DISABLED-NEXT: entry: ; AMDGPU-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; AMDGPU-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; AMDGPU-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; AMDGPU-DISABLED-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; AMDGPU-DISABLED-NEXT: ret void ; ; NVPTX-DISABLED-LABEL: define {{[^@]+}}@__omp_outlined__9_wrapper -; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2]] { +; NVPTX-DISABLED-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR4]] { ; NVPTX-DISABLED-NEXT: entry: ; NVPTX-DISABLED-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; NVPTX-DISABLED-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; NVPTX-DISABLED-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR5]] +; NVPTX-DISABLED-NEXT: call void @__omp_outlined__9(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR16]] ; NVPTX-DISABLED-NEXT: ret void ; entry: @@ -2396,59 +2396,75 @@ ;. ; AMDGPU: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind "kernel" } ; AMDGPU: attributes #[[ATTR1]] = { norecurse } -; AMDGPU: attributes #[[ATTR2]] = { convergent norecurse nounwind } -; AMDGPU: attributes #[[ATTR3]] = { alwaysinline norecurse nounwind "kernel" } -; AMDGPU: attributes #[[ATTR4]] = { alwaysinline convergent nounwind } -; AMDGPU: attributes #[[ATTR5]] = { nounwind } -; AMDGPU: attributes #[[ATTR6:[0-9]+]] = { nosync nounwind } -; AMDGPU: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind allocsize(0) } -; AMDGPU: attributes #[[ATTR8]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; AMDGPU: attributes #[[ATTR9]] = { convergent } -; AMDGPU: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; AMDGPU: attributes #[[ATTR11:[0-9]+]] = { alwaysinline } -; AMDGPU: attributes #[[ATTR12:[0-9]+]] = { convergent nounwind } +; AMDGPU: attributes #[[ATTR2]] = { norecurse memory(readwrite, argmem: read) } +; AMDGPU: attributes #[[ATTR3]] = { memory(readwrite, argmem: none) } +; AMDGPU: attributes #[[ATTR4]] = { convergent norecurse nounwind } +; AMDGPU: attributes #[[ATTR5]] = { alwaysinline norecurse nounwind "kernel" } +; AMDGPU: attributes #[[ATTR6]] = { alwaysinline convergent nounwind memory(readwrite, argmem: none) } +; AMDGPU: attributes #[[ATTR7]] = { nounwind } +; AMDGPU: attributes #[[ATTR8:[0-9]+]] = { nosync nounwind } +; AMDGPU: attributes #[[ATTR9:[0-9]+]] = { nofree nosync nounwind allocsize(0) } +; AMDGPU: attributes #[[ATTR10]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; AMDGPU: attributes #[[ATTR11]] = { convergent } +; AMDGPU: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; AMDGPU: attributes #[[ATTR13:[0-9]+]] = { alwaysinline } +; AMDGPU: attributes #[[ATTR14:[0-9]+]] = { convergent nounwind } +; AMDGPU: attributes #[[ATTR15]] = { nounwind memory(readwrite, argmem: read) } +; AMDGPU: attributes #[[ATTR16]] = { nounwind memory(readwrite, argmem: none) } ;. ; NVPTX: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind "kernel" } ; NVPTX: attributes #[[ATTR1]] = { norecurse } -; NVPTX: attributes #[[ATTR2]] = { convergent norecurse nounwind } -; NVPTX: attributes #[[ATTR3]] = { alwaysinline norecurse nounwind "kernel" } -; NVPTX: attributes #[[ATTR4]] = { alwaysinline convergent nounwind } -; NVPTX: attributes #[[ATTR5]] = { nounwind } -; NVPTX: attributes #[[ATTR6:[0-9]+]] = { nosync nounwind } -; NVPTX: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind allocsize(0) } -; NVPTX: attributes #[[ATTR8]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; NVPTX: attributes #[[ATTR9]] = { convergent } -; NVPTX: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; NVPTX: attributes #[[ATTR11:[0-9]+]] = { alwaysinline } -; NVPTX: attributes #[[ATTR12:[0-9]+]] = { convergent nounwind } +; NVPTX: attributes #[[ATTR2]] = { norecurse memory(readwrite, argmem: read) } +; NVPTX: attributes #[[ATTR3]] = { memory(readwrite, argmem: none) } +; NVPTX: attributes #[[ATTR4]] = { convergent norecurse nounwind } +; NVPTX: attributes #[[ATTR5]] = { alwaysinline norecurse nounwind "kernel" } +; NVPTX: attributes #[[ATTR6]] = { alwaysinline convergent nounwind memory(readwrite, argmem: none) } +; NVPTX: attributes #[[ATTR7]] = { nounwind } +; NVPTX: attributes #[[ATTR8:[0-9]+]] = { nosync nounwind } +; NVPTX: attributes #[[ATTR9:[0-9]+]] = { nofree nosync nounwind allocsize(0) } +; NVPTX: attributes #[[ATTR10]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; NVPTX: attributes #[[ATTR11]] = { convergent } +; NVPTX: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; NVPTX: attributes #[[ATTR13:[0-9]+]] = { alwaysinline } +; NVPTX: attributes #[[ATTR14:[0-9]+]] = { convergent nounwind } +; NVPTX: attributes #[[ATTR15]] = { nounwind memory(readwrite, argmem: read) } +; NVPTX: attributes #[[ATTR16]] = { nounwind memory(readwrite, argmem: none) } ;. ; AMDGPU-DISABLED: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind "kernel" } ; AMDGPU-DISABLED: attributes #[[ATTR1]] = { norecurse } -; AMDGPU-DISABLED: attributes #[[ATTR2]] = { convergent norecurse nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR3]] = { alwaysinline norecurse nounwind "kernel" } -; AMDGPU-DISABLED: attributes #[[ATTR4]] = { alwaysinline convergent nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR5]] = { nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR6:[0-9]+]] = { nosync nounwind } -; AMDGPU-DISABLED: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind allocsize(0) } -; AMDGPU-DISABLED: attributes #[[ATTR8]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; AMDGPU-DISABLED: attributes #[[ATTR9]] = { convergent } -; AMDGPU-DISABLED: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; AMDGPU-DISABLED: attributes #[[ATTR11:[0-9]+]] = { alwaysinline } -; AMDGPU-DISABLED: attributes #[[ATTR12:[0-9]+]] = { convergent nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR2]] = { norecurse memory(readwrite, argmem: read) } +; AMDGPU-DISABLED: attributes #[[ATTR3]] = { memory(readwrite, argmem: none) } +; AMDGPU-DISABLED: attributes #[[ATTR4]] = { convergent norecurse nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR5]] = { alwaysinline norecurse nounwind "kernel" } +; AMDGPU-DISABLED: attributes #[[ATTR6]] = { alwaysinline convergent nounwind memory(readwrite, argmem: none) } +; AMDGPU-DISABLED: attributes #[[ATTR7]] = { nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR8:[0-9]+]] = { nosync nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR9:[0-9]+]] = { nofree nosync nounwind allocsize(0) } +; AMDGPU-DISABLED: attributes #[[ATTR10]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; AMDGPU-DISABLED: attributes #[[ATTR11]] = { convergent } +; AMDGPU-DISABLED: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; AMDGPU-DISABLED: attributes #[[ATTR13:[0-9]+]] = { alwaysinline } +; AMDGPU-DISABLED: attributes #[[ATTR14:[0-9]+]] = { convergent nounwind } +; AMDGPU-DISABLED: attributes #[[ATTR15]] = { nounwind memory(readwrite, argmem: read) } +; AMDGPU-DISABLED: attributes #[[ATTR16]] = { nounwind memory(readwrite, argmem: none) } ;. ; NVPTX-DISABLED: attributes #[[ATTR0]] = { alwaysinline convergent norecurse nounwind "kernel" } ; NVPTX-DISABLED: attributes #[[ATTR1]] = { norecurse } -; NVPTX-DISABLED: attributes #[[ATTR2]] = { convergent norecurse nounwind } -; NVPTX-DISABLED: attributes #[[ATTR3]] = { alwaysinline norecurse nounwind "kernel" } -; NVPTX-DISABLED: attributes #[[ATTR4]] = { alwaysinline convergent nounwind } -; NVPTX-DISABLED: attributes #[[ATTR5]] = { nounwind } -; NVPTX-DISABLED: attributes #[[ATTR6:[0-9]+]] = { nosync nounwind } -; NVPTX-DISABLED: attributes #[[ATTR7:[0-9]+]] = { nofree nosync nounwind allocsize(0) } -; NVPTX-DISABLED: attributes #[[ATTR8]] = { convergent "llvm.assume"="ompx_spmd_amenable" } -; NVPTX-DISABLED: attributes #[[ATTR9]] = { convergent } -; NVPTX-DISABLED: attributes #[[ATTR10:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -; NVPTX-DISABLED: attributes #[[ATTR11:[0-9]+]] = { alwaysinline } -; NVPTX-DISABLED: attributes #[[ATTR12:[0-9]+]] = { convergent nounwind } +; NVPTX-DISABLED: attributes #[[ATTR2]] = { norecurse memory(readwrite, argmem: read) } +; NVPTX-DISABLED: attributes #[[ATTR3]] = { memory(readwrite, argmem: none) } +; NVPTX-DISABLED: attributes #[[ATTR4]] = { convergent norecurse nounwind } +; NVPTX-DISABLED: attributes #[[ATTR5]] = { alwaysinline norecurse nounwind "kernel" } +; NVPTX-DISABLED: attributes #[[ATTR6]] = { alwaysinline convergent nounwind memory(readwrite, argmem: none) } +; NVPTX-DISABLED: attributes #[[ATTR7]] = { nounwind } +; NVPTX-DISABLED: attributes #[[ATTR8:[0-9]+]] = { nosync nounwind } +; NVPTX-DISABLED: attributes #[[ATTR9:[0-9]+]] = { nofree nosync nounwind allocsize(0) } +; NVPTX-DISABLED: attributes #[[ATTR10]] = { convergent "llvm.assume"="ompx_spmd_amenable" } +; NVPTX-DISABLED: attributes #[[ATTR11]] = { convergent } +; NVPTX-DISABLED: attributes #[[ATTR12:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +; NVPTX-DISABLED: attributes #[[ATTR13:[0-9]+]] = { alwaysinline } +; NVPTX-DISABLED: attributes #[[ATTR14:[0-9]+]] = { convergent nounwind } +; NVPTX-DISABLED: attributes #[[ATTR15]] = { nounwind memory(readwrite, argmem: read) } +; NVPTX-DISABLED: attributes #[[ATTR16]] = { nounwind memory(readwrite, argmem: none) } ;. ; AMDGPU: [[META0:![0-9]+]] = !{i32 0, i32 64770, i32 541341486, !"do_not_spmdize_task", i32 74, i32 5} ; AMDGPU: [[META1:![0-9]+]] = !{i32 0, i32 64770, i32 541341486, !"sequential_loop_to_stack_var", i32 20, i32 1} Index: llvm/test/Transforms/OpenMP/spmdization_constant_prop.ll =================================================================== --- llvm/test/Transforms/OpenMP/spmdization_constant_prop.ll +++ llvm/test/Transforms/OpenMP/spmdization_constant_prop.ll @@ -3,7 +3,7 @@ ; Verify we change it to SPMD mode but also avoid propagating the old mode (=generic) into the __kmpc_target_init function. ; ; CHECK-NOT: store i32 0, ptr addrspace(3) @IsSPMDMode -; CHECK: call i32 @__kmpc_target_init(ptr addrspacecast (ptr addrspace(1) @1 to ptr), i8 2, i1 false) +; CHECK: call i32 @__kmpc_target_init(ptr readnone addrspacecast (ptr addrspace(1) @1 to ptr), i8 2, i1 false) ; CHECK-NOT: store i32 0, ptr addrspace(3) @IsSPMDMode ; CHECK: store i32 1, ptr addrspace(3) @IsSPMDMode ; CHECK-NOT: store i32 0, ptr addrspace(3) @IsSPMDMode Index: llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll =================================================================== --- llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll +++ llvm/test/Transforms/OpenMP/spmdization_guarding_two_reaching_kernels.ll @@ -70,7 +70,7 @@ ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK: user_code.entry: -; CHECK-NEXT: call void @spmd_helper() #[[ATTR6:[0-9]+]] +; CHECK-NEXT: call void @spmd_helper() #[[ATTR7:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; CHECK-NEXT: ret void ; CHECK: worker.exit: @@ -117,7 +117,7 @@ ; CHECK-DISABLE-SPMDIZATION-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-DISABLE-SPMDIZATION-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK-DISABLE-SPMDIZATION: user_code.entry: -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @spmd_helper() #[[ATTR6:[0-9]+]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @spmd_helper() #[[ATTR7:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; CHECK-DISABLE-SPMDIZATION: worker.exit: @@ -167,7 +167,7 @@ ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK: user_code.entry: -; CHECK-NEXT: call void @generic_helper() #[[ATTR7:[0-9]+]] +; CHECK-NEXT: call void @generic_helper() #[[ATTR8:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 2) ; CHECK-NEXT: ret void ; CHECK: worker.exit: @@ -180,7 +180,7 @@ ; CHECK-DISABLE-SPMDIZATION-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 ; CHECK-DISABLE-SPMDIZATION-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] ; CHECK-DISABLE-SPMDIZATION: user_code.entry: -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @generic_helper() #[[ATTR7:[0-9]+]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @generic_helper() #[[ATTR8:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_target_deinit(ptr @[[GLOB1]], i8 1) ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; CHECK-DISABLE-SPMDIZATION: worker.exit: @@ -206,8 +206,8 @@ ; CHECK-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; CHECK-NEXT: call void @leaf() #[[ATTR7]] -; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3:[0-9]+]] +; CHECK-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4:[0-9]+]] ; CHECK-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; CHECK-NEXT: ret void ; @@ -215,8 +215,8 @@ ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR1:[0-9]+]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR7]] -; CHECK-DISABLE-SPMDIZATION-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3:[0-9]+]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-DISABLE-SPMDIZATION-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR4:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper.ID, ptr [[CAPTURED_VARS_ADDRS]], i64 0) ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; @@ -231,19 +231,19 @@ ; Function Attrs: convergent noinline norecurse nounwind define internal void @__omp_outlined__(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; CHECK-LABEL: define {{[^@]+}}@__omp_outlined__ -; CHECK-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; CHECK-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; CHECK-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; CHECK-NEXT: call void @unknown() #[[ATTR8:[0-9]+]] +; CHECK-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined__ -; CHECK-DISABLE-SPMDIZATION-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { +; CHECK-DISABLE-SPMDIZATION-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @unknown() #[[ATTR8:[0-9]+]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @unknown() #[[ATTR9:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -258,25 +258,25 @@ ; Function Attrs: convergent noinline norecurse nounwind define internal void @__omp_outlined___wrapper(i16 zeroext %0, i32 %1) #2 { ; CHECK-LABEL: define {{[^@]+}}@__omp_outlined___wrapper -; CHECK-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[DOTADDR:%.*]] = alloca i16, align 2 ; CHECK-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; CHECK-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; CHECK-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; CHECK-NEXT: call void @__omp_outlined__(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR10:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined___wrapper -; CHECK-DISABLE-SPMDIZATION-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-DISABLE-SPMDIZATION-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR3:[0-9]+]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTADDR:%.*]] = alloca i16, align 2 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__omp_outlined__(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR10:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -303,7 +303,7 @@ ; Function Attrs: convergent noinline nounwind define internal void @leaf() #1 { ; CHECK-LABEL: define {{[^@]+}}@leaf -; CHECK-SAME: () #[[ATTR5:[0-9]+]] { +; CHECK-SAME: () #[[ATTR6:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: br label [[REGION_CHECK_TID:%.*]] ; CHECK: region.check.tid: @@ -322,7 +322,7 @@ ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@leaf -; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR5:[0-9]+]] { +; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR6:[0-9]+]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: store i32 42, ptr @G, align 4 ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void @@ -335,15 +335,15 @@ ; Function Attrs: convergent noinline nounwind define internal void @generic_helper() #1 { ; CHECK-LABEL: define {{[^@]+}}@generic_helper -; CHECK-SAME: () #[[ATTR5]] { +; CHECK-SAME: () #[[ATTR6]] { ; CHECK-NEXT: entry: -; CHECK-NEXT: call void @leaf() #[[ATTR7]] +; CHECK-NEXT: call void @leaf() #[[ATTR11:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@generic_helper -; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR5]] { +; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR6]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR7]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR11:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -378,23 +378,29 @@ ;. ; CHECK: attributes #[[ATTR0]] = { noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR2]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR3]] = { nounwind } -; CHECK: attributes #[[ATTR4:[0-9]+]] = { alwaysinline } -; CHECK: attributes #[[ATTR5]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR6]] = { convergent nounwind } -; CHECK: attributes #[[ATTR7]] = { convergent nosync nounwind } -; CHECK: attributes #[[ATTR8]] = { convergent } +; CHECK: attributes #[[ATTR2]] = { memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR3]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK: attributes #[[ATTR4]] = { nounwind } +; CHECK: attributes #[[ATTR5:[0-9]+]] = { alwaysinline } +; CHECK: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write, inaccessiblemem: none) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK: attributes #[[ATTR7]] = { convergent nounwind } +; CHECK: attributes #[[ATTR8]] = { convergent nosync nounwind memory(write, inaccessiblemem: none) } +; CHECK: attributes #[[ATTR9]] = { convergent } +; CHECK: attributes #[[ATTR10]] = { nounwind memory(readwrite, argmem: none) } +; CHECK: attributes #[[ATTR11]] = { convergent nosync nounwind } ;. ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR0]] = { noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR2]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR3]] = { nounwind } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR4:[0-9]+]] = { alwaysinline } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR5]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR6]] = { convergent nounwind } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR7]] = { convergent nosync nounwind } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR8]] = { convergent } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR2]] = { memory(readwrite, argmem: none) } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR3]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR4]] = { nounwind } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR5:[0-9]+]] = { alwaysinline } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write, inaccessiblemem: none) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR7]] = { convergent nounwind } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR8]] = { convergent nosync nounwind memory(write, inaccessiblemem: none) } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR9]] = { convergent } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR10]] = { nounwind memory(readwrite, argmem: none) } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR11]] = { convergent nosync nounwind } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} ; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1} Index: llvm/test/Transforms/OpenMP/spmdization_no_guarding_two_reaching_kernels.ll =================================================================== --- llvm/test/Transforms/OpenMP/spmdization_no_guarding_two_reaching_kernels.ll +++ llvm/test/Transforms/OpenMP/spmdization_no_guarding_two_reaching_kernels.ll @@ -285,19 +285,19 @@ ; Function Attrs: convergent noinline norecurse nounwind define internal void @__omp_outlined__(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { ; CHECK-LABEL: define {{[^@]+}}@__omp_outlined__ -; CHECK-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; CHECK-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; CHECK-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-NEXT: call void @leaf() #[[ATTR9:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined__ -; CHECK-DISABLE-SPMDIZATION-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { +; CHECK-DISABLE-SPMDIZATION-SAME: (ptr noalias readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias readnone [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR9:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -319,7 +319,7 @@ ; CHECK-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; CHECK-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; CHECK-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; CHECK-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR8]] +; CHECK-NEXT: call void @__omp_outlined__(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR10:[0-9]+]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined___wrapper @@ -330,7 +330,7 @@ ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 ; CHECK-DISABLE-SPMDIZATION-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR8]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__omp_outlined__(ptr readnone [[DOTADDR1]], ptr readnone [[DOTZERO_ADDR]]) #[[ATTR10:[0-9]+]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -381,14 +381,14 @@ ; CHECK-SAME: () #[[ATTR1]] { ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @unknown() -; CHECK-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-NEXT: call void @leaf() #[[ATTR9]] ; CHECK-NEXT: ret void ; ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@generic_helper ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR1]] { ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @unknown() -; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR8]] +; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR9]] ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void ; entry: @@ -422,23 +422,27 @@ ;. ; CHECK: attributes #[[ATTR0]] = { noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK: attributes #[[ATTR2]] = { norecurse nosync memory(write) } +; CHECK: attributes #[[ATTR2]] = { norecurse nosync memory(write, argmem: none, inaccessiblemem: none) } ; CHECK: attributes #[[ATTR3]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK: attributes #[[ATTR4]] = { nounwind } ; CHECK: attributes #[[ATTR5:[0-9]+]] = { alwaysinline } -; CHECK: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write, inaccessiblemem: none) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK: attributes #[[ATTR7]] = { convergent nounwind } -; CHECK: attributes #[[ATTR8]] = { nosync nounwind } +; CHECK: attributes #[[ATTR8]] = { nosync nounwind memory(write, inaccessiblemem: none) } +; CHECK: attributes #[[ATTR9]] = { nosync nounwind } +; CHECK: attributes #[[ATTR10]] = { nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ;. ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR0]] = { noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR2]] = { norecurse nosync memory(write) } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR2]] = { norecurse nosync memory(write, argmem: none, inaccessiblemem: none) } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR3]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR4]] = { nounwind } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR5:[0-9]+]] = { alwaysinline } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR6]] = { noinline nosync nounwind memory(write, inaccessiblemem: none) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR7]] = { convergent nounwind } -; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR8]] = { nosync nounwind } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR8]] = { nosync nounwind memory(write, inaccessiblemem: none) } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR9]] = { nosync nounwind } +; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR10]] = { nosync nounwind memory(write, argmem: none, inaccessiblemem: none) } ;. ; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} ; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1}