@@ -767,17 +767,14 @@ struct AAAMDFlatWorkGroupSize : public AAAMDSizeRangeAttribute {
767767
768768 void initialize (Attributor &A) override {
769769 Function *F = getAssociatedFunction ();
770-
771- if (AMDGPU::isEntryFunctionCC (F->getCallingConv ())) {
772- indicatePessimisticFixpoint ();
773- return ;
774- }
775-
776770 auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
777771 unsigned MinGroupSize, MaxGroupSize;
778772 std::tie (MinGroupSize, MaxGroupSize) = InfoCache.getFlatWorkGroupSizes (*F);
779773 intersectKnown (
780774 ConstantRange (APInt (32 , MinGroupSize), APInt (32 , MaxGroupSize + 1 )));
775+
776+ if (AMDGPU::isEntryFunctionCC (F->getCallingConv ()))
777+ indicatePessimisticFixpoint ();
781778 }
782779
783780 ChangeStatus updateImpl (Attributor &A) override {
@@ -836,12 +833,6 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
836833
837834 void initialize (Attributor &A) override {
838835 Function *F = getAssociatedFunction ();
839-
840- if (AMDGPU::isEntryFunctionCC (F->getCallingConv ())) {
841- indicatePessimisticFixpoint ();
842- return ;
843- }
844-
845836 auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
846837
847838 if (const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
@@ -856,6 +847,9 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
856847 ConstantRange Range (APInt (32 , Min), APInt (32 , Max + 1 ));
857848 intersectKnown (Range);
858849 }
850+
851+ if (AMDGPU::isEntryFunctionCC (F->getCallingConv ()))
852+ indicatePessimisticFixpoint ();
859853 }
860854
861855 ChangeStatus updateImpl (Attributor &A) override {
0 commit comments