@@ -767,17 +767,14 @@ struct AAAMDFlatWorkGroupSize : public AAAMDSizeRangeAttribute {
767
767
768
768
void initialize (Attributor &A) override {
769
769
Function *F = getAssociatedFunction ();
770
-
771
- if (AMDGPU::isEntryFunctionCC (F->getCallingConv ())) {
772
- indicatePessimisticFixpoint ();
773
- return ;
774
- }
775
-
776
770
auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
777
771
unsigned MinGroupSize, MaxGroupSize;
778
772
std::tie (MinGroupSize, MaxGroupSize) = InfoCache.getFlatWorkGroupSizes (*F);
779
773
intersectKnown (
780
774
ConstantRange (APInt (32 , MinGroupSize), APInt (32 , MaxGroupSize + 1 )));
775
+
776
+ if (AMDGPU::isEntryFunctionCC (F->getCallingConv ()))
777
+ indicatePessimisticFixpoint ();
781
778
}
782
779
783
780
ChangeStatus updateImpl (Attributor &A) override {
@@ -836,12 +833,6 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
836
833
837
834
void initialize (Attributor &A) override {
838
835
Function *F = getAssociatedFunction ();
839
-
840
- if (AMDGPU::isEntryFunctionCC (F->getCallingConv ())) {
841
- indicatePessimisticFixpoint ();
842
- return ;
843
- }
844
-
845
836
auto &InfoCache = static_cast <AMDGPUInformationCache &>(A.getInfoCache ());
846
837
847
838
if (const auto *AssumedGroupSize = A.getAAFor <AAAMDFlatWorkGroupSize>(
@@ -856,6 +847,9 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
856
847
ConstantRange Range (APInt (32 , Min), APInt (32 , Max + 1 ));
857
848
intersectKnown (Range);
858
849
}
850
+
851
+ if (AMDGPU::isEntryFunctionCC (F->getCallingConv ()))
852
+ indicatePessimisticFixpoint ();
859
853
}
860
854
861
855
ChangeStatus updateImpl (Attributor &A) override {
0 commit comments