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