[Attributor] Port AANonNull to the isImpliedByIR interface
AANonNull is now the first AA that is always queried via the new APIs
and not created manually. Others will follow shortly to avoid trivial
AAs whenever possible.
This commit introduced some helper logic that will make it simpler to
port the next one. It also untangles AADereferenceable and AANonNull
such that the former does not keep a handle on the latter. Finally,
we stop deducing `nonnull` for `undef`, which was incorrect.
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 193d1be..f9ce417 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -522,7 +522,10 @@
iterator child_begin() { return iterator(Deps.begin(), &DepGetVal); }
iterator child_end() { return iterator(Deps.end(), &DepGetVal); }
- virtual void print(raw_ostream &OS) const { OS << "AADepNode Impl\n"; }
+ void print(raw_ostream &OS) const { print(nullptr, OS); }
+ virtual void print(Attributor *, raw_ostream &OS) const {
+ OS << "AADepNode Impl\n";
+ }
DepSetTy &getDeps() { return Deps; }
friend struct Attributor;
@@ -1883,6 +1886,11 @@
bool ForceReplace = false);
private:
+ /// Helper to check \p Attrs for \p AK, if not found, check if \p
+ /// AAType::isImpliedByIR is true, and if not, create AAType for \p IRP.
+ template <Attribute::AttrKind AK, typename AAType>
+ void checkAndQueryIRAttr(const IRPosition &IRP, AttributeSet Attrs);
+
/// Helper to apply \p CB on all attributes of type \p AttrDescs of \p IRP.
template <typename DescTy>
ChangeStatus updateAttrMap(const IRPosition &IRP,
@@ -3118,12 +3126,24 @@
struct IRAttribute : public BaseType {
IRAttribute(const IRPosition &IRP) : BaseType(IRP) {}
+ /// Compile time access to the IR attribute kind.
+ static constexpr Attribute::AttrKind IRAttributeKind = AK;
+
+ /// Return true if the IR attribute(s) associated with this AA are implied for
+ /// an undef value.
+ static bool isImpliedByUndef() { return true; }
+
+ /// Return true if the IR attribute(s) associated with this AA are implied for
+ /// an poison value.
+ static bool isImpliedByPoison() { return true; }
+
static bool isImpliedByIR(Attributor &A, const IRPosition &IRP,
Attribute::AttrKind ImpliedAttributeKind = AK,
- bool IgnoreSubsumingPositions = false,
- bool RequiresPoison = false) {
- if (RequiresPoison ? isa<PoisonValue>(IRP.getAssociatedValue())
- : isa<UndefValue>(IRP.getAssociatedValue()))
+ bool IgnoreSubsumingPositions = false) {
+ if (AAType::isImpliedByUndef() && isa<UndefValue>(IRP.getAssociatedValue()))
+ return true;
+ if (AAType::isImpliedByPoison() &&
+ isa<PoisonValue>(IRP.getAssociatedValue()))
return true;
return A.hasAttr(IRP, {ImpliedAttributeKind}, IgnoreSubsumingPositions,
ImpliedAttributeKind);
@@ -3143,7 +3163,7 @@
if (isa<UndefValue>(this->getIRPosition().getAssociatedValue()))
return ChangeStatus::UNCHANGED;
SmallVector<Attribute, 4> DeducedAttrs;
- getDeducedAttributes(this->getAnchorValue().getContext(), DeducedAttrs);
+ getDeducedAttributes(A, this->getAnchorValue().getContext(), DeducedAttrs);
if (DeducedAttrs.empty())
return ChangeStatus::UNCHANGED;
return A.manifestAttrs(this->getIRPosition(), DeducedAttrs);
@@ -3153,7 +3173,7 @@
Attribute::AttrKind getAttrKind() const { return AK; }
/// Return the deduced attributes in \p Attrs.
- virtual void getDeducedAttributes(LLVMContext &Ctx,
+ virtual void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const {
Attrs.emplace_back(Attribute::get(Ctx, getAttrKind()));
}
@@ -3276,12 +3296,13 @@
/// Helper functions, for debug purposes only.
///{
- void print(raw_ostream &OS) const override;
+ void print(raw_ostream &OS) const { print(nullptr, OS); }
+ void print(Attributor *, raw_ostream &OS) const override;
virtual void printWithDeps(raw_ostream &OS) const;
- void dump() const { print(dbgs()); }
+ void dump() const { this->print(dbgs()); }
/// This function should return the "summarized" assumed state as string.
- virtual const std::string getAsStr() const = 0;
+ virtual const std::string getAsStr(Attributor *A) const = 0;
/// This function should return the name of the AbstractAttribute
virtual const std::string getName() const = 0;
@@ -3538,6 +3559,11 @@
AANonNull> {
AANonNull(const IRPosition &IRP, Attributor &A) : IRAttribute(IRP) {}
+ /// See IRAttribute::isImpliedByUndef.
+ /// Undef is not necessarily nonnull as nonnull + noundef would cause poison.
+ /// Poison implies nonnull though.
+ static bool isImpliedByUndef() { return false; }
+
/// See AbstractAttribute::isValidIRPositionForInit
static bool isValidIRPositionForInit(Attributor &A, const IRPosition &IRP) {
if (!IRP.getAssociatedType()->isPtrOrPtrVectorTy())
@@ -3545,6 +3571,11 @@
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
+ /// See AbstractAttribute::isImpliedByIR(...).
+ static bool isImpliedByIR(Attributor &A, const IRPosition &IRP,
+ Attribute::AttrKind ImpliedAttributeKind,
+ bool IgnoreSubsumingPositions = false);
+
/// Return true if we assume that the underlying value is nonnull.
bool isAssumedNonNull() const { return getAssumed(); }
@@ -4085,9 +4116,6 @@
GlobalState |= R.GlobalState;
return *this;
}
-
-protected:
- const AANonNull *NonNullAA = nullptr;
};
/// An abstract interface for all dereferenceable attribute.
@@ -4104,16 +4132,6 @@
return IRAttribute::isValidIRPositionForInit(A, IRP);
}
- /// Return true if we assume that the underlying value is nonnull.
- bool isAssumedNonNull() const {
- return NonNullAA && NonNullAA->isAssumedNonNull();
- }
-
- /// Return true if we know that the underlying value is nonnull.
- bool isKnownNonNull() const {
- return NonNullAA && NonNullAA->isKnownNonNull();
- }
-
/// Return true if we assume that underlying value is
/// dereferenceable(_or_null) globally.
bool isAssumedGlobal() const { return GlobalState.getAssumed(); }
@@ -4726,8 +4744,8 @@
static AAMemoryLocation &createForPosition(const IRPosition &IRP,
Attributor &A);
- /// See AbstractState::getAsStr().
- const std::string getAsStr() const override {
+ /// See AbstractState::getAsStr(Attributor).
+ const std::string getAsStr(Attributor *A) const override {
return getMemoryLocationsAsStr(getAssumedNotAccessedLocation());
}
@@ -6013,6 +6031,7 @@
CASE(NoRecurse, AANoRecurse, );
CASE(NoSync, AANoSync, );
CASE(NoAlias, AANoAlias, );
+ CASE(NonNull, AANonNull, );
CASE(MustProgress, AAMustProgress, );
CASE(ReadNone, AAMemoryBehavior, AAMemoryBehavior::NO_ACCESSES);
CASE(ReadOnly, AAMemoryBehavior, AAMemoryBehavior::NO_WRITES);
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
index 887978e..8d87a22 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
@@ -377,7 +377,7 @@
return true;
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
return "AMDWorkGroupSize[" + std::to_string(getAssumed()) + "]";
}
@@ -530,7 +530,7 @@
/* ForceReplace */ true);
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
std::string Str;
raw_string_ostream OS(Str);
OS << "AMDInfo[";
@@ -737,7 +737,7 @@
/* ForceReplace */ true);
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
std::string Str;
raw_string_ostream OS(Str);
OS << getName() << '[';
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 632c710..964c392 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -3223,6 +3223,16 @@
}
}
+template <Attribute::AttrKind AK, typename AAType>
+void Attributor::checkAndQueryIRAttr(const IRPosition &IRP,
+ AttributeSet Attrs) {
+ bool IsKnown;
+ if (!Attrs.hasAttribute(AK))
+ if (!AA::hasAssumedIRAttr<AK>(*this, nullptr, IRP, DepClassTy::NONE,
+ IsKnown))
+ getOrCreateAAFor<AAType>(IRP);
+}
+
void Attributor::identifyDefaultAbstractAttributes(Function &F) {
if (!VisitedFunctions.insert(&F).second)
return;
@@ -3310,6 +3320,7 @@
getOrCreateAAFor<AAReturnedValues>(FPos);
IRPosition RetPos = IRPosition::returned(F);
+ AttributeSet RetAttrs = Attrs.getRetAttrs();
// Every returned value might be dead.
getOrCreateAAFor<AAIsDead>(RetPos);
@@ -3329,8 +3340,7 @@
getOrCreateAAFor<AAAlign>(RetPos);
// Every function with pointer return type might be marked nonnull.
- if (!Attrs.hasRetAttr(Attribute::NonNull))
- getOrCreateAAFor<AANonNull>(RetPos);
+ checkAndQueryIRAttr<Attribute::NonNull, AANonNull>(RetPos, RetAttrs);
// Every function with pointer return type might be marked noalias.
if (!Attrs.hasRetAttr(Attribute::NoAlias))
@@ -3347,6 +3357,7 @@
for (Argument &Arg : F.args()) {
IRPosition ArgPos = IRPosition::argument(Arg);
auto ArgNo = Arg.getArgNo();
+ AttributeSet ArgAttrs = Attrs.getParamAttrs(ArgNo);
// Every argument might be simplified. We have to go through the
// Attributor interface though as outside AAs can register custom
@@ -3364,8 +3375,7 @@
if (Arg.getType()->isPointerTy()) {
// Every argument with pointer type might be marked nonnull.
- if (!Attrs.hasParamAttr(ArgNo, Attribute::NonNull))
- getOrCreateAAFor<AANonNull>(ArgPos);
+ checkAndQueryIRAttr<Attribute::NonNull, AANonNull>(ArgPos, ArgAttrs);
// Every argument with pointer type might be marked noalias.
if (!Attrs.hasParamAttr(ArgNo, Attribute::NoAlias))
@@ -3432,10 +3442,11 @@
getOrCreateAAFor<AANoFPClass>(CBInstPos);
}
- const AttributeList &CBAttrList = CBFnPos.getAttrList();
+ const AttributeList &CBAttrs = CBFnPos.getAttrList();
for (int I = 0, E = CB.arg_size(); I < E; ++I) {
IRPosition CBArgPos = IRPosition::callsite_argument(CB, I);
+ AttributeSet CBArgAttrs = CBAttrs.getParamAttrs(I);
// Every call site argument might be dead.
getOrCreateAAFor<AAIsDead>(CBArgPos);
@@ -3448,7 +3459,7 @@
AA::Intraprocedural);
// Every call site argument might be marked "noundef".
- if (!CBAttrList.hasParamAttr(I, Attribute::NoUndef))
+ if (!CBAttrs.hasParamAttr(I, Attribute::NoUndef))
getOrCreateAAFor<AANoUndef>(CBArgPos);
Type *ArgTy = CB.getArgOperand(I)->getType();
@@ -3461,15 +3472,14 @@
}
// Call site argument attribute "non-null".
- if (!CBAttrList.hasParamAttr(I, Attribute::NonNull))
- getOrCreateAAFor<AANonNull>(CBArgPos);
+ checkAndQueryIRAttr<Attribute::NonNull, AANonNull>(CBArgPos, CBArgAttrs);
// Call site argument attribute "nocapture".
- if (!CBAttrList.hasParamAttr(I, Attribute::NoCapture))
+ if (!CBAttrs.hasParamAttr(I, Attribute::NoCapture))
getOrCreateAAFor<AANoCapture>(CBArgPos);
// Call site argument attribute "no-alias".
- if (!CBAttrList.hasParamAttr(I, Attribute::NoAlias))
+ if (!CBAttrs.hasParamAttr(I, Attribute::NoAlias))
getOrCreateAAFor<AANoAlias>(CBArgPos);
// Call site argument attribute "dereferenceable".
@@ -3480,11 +3490,11 @@
// Call site argument attribute
// "readnone/readonly/writeonly/..."
- if (!CBAttrList.hasParamAttr(I, Attribute::ReadNone))
+ if (!CBAttrs.hasParamAttr(I, Attribute::ReadNone))
getOrCreateAAFor<AAMemoryBehavior>(CBArgPos);
// Call site argument attribute "nofree".
- if (!CBAttrList.hasParamAttr(I, Attribute::NoFree))
+ if (!CBAttrs.hasParamAttr(I, Attribute::NoFree))
getOrCreateAAFor<AANoFree>(CBArgPos);
}
return true;
@@ -3619,7 +3629,7 @@
return OS;
}
-void AbstractAttribute::print(raw_ostream &OS) const {
+void AbstractAttribute::print(Attributor *A, raw_ostream &OS) const {
OS << "[";
OS << getName();
OS << "] for CtxI ";
@@ -3631,7 +3641,7 @@
} else
OS << "<<null inst>>";
- OS << " at position " << getIRPosition() << " with state " << getAsStr()
+ OS << " at position " << getIRPosition() << " with state " << getAsStr(A)
<< '\n';
}
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 0c2f399..3cc9618 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -375,7 +375,8 @@
/// Clamp the information known for all returned values of a function
/// (identified by \p QueryingAA) into \p S.
-template <typename AAType, typename StateType = typename AAType::StateType>
+template <typename AAType, typename StateType = typename AAType::StateType,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
static void clampReturnedValueStates(
Attributor &A, const AAType &QueryingAA, StateType &S,
const IRPosition::CallBaseContext *CBContext = nullptr) {
@@ -396,12 +397,19 @@
// Callback for each possibly returned value.
auto CheckReturnValue = [&](Value &RV) -> bool {
const IRPosition &RVPos = IRPosition::value(RV, CBContext);
+ // If possible, use the hasAssumedIRAttr interface.
+ if (IRAttributeKind != Attribute::None) {
+ bool IsKnown;
+ return AA::hasAssumedIRAttr<IRAttributeKind>(
+ A, &QueryingAA, RVPos, DepClassTy::REQUIRED, IsKnown);
+ }
+
const AAType *AA =
A.getAAFor<AAType>(QueryingAA, RVPos, DepClassTy::REQUIRED);
if (!AA)
return false;
- LLVM_DEBUG(dbgs() << "[Attributor] RV: " << RV << " AA: " << AA->getAsStr()
- << " @ " << RVPos << "\n");
+ LLVM_DEBUG(dbgs() << "[Attributor] RV: " << RV
+ << " AA: " << AA->getAsStr(&A) << " @ " << RVPos << "\n");
const StateType &AAS = AA->getState();
if (!T)
T = StateType::getBestState(AAS);
@@ -421,7 +429,8 @@
/// Helper class for generic deduction: return value -> returned position.
template <typename AAType, typename BaseType,
typename StateType = typename BaseType::StateType,
- bool PropagateCallBaseContext = false>
+ bool PropagateCallBaseContext = false,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
struct AAReturnedFromReturnedValues : public BaseType {
AAReturnedFromReturnedValues(const IRPosition &IRP, Attributor &A)
: BaseType(IRP, A) {}
@@ -429,7 +438,7 @@
/// See AbstractAttribute::updateImpl(...).
ChangeStatus updateImpl(Attributor &A) override {
StateType S(StateType::getBestState(this->getState()));
- clampReturnedValueStates<AAType, StateType>(
+ clampReturnedValueStates<AAType, StateType, IRAttributeKind>(
A, *this, S,
PropagateCallBaseContext ? this->getCallBaseContext() : nullptr);
// TODO: If we know we visited all returned values, thus no are assumed
@@ -440,7 +449,8 @@
/// Clamp the information known at all call sites for a given argument
/// (identified by \p QueryingAA) into \p S.
-template <typename AAType, typename StateType = typename AAType::StateType>
+template <typename AAType, typename StateType = typename AAType::StateType,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
static void clampCallSiteArgumentStates(Attributor &A, const AAType &QueryingAA,
StateType &S) {
LLVM_DEBUG(dbgs() << "[Attributor] Clamp call site argument states for "
@@ -464,12 +474,19 @@
if (ACSArgPos.getPositionKind() == IRPosition::IRP_INVALID)
return false;
+ // If possible, use the hasAssumedIRAttr interface.
+ if (IRAttributeKind != Attribute::None) {
+ bool IsKnown;
+ return AA::hasAssumedIRAttr<IRAttributeKind>(
+ A, &QueryingAA, ACSArgPos, DepClassTy::REQUIRED, IsKnown);
+ }
+
const AAType *AA =
A.getAAFor<AAType>(QueryingAA, ACSArgPos, DepClassTy::REQUIRED);
if (!AA)
return false;
LLVM_DEBUG(dbgs() << "[Attributor] ACS: " << *ACS.getInstruction()
- << " AA: " << AA->getAsStr() << " @" << ACSArgPos
+ << " AA: " << AA->getAsStr(&A) << " @" << ACSArgPos
<< "\n");
const StateType &AAS = AA->getState();
if (!T)
@@ -491,7 +508,8 @@
/// This function is the bridge between argument position and the call base
/// context.
template <typename AAType, typename BaseType,
- typename StateType = typename AAType::StateType>
+ typename StateType = typename AAType::StateType,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
bool getArgumentStateFromCallBaseContext(Attributor &A,
BaseType &QueryingAttribute,
IRPosition &Pos, StateType &State) {
@@ -503,10 +521,17 @@
int ArgNo = Pos.getCallSiteArgNo();
assert(ArgNo >= 0 && "Invalid Arg No!");
+ const IRPosition CBArgPos = IRPosition::callsite_argument(*CBContext, ArgNo);
- const auto *AA = A.getAAFor<AAType>(
- QueryingAttribute, IRPosition::callsite_argument(*CBContext, ArgNo),
- DepClassTy::REQUIRED);
+ // If possible, use the hasAssumedIRAttr interface.
+ if (IRAttributeKind != Attribute::None) {
+ bool IsKnown;
+ return AA::hasAssumedIRAttr<IRAttributeKind>(
+ A, &QueryingAttribute, CBArgPos, DepClassTy::REQUIRED, IsKnown);
+ }
+
+ const auto *AA =
+ A.getAAFor<AAType>(QueryingAttribute, CBArgPos, DepClassTy::REQUIRED);
if (!AA)
return false;
const StateType &CBArgumentState =
@@ -524,7 +549,8 @@
/// Helper class for generic deduction: call site argument -> argument position.
template <typename AAType, typename BaseType,
typename StateType = typename AAType::StateType,
- bool BridgeCallBaseContext = false>
+ bool BridgeCallBaseContext = false,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
struct AAArgumentFromCallSiteArguments : public BaseType {
AAArgumentFromCallSiteArguments(const IRPosition &IRP, Attributor &A)
: BaseType(IRP, A) {}
@@ -535,12 +561,14 @@
if (BridgeCallBaseContext) {
bool Success =
- getArgumentStateFromCallBaseContext<AAType, BaseType, StateType>(
+ getArgumentStateFromCallBaseContext<AAType, BaseType, StateType,
+ IRAttributeKind>(
A, *this, this->getIRPosition(), S);
if (Success)
return clampStateAndIndicateChange<StateType>(this->getState(), S);
}
- clampCallSiteArgumentStates<AAType, StateType>(A, *this, S);
+ clampCallSiteArgumentStates<AAType, StateType, IRAttributeKind>(A, *this,
+ S);
// TODO: If we know we visited all incoming values, thus no are assumed
// dead, we can take the known information from the state T.
@@ -551,7 +579,8 @@
/// Helper class for generic replication: function returned -> cs returned.
template <typename AAType, typename BaseType,
typename StateType = typename BaseType::StateType,
- bool IntroduceCallBaseContext = false>
+ bool IntroduceCallBaseContext = false,
+ Attribute::AttrKind IRAttributeKind = Attribute::None>
struct AACallSiteReturnedFromReturned : public BaseType {
AACallSiteReturnedFromReturned(const IRPosition &IRP, Attributor &A)
: BaseType(IRP, A) {}
@@ -576,6 +605,16 @@
IRPosition FnPos = IRPosition::returned(
*AssociatedFunction, IntroduceCallBaseContext ? &CBContext : nullptr);
+
+ // If possible, use the hasAssumedIRAttr interface.
+ if (IRAttributeKind != Attribute::None) {
+ bool IsKnown;
+ if (!AA::hasAssumedIRAttr<IRAttributeKind>(A, this, FnPos,
+ DepClassTy::REQUIRED, IsKnown))
+ return S.indicatePessimisticFixpoint();
+ return ChangeStatus::UNCHANGED;
+ }
+
const AAType *AA = A.getAAFor<AAType>(*this, FnPos, DepClassTy::REQUIRED);
if (!AA)
return S.indicatePessimisticFixpoint();
@@ -1041,7 +1080,7 @@
AAPointerInfoImpl(const IRPosition &IRP, Attributor &A) : BaseTy(IRP) {}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return std::string("PointerInfo ") +
(isValidState() ? (std::string("#") +
std::to_string(OffsetBins.size()) + " bins")
@@ -1993,7 +2032,7 @@
struct AANoUnwindImpl : AANoUnwind {
AANoUnwindImpl(const IRPosition &IRP, Attributor &A) : AANoUnwind(IRP, A) {}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nounwind" : "may-unwind";
}
@@ -2150,7 +2189,7 @@
const override;
/// Pretty print the attribute similar to the IR representation.
- const std::string getAsStr() const override;
+ const std::string getAsStr(Attributor *A) const override;
/// See AbstractState::isAtFixpoint().
bool isAtFixpoint() const override { return IsFixed; }
@@ -2199,7 +2238,7 @@
return Changed;
}
-const std::string AAReturnedValuesImpl::getAsStr() const {
+const std::string AAReturnedValuesImpl::getAsStr(Attributor *A) const {
return (isAtFixpoint() ? "returns(#" : "may-return(#") +
(isValidState() ? std::to_string(getNumReturnValues()) : "?") + ")";
}
@@ -2370,7 +2409,7 @@
struct AANoSyncImpl : AANoSync {
AANoSyncImpl(const IRPosition &IRP, Attributor &A) : AANoSync(IRP, A) {}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nosync" : "may-sync";
}
@@ -2460,7 +2499,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nofree" : "may-free";
}
};
@@ -2620,6 +2659,39 @@
} // namespace
/// ------------------------ NonNull Argument Attribute ------------------------
+
+bool AANonNull::isImpliedByIR(Attributor &A, const IRPosition &IRP,
+ Attribute::AttrKind ImpliedAttributeKind,
+ bool IgnoreSubsumingPositions) {
+ SmallVector<Attribute::AttrKind, 2> AttrKinds;
+ AttrKinds.push_back(Attribute::NonNull);
+ if (!NullPointerIsDefined(IRP.getAnchorScope(),
+ IRP.getAssociatedType()->getPointerAddressSpace()))
+ AttrKinds.push_back(Attribute::Dereferenceable);
+ if (A.hasAttr(IRP, AttrKinds, IgnoreSubsumingPositions, Attribute::NonNull))
+ return true;
+
+ if (IRP.getPositionKind() == IRP_RETURNED)
+ return false;
+
+ DominatorTree *DT = nullptr;
+ AssumptionCache *AC = nullptr;
+ InformationCache &InfoCache = A.getInfoCache();
+ if (const Function *Fn = IRP.getAnchorScope()) {
+ if (!Fn->isDeclaration()) {
+ DT = InfoCache.getAnalysisResultForFunction<DominatorTreeAnalysis>(*Fn);
+ AC = InfoCache.getAnalysisResultForFunction<AssumptionAnalysis>(*Fn);
+ }
+ }
+
+ if (!isKnownNonZero(&IRP.getAssociatedValue(), A.getDataLayout(), 0, AC,
+ IRP.getCtxI(), DT))
+ return false;
+ A.manifestAttrs(IRP, {Attribute::get(IRP.getAnchorValue().getContext(),
+ Attribute::NonNull)});
+ return true;
+}
+
namespace {
static int64_t getKnownNonNullAndDerefBytesForUse(
Attributor &A, const AbstractAttribute &QueryingAA, Value &AssociatedValue,
@@ -2668,9 +2740,12 @@
IRPosition IRP = IRPosition::callsite_argument(*CB, ArgNo);
// As long as we only use known information there is no need to track
// dependences here.
+ bool IsKnownNonNull;
+ AA::hasAssumedIRAttr<Attribute::NonNull>(A, &QueryingAA, IRP,
+ DepClassTy::NONE, IsKnownNonNull);
+ IsNonNull |= IsKnownNonNull;
auto *DerefAA =
A.getAAFor<AADereferenceable>(QueryingAA, IRP, DepClassTy::NONE);
- IsNonNull |= DerefAA && DerefAA->isKnownNonNull();
return DerefAA ? DerefAA->getKnownDereferenceableBytes() : 0;
}
@@ -2700,44 +2775,16 @@
}
struct AANonNullImpl : AANonNull {
- AANonNullImpl(const IRPosition &IRP, Attributor &A)
- : AANonNull(IRP, A),
- NullIsDefined(NullPointerIsDefined(
- getAnchorScope(),
- getAssociatedValue().getType()->getPointerAddressSpace())) {}
+ AANonNullImpl(const IRPosition &IRP, Attributor &A) : AANonNull(IRP, A) {}
/// See AbstractAttribute::initialize(...).
void initialize(Attributor &A) override {
Value &V = *getAssociatedValue().stripPointerCasts();
- if (!NullIsDefined &&
- A.hasAttr(getIRPosition(),
- {Attribute::NonNull, Attribute::Dereferenceable},
- /* IgnoreSubsumingPositions */ false)) {
- indicateOptimisticFixpoint();
- return;
- }
-
if (isa<ConstantPointerNull>(V)) {
indicatePessimisticFixpoint();
return;
}
- AANonNull::initialize(A);
-
- bool CanBeNull, CanBeFreed;
- if (V.getPointerDereferenceableBytes(A.getDataLayout(), CanBeNull,
- CanBeFreed)) {
- if (!CanBeNull) {
- indicateOptimisticFixpoint();
- return;
- }
- }
-
- if (isa<GlobalValue>(V)) {
- indicatePessimisticFixpoint();
- return;
- }
-
if (Instruction *CtxI = getCtxI())
followUsesInMBEC(*this, A, getState(), *CtxI);
}
@@ -2754,13 +2801,9 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nonnull" : "may-null";
}
-
- /// Flag to determine if the underlying value can be null and still allow
- /// valid accesses.
- const bool NullIsDefined;
};
/// NonNull attribute for a floating value.
@@ -2770,48 +2813,39 @@
/// See AbstractAttribute::updateImpl(...).
ChangeStatus updateImpl(Attributor &A) override {
- const DataLayout &DL = A.getDataLayout();
+ auto CheckIRP = [&](const IRPosition &IRP) {
+ bool IsKnownNonNull;
+ return AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, *this, IRP, DepClassTy::OPTIONAL, IsKnownNonNull);
+ };
bool Stripped;
bool UsedAssumedInformation = false;
+ Value *AssociatedValue = &getAssociatedValue();
SmallVector<AA::ValueAndContext> Values;
if (!A.getAssumedSimplifiedValues(getIRPosition(), *this, Values,
- AA::AnyScope, UsedAssumedInformation)) {
- Values.push_back({getAssociatedValue(), getCtxI()});
+ AA::AnyScope, UsedAssumedInformation))
Stripped = false;
- } else {
- Stripped = Values.size() != 1 ||
- Values.front().getValue() != &getAssociatedValue();
- }
+ else
+ Stripped =
+ Values.size() != 1 || Values.front().getValue() != AssociatedValue;
- DominatorTree *DT = nullptr;
- AssumptionCache *AC = nullptr;
- InformationCache &InfoCache = A.getInfoCache();
- if (const Function *Fn = getAnchorScope()) {
- DT = InfoCache.getAnalysisResultForFunction<DominatorTreeAnalysis>(*Fn);
- AC = InfoCache.getAnalysisResultForFunction<AssumptionAnalysis>(*Fn);
+ if (!Stripped) {
+ // If we haven't stripped anything we might still be able to use a
+ // different AA, but only if the IRP changes. Effectively when we
+ // interpret this not as a call site value but as a floating/argument
+ // value.
+ const IRPosition AVIRP = IRPosition::value(*AssociatedValue);
+ if (AVIRP == getIRPosition() || !CheckIRP(AVIRP))
+ return indicatePessimisticFixpoint();
+ return ChangeStatus::UNCHANGED;
}
- AANonNull::StateType T;
- auto VisitValueCB = [&](Value &V, const Instruction *CtxI) -> bool {
- const auto *AA = A.getAAFor<AANonNull>(*this, IRPosition::value(V),
- DepClassTy::REQUIRED);
- if (!Stripped && this == AA) {
- if (!isKnownNonZero(&V, DL, 0, AC, CtxI, DT))
- T.indicatePessimisticFixpoint();
- } else {
- // Use abstract attribute information.
- const AANonNull::StateType &NS = AA->getState();
- T ^= NS;
- }
- return T.isValidState();
- };
-
for (const auto &VAC : Values)
- if (!VisitValueCB(*VAC.getValue(), VAC.getCtxI()))
+ if (!CheckIRP(IRPosition::value(*VAC.getValue())))
return indicatePessimisticFixpoint();
- return clampStateAndIndicateChange(getState(), T);
+ return ChangeStatus::UNCHANGED;
}
/// See AbstractAttribute::trackStatistics()
@@ -2820,12 +2854,14 @@
/// NonNull attribute for function return value.
struct AANonNullReturned final
- : AAReturnedFromReturnedValues<AANonNull, AANonNull> {
+ : AAReturnedFromReturnedValues<AANonNull, AANonNull, AANonNull::StateType,
+ false, AANonNull::IRAttributeKind> {
AANonNullReturned(const IRPosition &IRP, Attributor &A)
- : AAReturnedFromReturnedValues<AANonNull, AANonNull>(IRP, A) {}
+ : AAReturnedFromReturnedValues<AANonNull, AANonNull, AANonNull::StateType,
+ false, Attribute::NonNull>(IRP, A) {}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nonnull" : "may-null";
}
@@ -2835,9 +2871,13 @@
/// NonNull attribute for function argument.
struct AANonNullArgument final
- : AAArgumentFromCallSiteArguments<AANonNull, AANonNullImpl> {
+ : AAArgumentFromCallSiteArguments<AANonNull, AANonNullImpl,
+ AANonNull::StateType, false,
+ AANonNull::IRAttributeKind> {
AANonNullArgument(const IRPosition &IRP, Attributor &A)
- : AAArgumentFromCallSiteArguments<AANonNull, AANonNullImpl>(IRP, A) {}
+ : AAArgumentFromCallSiteArguments<AANonNull, AANonNullImpl,
+ AANonNull::StateType, false,
+ AANonNull::IRAttributeKind>(IRP, A) {}
/// See AbstractAttribute::trackStatistics()
void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(nonnull) }
@@ -2853,9 +2893,13 @@
/// NonNull attribute for a call site return position.
struct AANonNullCallSiteReturned final
- : AACallSiteReturnedFromReturned<AANonNull, AANonNullImpl> {
+ : AACallSiteReturnedFromReturned<AANonNull, AANonNullImpl,
+ AANonNull::StateType, false,
+ AANonNull::IRAttributeKind> {
AANonNullCallSiteReturned(const IRPosition &IRP, Attributor &A)
- : AACallSiteReturnedFromReturned<AANonNull, AANonNullImpl>(IRP, A) {}
+ : AACallSiteReturnedFromReturned<AANonNull, AANonNullImpl,
+ AANonNull::StateType, false,
+ AANonNull::IRAttributeKind>(IRP, A) {}
/// See AbstractAttribute::trackStatistics()
void trackStatistics() const override { STATS_DECLTRACK_CSRET_ATTR(nonnull) }
@@ -2869,7 +2913,7 @@
: AAMustProgress(IRP, A) {}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "mustprogress" : "may-not-progress";
}
};
@@ -2944,7 +2988,7 @@
AANoRecurseImpl(const IRPosition &IRP, Attributor &A) : AANoRecurse(IRP, A) {}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "norecurse" : "may-recurse";
}
};
@@ -3023,7 +3067,7 @@
: AANonConvergent(IRP, A) {}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "non-convergent" : "may-be-convergent";
}
};
@@ -3205,9 +3249,10 @@
if (!ArgVal->getType()->isPointerTy() ||
!isa<ConstantPointerNull>(**SimplifiedVal))
continue;
- auto *NonNullAA =
- A.getAAFor<AANonNull>(*this, CalleeArgumentIRP, DepClassTy::NONE);
- if (NonNullAA && NonNullAA->isKnownNonNull())
+ bool IsKnownNonNull;
+ AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, CalleeArgumentIRP, DepClassTy::NONE, IsKnownNonNull);
+ if (IsKnownNonNull)
KnownUBInsts.insert(&I);
}
return true;
@@ -3237,9 +3282,11 @@
// position has nonnull attribute (because the returned value is
// poison).
if (isa<ConstantPointerNull>(*SimplifiedRetValue)) {
- auto *NonNullAA = A.getAAFor<AANonNull>(
- *this, IRPosition::returned(*getAnchorScope()), DepClassTy::NONE);
- if (NonNullAA && NonNullAA->isKnownNonNull())
+ bool IsKnownNonNull;
+ AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, IRPosition::returned(*getAnchorScope()), DepClassTy::NONE,
+ IsKnownNonNull);
+ if (IsKnownNonNull)
KnownUBInsts.insert(&I);
}
@@ -3317,7 +3364,7 @@
}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "undefined-behavior" : "no-ub";
}
@@ -3481,7 +3528,7 @@
}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "willreturn" : "may-noreturn";
}
};
@@ -3682,7 +3729,7 @@
return Result == RQITy::Reachable::Yes;
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
// TODO: Return the number of reachable queries.
return "#queries(" + std::to_string(QueryVector.size()) + ")";
}
@@ -3852,7 +3899,7 @@
"Noalias is a pointer attribute");
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noalias" : "may-alias";
}
};
@@ -4252,7 +4299,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return isAssumedDead() ? "assumed-dead" : "assumed-live";
}
@@ -4385,7 +4432,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
Instruction *I = dyn_cast<Instruction>(&getAssociatedValue());
if (isa_and_nonnull<StoreInst>(I))
if (isValidState())
@@ -4393,7 +4440,7 @@
if (isa_and_nonnull<FenceInst>(I))
if (isValidState())
return "assumed-dead-fence";
- return AAIsDeadValueImpl::getAsStr();
+ return AAIsDeadValueImpl::getAsStr(A);
}
/// See AbstractAttribute::updateImpl(...).
@@ -4569,7 +4616,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return isAssumedDead()
? "assumed-dead"
: (getAssumed() ? "assumed-dead-users" : "assumed-live");
@@ -4646,7 +4693,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return "Live[#BB " + std::to_string(AssumedLiveBlocks.size()) + "/" +
std::to_string(getAnchorScope()->size()) + "][#TBEP " +
std::to_string(ToBeExploredFrom.size()) + "][#KDE " +
@@ -5046,8 +5093,10 @@
for (const Attribute &Attr : Attrs)
takeKnownDerefBytesMaximum(Attr.getValueAsInt());
- const IRPosition &IRP = this->getIRPosition();
- NonNullAA = A.getAAFor<AANonNull>(*this, IRP, DepClassTy::NONE);
+ // Ensure we initialize the non-null AA (if necessary).
+ bool IsKnownNonNull;
+ AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, getIRPosition(), DepClassTy::OPTIONAL, IsKnownNonNull);
bool CanBeNull, CanBeFreed;
takeKnownDerefBytesMaximum(V.getPointerDereferenceableBytes(
@@ -5099,7 +5148,10 @@
/// See AbstractAttribute::manifest(...).
ChangeStatus manifest(Attributor &A) override {
ChangeStatus Change = AADereferenceable::manifest(A);
- if (isAssumedNonNull() &&
+ bool IsKnownNonNull;
+ bool IsAssumedNonNull = AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, getIRPosition(), DepClassTy::NONE, IsKnownNonNull);
+ if (IsAssumedNonNull &&
A.hasAttr(getIRPosition(), Attribute::DereferenceableOrNull)) {
A.removeAttrs(getIRPosition(), {Attribute::DereferenceableOrNull});
return ChangeStatus::CHANGED;
@@ -5107,10 +5159,13 @@
return Change;
}
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
// TODO: Add *_globally support
- if (isAssumedNonNull())
+ bool IsKnownNonNull;
+ bool IsAssumedNonNull = AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, getIRPosition(), DepClassTy::NONE, IsKnownNonNull);
+ if (IsAssumedNonNull)
Attrs.emplace_back(Attribute::getWithDereferenceableBytes(
Ctx, getAssumedDereferenceableBytes()));
else
@@ -5119,14 +5174,20 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
if (!getAssumedDereferenceableBytes())
return "unknown-dereferenceable";
+ bool IsKnownNonNull;
+ bool IsAssumedNonNull = false;
+ if (A)
+ IsAssumedNonNull = AA::hasAssumedIRAttr<Attribute::NonNull>(
+ *A, this, getIRPosition(), DepClassTy::NONE, IsKnownNonNull);
return std::string("dereferenceable") +
- (isAssumedNonNull() ? "" : "_or_null") +
+ (IsAssumedNonNull ? "" : "_or_null") +
(isAssumedGlobal() ? "_globally" : "") + "<" +
std::to_string(getKnownDereferenceableBytes()) + "-" +
- std::to_string(getAssumedDereferenceableBytes()) + ">";
+ std::to_string(getAssumedDereferenceableBytes()) + ">" +
+ (!A ? " [non-null is unknown]" : "");
}
};
@@ -5137,7 +5198,6 @@
/// See AbstractAttribute::updateImpl(...).
ChangeStatus updateImpl(Attributor &A) override {
-
bool Stripped;
bool UsedAssumedInformation = false;
SmallVector<AA::ValueAndContext> Values;
@@ -5222,9 +5282,10 @@
/// Dereferenceable attribute for a return value.
struct AADereferenceableReturned final
: AAReturnedFromReturnedValues<AADereferenceable, AADereferenceableImpl> {
+ using Base =
+ AAReturnedFromReturnedValues<AADereferenceable, AADereferenceableImpl>;
AADereferenceableReturned(const IRPosition &IRP, Attributor &A)
- : AAReturnedFromReturnedValues<AADereferenceable, AADereferenceableImpl>(
- IRP, A) {}
+ : Base(IRP, A) {}
/// See AbstractAttribute::trackStatistics()
void trackStatistics() const override {
@@ -5393,7 +5454,7 @@
// to avoid making the alignment explicit if it did not improve.
/// See AbstractAttribute::getDeducedAttributes
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
if (getAssumedAlign() > 1)
Attrs.emplace_back(
@@ -5413,7 +5474,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return "align<" + std::to_string(getKnownAlign().value()) + "-" +
std::to_string(getAssumedAlign().value()) + ">";
}
@@ -5573,7 +5634,7 @@
AANoReturnImpl(const IRPosition &IRP, Attributor &A) : AANoReturn(IRP, A) {}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noreturn" : "may-return";
}
@@ -5744,7 +5805,7 @@
}
/// See AbstractState::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return isAssumedUniqueForAnalysis() ? "<unique [fAa]>" : "<unknown>";
}
@@ -5848,7 +5909,7 @@
ChangeStatus updateImpl(Attributor &A) override;
/// see AbstractAttribute::isAssumedNoCaptureMaybeReturned(...).
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
if (!isAssumedNoCaptureMaybeReturned())
return;
@@ -5905,7 +5966,7 @@
}
/// See AbstractState::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
if (isKnownNoCapture())
return "known not-captured";
if (isAssumedNoCapture())
@@ -6211,7 +6272,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
LLVM_DEBUG({
dbgs() << "SAV: " << (bool)SimplifiedAssociatedValue << " ";
if (SimplifiedAssociatedValue && *SimplifiedAssociatedValue)
@@ -6768,7 +6829,7 @@
SCB);
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
unsigned NumH2SMallocs = 0, NumInvalidMallocs = 0;
for (const auto &It : AllocationInfos) {
if (It.second->Status == AllocationInfo::INVALID)
@@ -7293,7 +7354,7 @@
return PrivatizableType;
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return isAssumedPrivatizablePtr() ? "[priv]" : "[no-priv]";
}
@@ -7915,7 +7976,7 @@
}
/// See AbstractAttribute::getDeducedAttributes(...).
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
assert(Attrs.size() == 0);
if (isAssumedReadNone())
@@ -7937,7 +7998,7 @@
// Check if we would improve the existing attributes first.
SmallVector<Attribute, 4> DeducedAttrs;
- getDeducedAttributes(IRP.getAnchorValue().getContext(), DeducedAttrs);
+ getDeducedAttributes(A, IRP.getAnchorValue().getContext(), DeducedAttrs);
if (llvm::all_of(DeducedAttrs, [&](const Attribute &Attr) {
return A.hasAttr(IRP, Attr.getKindAsEnum(),
/* IgnoreSubsumingPositions */ true);
@@ -7952,7 +8013,7 @@
}
/// See AbstractState::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
if (isAssumedReadNone())
return "readnone";
if (isAssumedReadOnly())
@@ -8511,7 +8572,7 @@
}
/// See AbstractAttribute::getDeducedAttributes(...).
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
// TODO: We can map Attributor locations to MemoryEffects more precisely.
assert(Attrs.size() == 0);
@@ -8539,7 +8600,7 @@
const IRPosition &IRP = getIRPosition();
SmallVector<Attribute, 1> DeducedAttrs;
- getDeducedAttributes(IRP.getAnchorValue().getContext(), DeducedAttrs);
+ getDeducedAttributes(A, IRP.getAnchorValue().getContext(), DeducedAttrs);
if (DeducedAttrs.size() != 1)
return ChangeStatus::UNCHANGED;
MemoryEffects ME = DeducedAttrs[0].getMemoryEffects();
@@ -8985,7 +9046,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << "range(" << getBitWidth() << ")<";
@@ -9664,7 +9725,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << getState();
@@ -10189,7 +10250,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noundef" : "may-undef-or-poison";
}
@@ -10352,14 +10413,14 @@
return TrackUse;
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
std::string Result = "nofpclass";
raw_string_ostream OS(Result);
OS << getAssumedNoFPClass();
return Result;
}
- void getDeducedAttributes(LLVMContext &Ctx,
+ void getDeducedAttributes(Attributor &A, LLVMContext &Ctx,
SmallVectorImpl<Attribute> &Attrs) const override {
Attrs.emplace_back(Attribute::getWithNoFPClass(Ctx, getAssumedNoFPClass()));
}
@@ -10459,7 +10520,7 @@
return HasUnknownCalleeNonAsm;
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return "CallEdges[" + std::to_string(HasUnknownCallee) + "," +
std::to_string(CalledFunctions.size()) + "]";
}
@@ -10765,7 +10826,7 @@
}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << getState();
@@ -11010,9 +11071,11 @@
// The index is the operand that we assume is not null.
unsigned PtrIdx = LHSIsNull;
- auto *PtrNonNullAA = A.getAAFor<AANonNull>(
- *this, IRPosition::value(*(PtrIdx ? RHS : LHS)), DepClassTy::REQUIRED);
- if (!PtrNonNullAA || !PtrNonNullAA->isAssumedNonNull())
+ bool IsKnownNonNull;
+ bool IsAssumedNonNull = AA::hasAssumedIRAttr<Attribute::NonNull>(
+ A, this, IRPosition::value(*(PtrIdx ? RHS : LHS)), DepClassTy::REQUIRED,
+ IsKnownNonNull);
+ if (!IsAssumedNonNull)
return false;
// The new value depends on the predicate, true for != and false for ==.
@@ -11596,7 +11659,7 @@
}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
const SetContents &Known = getKnown();
const SetContents &Assumed = getAssumed();
@@ -11714,7 +11777,7 @@
AAUnderlyingObjectsImpl(const IRPosition &IRP, Attributor &A) : BaseTy(IRP) {}
/// See AbstractAttribute::getAsStr().
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *A) const override {
return std::string("UnderlyingObjects ") +
(isValidState()
? (std::string("inter #") +
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index e9c356a..ddff766 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -2152,7 +2152,9 @@
: AAICVTracker(IRP, A) {}
// FIXME: come up with better string.
- const std::string getAsStr() const override { return "ICVTrackerFunction"; }
+ const std::string getAsStr(Attributor *) const override {
+ return "ICVTrackerFunction";
+ }
// FIXME: come up with some stats.
void trackStatistics() const override {}
@@ -2344,7 +2346,7 @@
: AAICVTracker(IRP, A) {}
// FIXME: come up with better string.
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
return "ICVTrackerFunctionReturned";
}
@@ -2443,7 +2445,9 @@
}
// FIXME: come up with better string.
- const std::string getAsStr() const override { return "ICVTrackerCallSite"; }
+ const std::string getAsStr(Attributor *) const override {
+ return "ICVTrackerCallSite";
+ }
// FIXME: come up with some stats.
void trackStatistics() const override {}
@@ -2482,7 +2486,7 @@
: AAICVTracker(IRP, A) {}
// FIXME: come up with better string.
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
return "ICVTrackerCallSiteReturned";
}
@@ -2543,7 +2547,7 @@
RPOT = new ReversePostOrderTraversal<Function *>(F);
}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
unsigned TotalBlocks = 0, InitialThreadBlocks = 0, AlignedBlocks = 0;
for (auto &It : BEDMap) {
if (!It.getFirst())
@@ -3242,7 +3246,7 @@
AAHeapToSharedFunction(const IRPosition &IRP, Attributor &A)
: AAHeapToShared(IRP, A) {}
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
return "[AAHeapToShared] " + std::to_string(MallocCalls.size()) +
" malloc calls eligible.";
}
@@ -3442,7 +3446,7 @@
void trackStatistics() const override {}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
if (!isValidState())
return "<invalid>";
return std::string(SPMDCompatibilityTracker.isAssumed() ? "SPMD"
@@ -4871,7 +4875,7 @@
: AAFoldRuntimeCall(IRP, A) {}
/// See AbstractAttribute::getAsStr()
- const std::string getAsStr() const override {
+ const std::string getAsStr(Attributor *) const override {
if (!isValidState())
return "<invalid>";
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
index 153aa30..38953c1 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
+++ b/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 nonnull readonly [[X:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
; TUNIT-NEXT: store i32 1, ptr [[S]], align 8
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
index 1f19aa9..96e41fd 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
+++ b/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 nonnull readonly [[X:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8
; TUNIT-NEXT: store i32 1, ptr [[S]], align 8
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll
index eaea49a..732a551 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll
@@ -5,7 +5,7 @@
define internal void @dead() {
; CGSCC-LABEL: define {{[^@]+}}@dead() {
-; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test(ptr null)
+; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @test(ptr nonnull null)
; CGSCC-NEXT: ret void
;
call i32 @test(ptr null, ptr null)
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
index 4dc4266..393653c 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
@@ -138,7 +138,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 @bar(ptr undef, i32 [[V]]) #[[ATTR7:[0-9]+]]
+; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr nonnull undef, i32 [[V]]) #[[ATTR7:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CA]]
;
%a.gep = getelementptr %T, %T* %p, i64 0, i32 3
diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll
index 3f6d155..c0811d3 100644
--- a/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll
+++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/variadic.ll
@@ -33,7 +33,7 @@
; 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-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 readnone align 4294967296 [[TP13:%.*]], ptr noalias nocapture nofree readnone align 4294967296 [[TP14:%.*]], ptr noalias nocapture nofree readnone align 4294967296 [[TP15:%.*]], ptr noalias nocapture nofree readnone align 4294967296 [[TP16:%.*]], ptr noalias nocapture nofree readnone align 4294967296 [[TP17:%.*]], ...) {
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @sink(i32 noundef 0)
; CHECK-NEXT: ret void
diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
index 50b5ff6..e3cdacf 100644
--- a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
+++ b/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 nonnull @.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: 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 noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr noalias nocapture 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 nonnull @.omp_outlined., ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[P]], i64 noundef 4617315517961601024)
; CGSCC-NEXT: ret void
;
entry:
diff --git a/llvm/test/Transforms/Attributor/callbacks.ll b/llvm/test/Transforms/Attributor/callbacks.ll
index 935d154..d49a616 100644
--- a/llvm/test/Transforms/Attributor/callbacks.ll
+++ b/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 nonnull @t0_callback_callee, ptr align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t0_caller
@@ -33,7 +33,7 @@
; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128
; CGSCC-NEXT: store i32 42, ptr [[B]], align 32
; CGSCC-NEXT: store ptr [[B]], ptr [[C]], align 64
-; CGSCC-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 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
+; CGSCC-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 nonnull @t0_callback_callee, ptr align 256 [[A]], i64 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; CGSCC-NEXT: ret void
;
entry:
@@ -56,7 +56,7 @@
; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8
; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4
; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C]], align 64
-; TUNIT-NEXT: tail call void @t0_check(ptr align 256 [[A]], i64 noundef 99, ptr nonnull align 32 [[TMP0]])
+; TUNIT-NEXT: tail call void @t0_check(ptr align 256 [[A]], i64 noundef 99, ptr align 32 [[TMP0]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t0_callback_callee
@@ -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 nonnull @t1_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t1_caller
@@ -106,7 +106,7 @@
; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128
; CGSCC-NEXT: store i32 42, ptr [[B]], align 32
; CGSCC-NEXT: store ptr [[B]], ptr [[C]], align 64
-; CGSCC-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 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
+; CGSCC-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 nonnull @t1_callback_callee, ptr nocapture align 256 [[A]], i64 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; CGSCC-NEXT: ret void
;
entry:
@@ -130,7 +130,7 @@
; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8
; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4
; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C]], align 64
-; TUNIT-NEXT: tail call void @t1_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture nonnull align 32 [[TMP0]])
+; TUNIT-NEXT: tail call void @t1_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture align 32 [[TMP0]])
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: nosync
@@ -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 nonnull @t2_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t2_caller
@@ -179,7 +179,7 @@
; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128
; CGSCC-NEXT: store i32 42, ptr [[B]], align 32
; CGSCC-NEXT: store ptr [[B]], ptr [[C]], align 64
-; CGSCC-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 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
+; CGSCC-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 nonnull @t2_callback_callee, ptr nocapture align 256 [[A]], i64 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; CGSCC-NEXT: ret void
;
entry:
@@ -204,7 +204,7 @@
; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8
; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4
; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C]], align 64
-; TUNIT-NEXT: tail call void @t2_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture nonnull align 32 [[TMP0]])
+; TUNIT-NEXT: tail call void @t2_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture align 32 [[TMP0]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t2_callback_callee
@@ -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 nonnull @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 nonnull @t3_callback_callee, ptr nocapture align 256 [[A]], i64 undef, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t3_caller
@@ -253,8 +253,8 @@
; CGSCC-NEXT: [[PTR:%.*]] = alloca i32, align 128
; CGSCC-NEXT: store i32 42, ptr [[B]], align 32
; CGSCC-NEXT: store ptr [[B]], ptr [[C]], align 64
-; CGSCC-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 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
-; CGSCC-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 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
+; CGSCC-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 nonnull @t3_callback_callee, ptr nocapture align 256 [[A]], i64 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
+; CGSCC-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 nonnull @t3_callback_callee, ptr nocapture align 256 [[A]], i64 noundef 99, ptr noalias nocapture nofree noundef nonnull readonly align 64 dereferenceable(8) [[C]])
; CGSCC-NEXT: ret void
;
entry:
@@ -280,7 +280,7 @@
; TUNIT-NEXT: [[PTR_VAL:%.*]] = load i32, ptr [[PTR]], align 8
; TUNIT-NEXT: store i32 [[PTR_VAL]], ptr [[IS_NOT_NULL]], align 4
; TUNIT-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C]], align 64
-; TUNIT-NEXT: tail call void @t3_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture nonnull align 32 [[TMP0]])
+; TUNIT-NEXT: tail call void @t3_check(ptr nocapture align 256 [[A]], i64 noundef 99, ptr nocapture align 32 [[TMP0]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@t3_callback_callee
diff --git a/llvm/test/Transforms/Attributor/callgraph.ll b/llvm/test/Transforms/Attributor/callgraph.ll
index 5a754d7..61c6ce9 100644
--- a/llvm/test/Transforms/Attributor/callgraph.ll
+++ b/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 nocapture nofree noundef nonnull @func3)
; CHECK-NEXT: ret void
;
call void @broker(ptr @func3)
diff --git a/llvm/test/Transforms/Attributor/chain.ll b/llvm/test/Transforms/Attributor/chain.ll
index d98da26..acf3ee7 100644
--- a/llvm/test/Transforms/Attributor/chain.ll
+++ b/llvm/test/Transforms/Attributor/chain.ll
@@ -5,19 +5,12 @@
declare void @foo(ptr dereferenceable(8) %arg)
define dso_local i32 @bar(ptr %arg) {
-; CHECK_1-LABEL: define {{[^@]+}}@bar
-; CHECK_1-SAME: (ptr noundef dereferenceable_or_null(8) [[ARG:%.*]]) {
-; CHECK_1-NEXT: entry:
-; CHECK_1-NEXT: call void @foo(ptr noundef nonnull dereferenceable_or_null(8) [[ARG]])
-; CHECK_1-NEXT: [[LD:%.*]] = load i32, ptr [[ARG]], align 4
-; CHECK_1-NEXT: ret i32 [[LD]]
-;
-; CHECK_5-LABEL: define {{[^@]+}}@bar
-; CHECK_5-SAME: (ptr noundef nonnull dereferenceable(8) [[ARG:%.*]]) {
-; CHECK_5-NEXT: entry:
-; CHECK_5-NEXT: call void @foo(ptr noundef nonnull dereferenceable(8) [[ARG]])
-; CHECK_5-NEXT: [[LD:%.*]] = load i32, ptr [[ARG]], align 4
-; CHECK_5-NEXT: ret i32 [[LD]]
+; CHECK-LABEL: define {{[^@]+}}@bar
+; CHECK-SAME: (ptr noundef nonnull dereferenceable(8) [[ARG:%.*]]) {
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @foo(ptr noundef nonnull dereferenceable(8) [[ARG]])
+; CHECK-NEXT: [[LD:%.*]] = load i32, ptr [[ARG]], align 4
+; CHECK-NEXT: ret i32 [[LD]]
;
entry:
call void @foo(ptr %arg)
@@ -25,4 +18,5 @@
ret i32 %ld
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
-; CHECK: {{.*}}
+; CHECK_1: {{.*}}
+; CHECK_5: {{.*}}
diff --git a/llvm/test/Transforms/Attributor/depgraph.ll b/llvm/test/Transforms/Attributor/depgraph.ll
index 4dd740b..a8a41b3 100644
--- a/llvm/test/Transforms/Attributor/depgraph.ll
+++ b/llvm/test/Transforms/Attributor/depgraph.ll
@@ -212,18 +212,11 @@
; GRAPH-EMPTY:
; GRAPH-NEXT: [AADereferenceable] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn_ret:checkAndAdvance [checkAndAdvance@-1]} with state unknown-dereferenceable
; GRAPH-EMPTY:
-; GRAPH-NEXT: [AADereferenceable] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state dereferenceable<4-4>
+; GRAPH-NEXT: [AADereferenceable] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state dereferenceable_or_null<4-4> [non-null is unknown]
; GRAPH-NEXT: updates [AADereferenceable] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state unknown-dereferenceable
; GRAPH-EMPTY:
; GRAPH-NEXT: [AADereferenceable] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state unknown-dereferenceable
; GRAPH-EMPTY:
-; GRAPH-NEXT: [AANonNull] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state nonnull
-; GRAPH-EMPTY:
-; GRAPH-NEXT: [AANonNull] for CtxI ' %5 = getelementptr inbounds i32, ptr %0, i64 4' at position {flt: [@-1]} with state nonnull
-; GRAPH-NEXT: updates [AANonNull] for CtxI ' %5 = getelementptr inbounds i32, ptr %0, i64 4' at position {flt: [@-1]} with state nonnull
-; GRAPH-NEXT: updates [AANonNull] for CtxI ' %6 = call ptr @checkAndAdvance(ptr %5)' at position {cs_arg: [@0]} with state nonnull
-; GRAPH-NEXT: updates [AANonNull] for CtxI ' %2 = load i32, ptr %0, align 4' at position {fn_ret:checkAndAdvance [checkAndAdvance@-1]} with state nonnull
-; GRAPH-EMPTY:
; GRAPH-NEXT: [AANoAlias] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state may-alias
; GRAPH-EMPTY:
; GRAPH-NEXT: [AANoFree] for CtxI ' %2 = load i32, ptr %0, align 4' at position {arg: [@0]} with state nofree
@@ -303,8 +296,6 @@
; DOT-DAG: Node[[Node54:0x[a-z0-9]+]] [shape=record,label="{[AADereferenceable]
; DOT-DAG: Node[[Node55:0x[a-z0-9]+]] [shape=record,label="{[AADereferenceable]
; DOT-DAG: Node[[Node56:0x[a-z0-9]+]] [shape=record,label="{[AADereferenceable]
-; DOT-DAG: Node[[Node57:0x[a-z0-9]+]] [shape=record,label="{[AANonNull]
-; DOT-DAG: Node[[Node58:0x[a-z0-9]+]] [shape=record,label="{[AANonNull]
; DOT-DAG: Node[[Node59:0x[a-z0-9]+]] [shape=record,label="{[AAIsDead]
; DOT-DAG: Node[[Node60:0x[a-z0-9]+]] [shape=record,label="{[AANoAlias]
; DOT-DAG: Node[[Node61:0x[a-z0-9]+]] [shape=record,label="{[AANoCapture]
@@ -323,7 +314,6 @@
; DOT-DAG: Node[[Node74:0x[a-z0-9]+]] [shape=record,label="{[AADereferenceable]
; DOT-DAG: Node[[Node20]] -> Node[[Node19]];
-; DOT-DAG: Node[[Node58]] -> Node[[Node58]];
; DOT-DAG: Node[[Node13]] -> Node[[Node12]];
; DOT-DAG: Node[[Node55]] -> Node[[Node56]];
; DOT-DAG: Node[[Node68]] -> Node[[Node73]];
@@ -332,7 +322,6 @@
; 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]];
@@ -345,7 +334,6 @@
; 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]];
diff --git a/llvm/test/Transforms/Attributor/dereferenceable-1.ll b/llvm/test/Transforms/Attributor/dereferenceable-1.ll
index f5dbf31..e2f280c 100644
--- a/llvm/test/Transforms/Attributor/dereferenceable-1.ll
+++ b/llvm/test/Transforms/Attributor/dereferenceable-1.ll
@@ -9,7 +9,7 @@
; take mininimum of return values
;
;.
-; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = global i64 0
+; CHECK: @g = global i64 0
;.
define ptr @test1(ptr dereferenceable(4) %0, ptr dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll
index a4f4f7a..1f14c92 100644
--- a/llvm/test/Transforms/Attributor/liveness.ll
+++ b/llvm/test/Transforms/Attributor/liveness.ll
@@ -2331,7 +2331,7 @@
;
; CGSCC-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_internal_a
; CGSCC-SAME: (ptr [[A:%.*]], ptr noundef nonnull align 128 dereferenceable(4) [[B:%.*]]) {
-; CGSCC-NEXT: call void @called_via_pointer(ptr [[A]], ptr nofree [[B]], ptr nofree [[A]], i64 -1, ptr nofree null)
+; CGSCC-NEXT: call void @called_via_pointer(ptr [[A]], ptr nofree nonnull [[B]], ptr nofree [[A]], i64 -1, ptr nofree null)
; CGSCC-NEXT: ret void
;
call void %fp(ptr %a, ptr %b, ptr %a, i64 -1, ptr null)
@@ -2352,29 +2352,17 @@
ret void
}
define void @call_via_pointer_with_dead_args_caller(ptr %a, ptr %b) {
-; TUNIT-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller
-; TUNIT-SAME: (ptr [[A:%.*]], ptr [[B:%.*]]) {
-; TUNIT-NEXT: [[PTR1:%.*]] = alloca i32, align 128
-; 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(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR1]], ptr nocapture nofree noundef @called_via_pointer)
-; TUNIT-NEXT: call void @call_via_pointer_with_dead_args(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR2]], ptr nocapture nofree noundef @called_via_pointer_internal_1)
-; TUNIT-NEXT: call void @call_via_pointer_with_dead_args_internal_a(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR3]])
-; TUNIT-NEXT: call void @call_via_pointer_with_dead_args_internal_b(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR4]])
-; TUNIT-NEXT: ret void
-;
-; CGSCC-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller
-; CGSCC-SAME: (ptr [[A:%.*]], ptr [[B:%.*]]) {
-; CGSCC-NEXT: [[PTR1:%.*]] = alloca i32, align 128
-; 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(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR1]], ptr nocapture nofree noundef nonnull @called_via_pointer)
-; CGSCC-NEXT: call void @call_via_pointer_with_dead_args(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR2]], ptr nocapture nofree noundef nonnull @called_via_pointer_internal_1)
-; CGSCC-NEXT: call void @call_via_pointer_with_dead_args_internal_a(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR3]])
-; CGSCC-NEXT: call void @call_via_pointer_with_dead_args_internal_b(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR4]])
-; CGSCC-NEXT: ret void
+; CHECK-LABEL: define {{[^@]+}}@call_via_pointer_with_dead_args_caller
+; CHECK-SAME: (ptr [[A:%.*]], ptr [[B:%.*]]) {
+; CHECK-NEXT: [[PTR1:%.*]] = alloca i32, align 128
+; CHECK-NEXT: [[PTR2:%.*]] = alloca i32, align 128
+; CHECK-NEXT: [[PTR3:%.*]] = alloca i32, align 128
+; CHECK-NEXT: [[PTR4:%.*]] = alloca i32, align 128
+; CHECK-NEXT: call void @call_via_pointer_with_dead_args(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR1]], ptr nocapture nofree noundef nonnull @called_via_pointer)
+; CHECK-NEXT: call void @call_via_pointer_with_dead_args(ptr [[A]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR2]], ptr nocapture nofree noundef nonnull @called_via_pointer_internal_1)
+; CHECK-NEXT: call void @call_via_pointer_with_dead_args_internal_a(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR3]])
+; CHECK-NEXT: call void @call_via_pointer_with_dead_args_internal_b(ptr [[B]], ptr noundef nonnull align 128 dereferenceable(4) [[PTR4]])
+; CHECK-NEXT: ret void
;
%ptr1 = alloca i32, align 128
%ptr2 = alloca i32, align 128
diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll
index 0a57f4b..dcebb43 100644
--- a/llvm/test/Transforms/Attributor/memory_locations.ll
+++ b/llvm/test/Transforms/Attributor/memory_locations.ll
@@ -575,7 +575,7 @@
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 writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR8]] {
; TUNIT-NEXT: [[ALLOC:%.*]] = alloca i8, align 1
; TUNIT-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; TUNIT: t:
@@ -587,7 +587,7 @@
;
; 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 writeonly [[PTR:%.*]], i1 noundef [[C:%.*]]) #[[ATTR9]] {
; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1
; CGSCC-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; CGSCC: t:
diff --git a/llvm/test/Transforms/Attributor/misc.ll b/llvm/test/Transforms/Attributor/misc.ll
index 830558c..8b1ac70 100644
--- a/llvm/test/Transforms/Attributor/misc.ll
+++ b/llvm/test/Transforms/Attributor/misc.ll
@@ -12,9 +12,9 @@
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
; TUNIT-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1:[0-9]+]]
-; TUNIT-NEXT: call void [[FP]](ptr @foo)
+; TUNIT-NEXT: call void [[FP]](ptr nonnull @foo)
; TUNIT-NEXT: call void @callback1(ptr noundef nonnull @foo)
-; TUNIT-NEXT: call void @callback2(ptr noundef @foo)
+; TUNIT-NEXT: call void @callback2(ptr noundef nonnull @foo)
; TUNIT-NEXT: call void @callback2(ptr nonnull [[FP]])
; TUNIT-NEXT: call void [[FP]](ptr [[A]])
; TUNIT-NEXT: ret void
@@ -24,9 +24,9 @@
; 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]]) #[[ATTR1:[0-9]+]]
-; CGSCC-NEXT: call void [[FP]](ptr @foo)
+; CGSCC-NEXT: call void [[FP]](ptr nonnull @foo)
; CGSCC-NEXT: call void @callback1(ptr noundef nonnull @foo)
-; CGSCC-NEXT: call void @callback2(ptr noundef @foo)
+; CGSCC-NEXT: call void @callback2(ptr noundef nonnull @foo)
; CGSCC-NEXT: call void @callback2(ptr noundef nonnull [[FP]])
; CGSCC-NEXT: call void [[FP]](ptr [[A]])
; CGSCC-NEXT: ret void
@@ -51,7 +51,7 @@
; TUNIT-NEXT: [[A:%.*]] = alloca i32, align 4
; TUNIT-NEXT: call void @foo(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[A]]) #[[ATTR1]]
; TUNIT-NEXT: call void @callback1(ptr noundef nonnull @foo)
-; TUNIT-NEXT: call void @callback2(ptr noundef @foo)
+; TUNIT-NEXT: call void @callback2(ptr noundef nonnull @foo)
; TUNIT-NEXT: call void @callback2(ptr [[FP]])
; TUNIT-NEXT: call void [[FP]](ptr @foo)
; TUNIT-NEXT: call void [[FP]](ptr [[A]])
@@ -64,7 +64,7 @@
; CGSCC-NEXT: [[A:%.*]] = alloca i32, align 4
; 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 noundef nonnull @foo)
; CGSCC-NEXT: call void @callback2(ptr [[FP]])
; CGSCC-NEXT: call void [[FP]](ptr @foo)
; CGSCC-NEXT: call void [[FP]](ptr [[A]])
diff --git a/llvm/test/Transforms/Attributor/nocapture-2.ll b/llvm/test/Transforms/Attributor/nocapture-2.ll
index 363192a..0480f3f 100644
--- a/llvm/test/Transforms/Attributor/nocapture-2.ll
+++ b/llvm/test/Transforms/Attributor/nocapture-2.ll
@@ -171,7 +171,7 @@
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne ptr [[A]], null
; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
; CHECK: cond.true:
-; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) ptr @scc_C(ptr noalias nofree noundef readnone dereferenceable_or_null(4) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
+; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) ptr @scc_C(ptr noalias nofree noundef nonnull readnone dereferenceable(4) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(8) ptr @scc_B(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: [[CALL2:%.*]] = call ptr @scc_A(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: br label [[COND_END:%.*]]
@@ -208,7 +208,7 @@
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne ptr [[A]], null
; CHECK-NEXT: br i1 [[TOBOOL]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
; CHECK: cond.true:
-; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) ptr @scc_A(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
+; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(4) ptr @scc_A(ptr noalias nofree noundef nonnull readnone dereferenceable(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(8) ptr @scc_B(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: [[CALL2:%.*]] = call ptr @scc_C(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR2]]
; CHECK-NEXT: br label [[COND_END:%.*]]
diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll
index a9740e2..68f0e5b 100644
--- a/llvm/test/Transforms/Attributor/nofree.ll
+++ b/llvm/test/Transforms/Attributor/nofree.ll
@@ -72,7 +72,7 @@
; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[TMP0]], null
; CHECK-NEXT: br i1 [[CMP]], label [[REC:%.*]], label [[CALL:%.*]]
; CHECK: call:
-; CHECK-NEXT: tail call void @free(ptr nocapture [[TMP0]]) #[[ATTR0]]
+; CHECK-NEXT: tail call void @free(ptr nocapture nonnull [[TMP0]]) #[[ATTR0]]
; CHECK-NEXT: br label [[END:%.*]]
; CHECK: rec:
; CHECK-NEXT: tail call void @free_in_scc1(ptr nocapture [[TMP0]]) #[[ATTR0]]
diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll
index 3eb43af..0b50e80 100644
--- a/llvm/test/Transforms/Attributor/nonnull.ll
+++ b/llvm/test/Transforms/Attributor/nonnull.ll
@@ -957,7 +957,7 @@
define ptr addrspace(3) @as(ptr addrspace(3) dereferenceable(4) %p) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@as
-; CHECK-SAME: (ptr addrspace(3) nofree noundef nonnull readnone returned dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] {
+; CHECK-SAME: (ptr addrspace(3) nofree noundef readnone returned dereferenceable(4) dereferenceable_or_null(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: ret ptr addrspace(3) [[P]]
;
ret ptr addrspace(3) %p
@@ -1045,8 +1045,8 @@
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-NEXT: call void @use_i32_ptr(ptr [[A]])
+; CHECK-SAME: (ptr nonnull dereferenceable(4) [[A:%.*]]) #[[ATTR11:[0-9]+]] {
+; CHECK-NEXT: call void @use_i32_ptr(ptr nonnull [[A]])
; CHECK-NEXT: ret void
;
call void @use_i32_ptr(ptr %a)
@@ -1057,8 +1057,8 @@
;
; CHECK: Function Attrs: noinline optnone
; CHECK-LABEL: define {{[^@]+}}@optnone
-; CHECK-SAME: (ptr dereferenceable(4) [[A:%.*]]) #[[ATTR12:[0-9]+]] {
-; CHECK-NEXT: call void @use_i32_ptr(ptr [[A]])
+; CHECK-SAME: (ptr nonnull dereferenceable(4) [[A:%.*]]) #[[ATTR12:[0-9]+]] {
+; CHECK-NEXT: call void @use_i32_ptr(ptr nonnull [[A]])
; CHECK-NEXT: ret void
;
call void @use_i32_ptr(ptr %a)
diff --git a/llvm/test/Transforms/Attributor/noundef.ll b/llvm/test/Transforms/Attributor/noundef.ll
index 2025f92..6fda434 100644
--- a/llvm/test/Transforms/Attributor/noundef.ll
+++ b/llvm/test/Transforms/Attributor/noundef.ll
@@ -49,11 +49,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 nonnull @argument_dead_callback_callee, ptr noalias nocapture nofree readnone 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 noundef nonnull @argument_dead_callback_callee, ptr noalias nocapture nofree noundef readnone align 4294967296 null)
; CGSCC-NEXT: ret void
;
call void @callback_broker(ptr @argument_dead_callback_callee, ptr null)
diff --git a/llvm/test/Transforms/Attributor/openmp_parallel.ll b/llvm/test/Transforms/Attributor/openmp_parallel.ll
index 6ba086a..ec31977 100644
--- a/llvm/test/Transforms/Attributor/openmp_parallel.ll
+++ b/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 nonnull @.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: 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 noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], 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]])
+; CGSCC-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB2]], i32 noundef 3, ptr noundef nonnull @.omp_outlined., ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[N_ADDR]], 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]])
; CGSCC-NEXT: ret void
;
entry:
diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
index ac4b252..bd52009 100644
--- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
+++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
@@ -77,11 +77,11 @@
; 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: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree nonnull [[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 nonnull [[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 nonnull [[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 nonnull [[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 nonnull [[N0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR3]]
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: return:
; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ]
@@ -102,11 +102,11 @@
; 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: [[CALL1:%.*]] = call ptr @external_ret2_nrw(ptr nofree nonnull [[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 nonnull [[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 nonnull [[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 nonnull [[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 nonnull [[N0]], ptr nofree nonnull align 4 dereferenceable(4) [[W0]]) #[[ATTR2]]
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: return:
; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL5]], [[IF_END]] ], [ [[N0]], [[IF_THEN]] ]
diff --git a/llvm/test/Transforms/Attributor/readattrs.ll b/llvm/test/Transforms/Attributor/readattrs.ll
index 6a98057..765ff02 100644
--- a/llvm/test/Transforms/Attributor/readattrs.ll
+++ b/llvm/test/Transforms/Attributor/readattrs.ll
@@ -333,10 +333,10 @@
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]]) #[[ATTR2]]
-; 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]]) #[[ATTR15:[0-9]+]]
+; TUNIT-SAME: (ptr nocapture nonnull readonly [[READ_ONLY:%.*]]) {
+; TUNIT-NEXT: call void @byval_not_readonly_1(ptr nocapture nonnull readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]]
+; TUNIT-NEXT: call void @byval_not_readnone_1(ptr noalias nocapture nonnull readnone byval(i8) [[READ_ONLY]])
+; TUNIT-NEXT: call void @byval_no_fnarg(ptr nocapture nofree nonnull readonly byval(i8) [[READ_ONLY]]) #[[ATTR15:[0-9]+]]
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@testbyval
diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll
index 9de7e8e..25543bf 100644
--- a/llvm/test/Transforms/Attributor/returned.ll
+++ b/llvm/test/Transforms/Attributor/returned.ll
@@ -364,16 +364,16 @@
; 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]]) #[[ATTR8]]
+; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[B]], ptr noalias nocapture nofree nonnull readnone [[A]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR8]]
; 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) #[[ATTR8]]
+; TUNIT-NEXT: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree nonnull readnone "no-capture-maybe-returned" [[B]], ptr noalias nocapture nofree readnone undef) #[[ATTR8]]
; 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]]) #[[ATTR8]]
; 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) #[[ATTR8]]
-; 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]]) #[[ATTR8]]
+; TUNIT-NEXT: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree nonnull readnone [[B]], ptr noalias nofree readnone "no-capture-maybe-returned" [[R]]) #[[ATTR8]]
; 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]]) #[[ATTR8]]
; 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) #[[ATTR8]]
; TUNIT-NEXT: br label [[RETURN]]
@@ -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 nonnull readnone [[A]], ptr noalias nofree readnone [[R]]) #[[ATTR7]]
; 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: [[CALL5:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree readnone [[A]], ptr noalias nofree nonnull 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: [[CALL8:%.*]] = call ptr @ptr_scc_r2(ptr noalias nocapture nofree readnone [[A]], ptr noalias nocapture nofree nonnull 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: [[CALL11:%.*]] = call ptr @ptr_scc_r1(ptr noalias nocapture nofree nonnull readnone [[B]], ptr noalias nofree readnone [[R]], ptr noalias nocapture nofree readnone undef) #[[ATTR7]]
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: if.end12:
; CGSCC-NEXT: [[CMP13:%.*]] = icmp eq ptr [[A]], [[B]]
@@ -1081,7 +1081,7 @@
; TUNIT: ret_arg:
; TUNIT-NEXT: ret ptr [[B]]
; TUNIT: ret_unknown:
-; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr nonnull [[B]])
; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: noinline nounwind uwtable
@@ -1093,7 +1093,7 @@
; CGSCC: ret_arg:
; CGSCC-NEXT: ret ptr [[B]]
; CGSCC: ret_unknown:
-; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr nonnull [[B]])
; CGSCC-NEXT: ret ptr [[CALL]]
;
entry:
@@ -1118,7 +1118,7 @@
; TUNIT: ret_arg:
; TUNIT-NEXT: br label [[R:%.*]]
; TUNIT: ret_unknown:
-; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; TUNIT-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr nonnull [[B]])
; TUNIT-NEXT: br label [[R]]
; TUNIT: r:
; TUNIT-NEXT: [[PHI:%.*]] = phi ptr [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
@@ -1133,7 +1133,7 @@
; CGSCC: ret_arg:
; CGSCC-NEXT: br label [[R:%.*]]
; CGSCC: ret_unknown:
-; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr [[B]])
+; CGSCC-NEXT: [[CALL:%.*]] = call ptr @unknown(ptr nonnull [[B]])
; CGSCC-NEXT: br label [[R]]
; CGSCC: r:
; CGSCC-NEXT: [[PHI:%.*]] = phi ptr [ [[B]], [[RET_ARG]] ], [ [[CALL]], [[RET_UNKNOWN]] ]
diff --git a/llvm/test/Transforms/Attributor/value-simplify-instances.ll b/llvm/test/Transforms/Attributor/value-simplify-instances.ll
index c007e31..9c0b1b7 100644
--- a/llvm/test/Transforms/Attributor/value-simplify-instances.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify-instances.ll
@@ -105,7 +105,7 @@
define internal i1 @recursive_alloca_compare(i1 %c, ptr %p) {
; 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:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-SAME: (i1 noundef [[C:%.*]], ptr noalias nofree readnone [[P:%.*]]) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: [[A:%.*]] = alloca i1, align 1
; CHECK-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
; CHECK: t:
@@ -147,7 +147,7 @@
define internal i8 @recursive_alloca_load_return(i1 %c, ptr %p, i8 %v) {
; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; 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 readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR3:[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:%.*]]
@@ -161,7 +161,7 @@
;
; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; 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 readonly [[P:%.*]], i8 noundef [[V:%.*]]) #[[ATTR2:[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:%.*]]
diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll
index f5be89e..7a427f6 100644
--- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info-struct.ll
@@ -167,12 +167,11 @@
; CHECK-NEXT: br label [[IF_END4]]
; CHECK: if.end4:
; CHECK-NEXT: [[R_1:%.*]] = phi i32 [ [[ADD3]], [[IF_THEN2]] ], [ 1, [[IF_END]] ]
-; CHECK-NEXT: br label [[IF_THEN5:%.*]]
-; CHECK: if.then5:
-; CHECK-NEXT: [[ADD6:%.*]] = add nsw i32 [[R_1]], 4
; CHECK-NEXT: br label [[IF_END7:%.*]]
+; CHECK: if.then5:
+; CHECK-NEXT: unreachable
; CHECK: if.end7:
-; CHECK-NEXT: ret i32 [[ADD6]]
+; CHECK-NEXT: ret i32 [[R_1]]
;
entry:
%i = load i32, ptr getelementptr (i32, ptr @GlobalS, i32 1), align 8
@@ -195,7 +194,7 @@
if.end4: ; preds = %if.then2, %if.end
%r.1 = phi i32 [ %add3, %if.then2 ], [ %r.0, %if.end ]
- %i2 = load ptr, ptr getelementptr (ptr, ptr @GlobalS, i32 11), align 8
+ %i2 = load ptr, ptr getelementptr (ptr, ptr @GlobalS, i32 2), align 8
%tobool = icmp ne ptr %i2, null
br i1 %tobool, label %if.then5, label %if.end7
diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
index 9ab11c3..3e57219 100644
--- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll
@@ -111,7 +111,7 @@
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-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 writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable_or_null(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] {
; 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]+]]
@@ -686,7 +686,7 @@
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-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 writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable_or_null(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] {
; 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]]
@@ -1114,7 +1114,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 writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable_or_null(24) [[AGG_RESULT:%.*]], ptr noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR1]] {
; 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]]
@@ -2689,7 +2689,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 align 4294967296 undef, ptr nofree align 4294967296 undef, ptr nofree noundef nonnull align 8 dereferenceable(24) @global) #[[ATTR24:[0-9]+]]
; CGSCC-NEXT: ret void
;
entry:
@@ -2901,7 +2901,7 @@
define internal i1 @alloca_non_unique(ptr %p, i32 %in, i1 %c) {
; TUNIT: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; 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 readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR12:[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:%.*]]
@@ -2915,7 +2915,7 @@
;
; CGSCC: Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
; 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 readonly align 4 [[P:%.*]], i32 [[IN:%.*]], i1 noundef [[C:%.*]]) #[[ATTR14:[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:%.*]]
diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll
index f55ad74..66720dd 100644
--- a/llvm/test/Transforms/Attributor/value-simplify.ll
+++ b/llvm/test/Transforms/Attributor/value-simplify.ll
@@ -430,8 +430,8 @@
define ptr @complicated_args_inalloca(ptr %arg) {
; 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-SAME: (ptr nofree nonnull readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] {
+; TUNIT-NEXT: [[CALL:%.*]] = call nonnull dereferenceable(4) ptr @test_inalloca(ptr noalias nofree nonnull writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR9:[0-9]+]]
; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
@@ -476,13 +476,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 writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable_or_null(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 writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable_or_null(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
;
@@ -502,7 +502,8 @@
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: write)
; CGSCC-LABEL: define {{[^@]+}}@complicated_args_sret
; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR5:[0-9]+]] {
-; CGSCC-NEXT: unreachable
+; CGSCC-NEXT: call void @test_sret(ptr noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable_or_null(8) null, ptr nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B]]) #[[ATTR14:[0-9]+]]
+; CGSCC-NEXT: ret void
;
call void @test_sret(ptr sret(%struct.X) null, ptr %b)
ret void
@@ -565,7 +566,7 @@
; CGSCC-LABEL: define {{[^@]+}}@complicated_args_byval
; CGSCC-SAME: () #[[ATTR3]] {
; CGSCC-NEXT: [[TMP1:%.*]] = load ptr, ptr @S, align 8
-; CGSCC-NEXT: call void @test_byval(ptr nofree writeonly [[TMP1]]) #[[ATTR14:[0-9]+]]
+; CGSCC-NEXT: call void @test_byval(ptr nofree writeonly [[TMP1]]) #[[ATTR14]]
; CGSCC-NEXT: ret void
;
call void @test_byval(ptr byval(%struct.X) @S)
@@ -1337,10 +1338,10 @@
ret void
}
define internal void @not_called3() {
-; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
-; CHECK-LABEL: define {{[^@]+}}@not_called3
-; CHECK-SAME: () #[[ATTR1]] {
-; CHECK-NEXT: ret void
+; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
+; CGSCC-LABEL: define {{[^@]+}}@not_called3
+; CGSCC-SAME: () #[[ATTR1]] {
+; CGSCC-NEXT: ret void
;
ret void
}
@@ -1356,10 +1357,9 @@
}
define i1 @user_of_not_called() {
; CHECK-LABEL: define {{[^@]+}}@user_of_not_called() {
-; CHECK-NEXT: call void @useFnDecl(ptr addrspace(42) noundef addrspacecast (ptr @not_called1 to ptr addrspace(42)))
-; CHECK-NEXT: call void @useFnDef(ptr addrspace(42) noundef addrspacecast (ptr @not_called2 to ptr addrspace(42)))
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr addrspace(42) addrspacecast (ptr @not_called3 to ptr addrspace(42)), null
-; CHECK-NEXT: ret i1 [[CMP]]
+; CHECK-NEXT: call void @useFnDecl(ptr addrspace(42) noundef nonnull addrspacecast (ptr @not_called1 to ptr addrspace(42)))
+; CHECK-NEXT: call void @useFnDef(ptr addrspace(42) noundef nonnull addrspacecast (ptr @not_called2 to ptr addrspace(42)))
+; CHECK-NEXT: ret i1 false
;
call void @useFnDecl(ptr addrspace(42) addrspacecast (ptr @not_called1 to ptr addrspace(42)))
call void @useFnDef(ptr addrspace(42) addrspacecast (ptr @not_called2 to ptr addrspace(42)))
@@ -1419,7 +1419,7 @@
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@constexpr_icmp1
; CHECK-SAME: () #[[ATTR1]] {
-; CHECK-NEXT: ret i1 true
+; CHECK-NEXT: ret i1 icmp ne (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null)
;
ret i1 icmp ne (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null)
}
@@ -1428,7 +1428,7 @@
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CHECK-LABEL: define {{[^@]+}}@constexpr_icmp2
; CHECK-SAME: () #[[ATTR1]] {
-; CHECK-NEXT: ret i1 false
+; CHECK-NEXT: ret i1 icmp eq (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null)
;
ret i1 icmp eq (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null)
}
diff --git a/llvm/test/Transforms/OpenMP/parallel_deletion.ll b/llvm/test/Transforms/OpenMP/parallel_deletion.ll
index 731265f..c1d8bcb 100644
--- a/llvm/test/Transforms/OpenMP/parallel_deletion.ll
+++ b/llvm/test/Transforms/OpenMP/parallel_deletion.ll
@@ -26,7 +26,7 @@
define void @delete_parallel_0() {
; CHECK-LABEL: define {{[^@]+}}@delete_parallel_0() {
; CHECK-NEXT: entry:
-; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0:[0-9]+]], i32 noundef 0, ptr noundef @.omp_outlined.willreturn)
+; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0:[0-9]+]], i32 noundef 0, ptr noundef nonnull @.omp_outlined.willreturn)
; CHECK-NEXT: ret void
;
; CHECK1-LABEL: define {{[^@]+}}@delete_parallel_0() {
@@ -144,9 +144,9 @@
define void @delete_parallel_1() {
; CHECK-LABEL: define {{[^@]+}}@delete_parallel_1() {
; CHECK-NEXT: entry:
-; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef @.omp_outlined.)
-; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef @.omp_outlined..0)
-; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef @.omp_outlined..1)
+; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef nonnull @.omp_outlined.)
+; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef nonnull @.omp_outlined..0)
+; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB0]], i32 noundef 0, ptr noundef nonnull @.omp_outlined..1)
; CHECK-NEXT: ret void
;
; CHECK1-LABEL: define {{[^@]+}}@delete_parallel_1() {
@@ -282,12 +282,12 @@
; 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]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 dereferenceable(4) [[A]]) #[[ATTR15:[0-9]+]]
; 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]])
-; 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..5, 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..6, ptr nocapture 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 nonnull @.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 nonnull @.omp_outlined..4, 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 nonnull @.omp_outlined..5, 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 nonnull @.omp_outlined..6, ptr nocapture noundef nonnull align 4 dereferenceable(4) [[A]])
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[A]])
; CHECK-NEXT: ret void
;
@@ -329,7 +329,7 @@
; 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-NEXT: entry:
-; CHECK-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR15:[0-9]+]]
+; CHECK-NEXT: [[CALL:%.*]] = call i32 @omp_get_thread_num() #[[ATTR16:[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]]) #[[ATTR15]]
+; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull @[[GLOB0]]) #[[ATTR16]]
; 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]]) #[[ATTR16:[0-9]+]]
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull align 4 [[A1]]) #[[ATTR17:[0-9]+]]
; 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
diff --git a/llvm/test/Transforms/OpenMP/parallel_region_merging.ll b/llvm/test/Transforms/OpenMP/parallel_region_merging.ll
index 1ab939b..f169fea 100644
--- a/llvm/test/Transforms/OpenMP/parallel_region_merging.ll
+++ b/llvm/test/Transforms/OpenMP/parallel_region_merging.ll
@@ -4742,8 +4742,8 @@
; 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 nonnull @.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 nonnull @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -4770,8 +4770,8 @@
; 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 nonnull @.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 nonnull @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -4796,9 +4796,9 @@
; 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 nonnull @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly 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 nonnull @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -5701,11 +5701,11 @@
; 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 nonnull @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly 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 nonnull @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly 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 nonnull @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -5739,10 +5739,10 @@
; 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 nonnull @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly 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 nonnull @.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 nonnull @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -5776,10 +5776,10 @@
; 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 nonnull @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly 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 nonnull @.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 nonnull @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
@@ -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 nonnull @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
; CHECK2-NEXT: ret void
;
;
diff --git a/llvm/test/Transforms/OpenMP/value-simplify-openmp-opt.ll b/llvm/test/Transforms/OpenMP/value-simplify-openmp-opt.ll
index 2cc1294..148a971 100644
--- a/llvm/test/Transforms/OpenMP/value-simplify-openmp-opt.ll
+++ b/llvm/test/Transforms/OpenMP/value-simplify-openmp-opt.ll
@@ -147,7 +147,7 @@
define void @test_assume() {
; CHECK-LABEL: define {{[^@]+}}@test_assume() {
-; CHECK-NEXT: call void @llvm.assume(i1 true)
+; CHECK-NEXT: call void @llvm.assume(i1 icmp ne (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null))
; CHECK-NEXT: ret void
;
call void @llvm.assume(i1 icmp ne (ptr addrspacecast (ptr addrspace(4) @str to ptr), ptr null))