@@ -358,7 +358,7 @@ struct AAUniformWorkGroupSizeFunction : public AAUniformWorkGroupSize {
358
358
359
359
const auto *CallerInfo = A.getAAFor <AAUniformWorkGroupSize>(
360
360
*this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
361
- if (!CallerInfo)
361
+ if (!CallerInfo || !CallerInfo-> isValidState () )
362
362
return false ;
363
363
364
364
Change = Change | clampStateAndIndicateChange (this ->getState (),
@@ -449,7 +449,8 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
449
449
// Check for Intrinsics and propagate attributes.
450
450
const AACallEdges *AAEdges = A.getAAFor <AACallEdges>(
451
451
*this , this ->getIRPosition (), DepClassTy::REQUIRED);
452
- if (!AAEdges || AAEdges->hasNonAsmUnknownCallee ())
452
+ if (!AAEdges || !AAEdges->isValidState () ||
453
+ AAEdges->hasNonAsmUnknownCallee ())
453
454
return indicatePessimisticFixpoint ();
454
455
455
456
bool IsNonEntryFunc = !AMDGPU::isEntryFunctionCC (F->getCallingConv ());
@@ -465,7 +466,7 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
465
466
if (IID == Intrinsic::not_intrinsic) {
466
467
const AAAMDAttributes *AAAMD = A.getAAFor <AAAMDAttributes>(
467
468
*this , IRPosition::function (*Callee), DepClassTy::REQUIRED);
468
- if (!AAAMD)
469
+ if (!AAAMD || !AAAMD-> isValidState () )
469
470
return indicatePessimisticFixpoint ();
470
471
*this &= *AAAMD;
471
472
continue ;
@@ -660,7 +661,7 @@ struct AAAMDAttributesFunction : public AAAMDAttributes {
660
661
661
662
const auto *PointerInfoAA = A.getAAFor <AAPointerInfo>(
662
663
*this , IRPosition::callsite_returned (Call), DepClassTy::REQUIRED);
663
- if (!PointerInfoAA)
664
+ if (!PointerInfoAA || !PointerInfoAA-> getState (). isValidState () )
664
665
return false ;
665
666
666
667
return PointerInfoAA->forallInterferingAccesses (
@@ -717,7 +718,7 @@ struct AAAMDSizeRangeAttribute
717
718
718
719
const auto *CallerInfo = A.getAAFor <AttributeImpl>(
719
720
*this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
720
- if (!CallerInfo)
721
+ if (!CallerInfo || !CallerInfo-> isValidState () )
721
722
return false ;
722
723
723
724
Change |=
@@ -835,7 +836,8 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
835
836
auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
836
837
837
838
if (const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
838
- *this , IRPosition::function (*F), DepClassTy::REQUIRED)) {
839
+ *this , IRPosition::function (*F), DepClassTy::REQUIRED);
840
+ AssumedGroupSize->isValidState ()) {
839
841
840
842
unsigned Min, Max;
841
843
std::tie (Min, Max) = InfoCache.getWavesPerEU (
@@ -864,7 +866,8 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
864
866
*this , IRPosition::function (*Caller), DepClassTy::REQUIRED);
865
867
const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
866
868
*this , IRPosition::function (*Func), DepClassTy::REQUIRED);
867
- if (!CallerInfo || !AssumedGroupSize)
869
+ if (!CallerInfo || !AssumedGroupSize || !CallerInfo->isValidState () ||
870
+ !AssumedGroupSize->isValidState ())
868
871
return false ;
869
872
870
873
unsigned Min, Max;
@@ -982,7 +985,8 @@ struct AAAMDGPUNoAGPR
982
985
// TODO: Handle callsite attributes
983
986
const auto *CalleeInfo = A.getAAFor <AAAMDGPUNoAGPR>(
984
987
*this , IRPosition::function (*Callee), DepClassTy::REQUIRED);
985
- return CalleeInfo && CalleeInfo->getAssumed ();
988
+ return CalleeInfo && CalleeInfo->isValidState () &&
989
+ CalleeInfo->getAssumed ();
986
990
};
987
991
988
992
bool UsedAssumedInformation = false ;
0 commit comments