@@ -358,7 +358,7 @@ struct AAUniformWorkGroupSizeFunction : public AAUniformWorkGroupSize {
358358
359359 const auto *CallerInfo = A.getAAFor <AAUniformWorkGroupSize>(
360360 *this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
361- if (!CallerInfo)
361+ if (!CallerInfo || !CallerInfo-> isValidState () )
362362 return false ;
363363
364364 Change = Change | clampStateAndIndicateChange (this ->getState (),
@@ -449,7 +449,8 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
449449 // Check for Intrinsics and propagate attributes.
450450 const AACallEdges *AAEdges = A.getAAFor <AACallEdges>(
451451 *this , this ->getIRPosition (), DepClassTy::REQUIRED);
452- if (!AAEdges || AAEdges->hasNonAsmUnknownCallee ())
452+ if (!AAEdges || !AAEdges->isValidState () ||
453+ AAEdges->hasNonAsmUnknownCallee ())
453454 return indicatePessimisticFixpoint ();
454455
455456 bool IsNonEntryFunc = !AMDGPU::isEntryFunctionCC (F->getCallingConv ());
@@ -465,7 +466,7 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
465466 if (IID == Intrinsic::not_intrinsic) {
466467 const AAAMDAttributes *AAAMD = A.getAAFor <AAAMDAttributes>(
467468 *this , IRPosition::function (*Callee), DepClassTy::REQUIRED);
468- if (!AAAMD)
469+ if (!AAAMD || !AAAMD-> isValidState () )
469470 return indicatePessimisticFixpoint ();
470471 *this &= *AAAMD;
471472 continue ;
@@ -660,7 +661,7 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
660661
661662 const auto *PointerInfoAA = A.getAAFor <AAPointerInfo>(
662663 *this , IRPosition::callsite_returned (Call), DepClassTy::REQUIRED);
663- if (!PointerInfoAA)
664+ if (!PointerInfoAA || !PointerInfoAA-> getState (). isValidState () )
664665 return false ;
665666
666667 return PointerInfoAA->forallInterferingAccesses (
@@ -717,7 +718,7 @@ struct AAAMDSizeRangeAttribute
717718
718719 const auto *CallerInfo = A.getAAFor <AttributeImpl>(
719720 *this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
720- if (!CallerInfo)
721+ if (!CallerInfo || !CallerInfo-> isValidState () )
721722 return false ;
722723
723724 Change |=
@@ -835,7 +836,8 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
835836 auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
836837
837838 if (const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
838- *this , IRPosition::function (*F), DepClassTy::REQUIRED)) {
839+ *this , IRPosition::function (*F), DepClassTy::REQUIRED);
840+ AssumedGroupSize->isValidState ()) {
839841
840842 unsigned Min, Max;
841843 std::tie (Min, Max) = InfoCache.getWavesPerEU (
@@ -864,7 +866,8 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
864866 *this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
865867 const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
866868 *this , IRPosition::function (*Func), DepClassTy::REQUIRED);
867- if (!CallerInfo || !AssumedGroupSize)
869+ if (!CallerInfo || !AssumedGroupSize || !CallerInfo->isValidState () ||
870+ !AssumedGroupSize->isValidState ())
868871 return false ;
869872
870873 unsigned Min, Max;
@@ -982,7 +985,8 @@ struct AAAMDGPUNoAGPR
982985 // TODO: Handle callsite attributes
983986 const auto *CalleeInfo = A.getAAFor <AAAMDGPUNoAGPR>(
984987 *this , IRPosition::function (*Callee), DepClassTy::REQUIRED);
985- return CalleeInfo && CalleeInfo->getAssumed ();
988+ return CalleeInfo && CalleeInfo->isValidState () &&
989+ CalleeInfo->getAssumed ();
986990 };
987991
988992 bool UsedAssumedInformation = false ;
0 commit comments