Skip to content

Commit

Permalink
Revert "[NFC][AMDGPU][Attributor] Exit earlier if entry CC (llvm#114177
Browse files Browse the repository at this point in the history
…)"

This reverts commit 922a0d3.
  • Loading branch information
shiltian committed Oct 30, 2024
1 parent 922a0d3 commit 9a7519f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,17 +767,14 @@ struct AAAMDFlatWorkGroupSize : public AAAMDSizeRangeAttribute {

void initialize(Attributor &A) override {
Function *F = getAssociatedFunction();

if (AMDGPU::isEntryFunctionCC(F->getCallingConv())) {
indicatePessimisticFixpoint();
return;
}

auto &InfoCache = static_cast<AMDGPUInformationCache &>(A.getInfoCache());
unsigned MinGroupSize, MaxGroupSize;
std::tie(MinGroupSize, MaxGroupSize) = InfoCache.getFlatWorkGroupSizes(*F);
intersectKnown(
ConstantRange(APInt(32, MinGroupSize), APInt(32, MaxGroupSize + 1)));

if (AMDGPU::isEntryFunctionCC(F->getCallingConv()))
indicatePessimisticFixpoint();
}

ChangeStatus updateImpl(Attributor &A) override {
Expand Down Expand Up @@ -836,12 +833,6 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {

void initialize(Attributor &A) override {
Function *F = getAssociatedFunction();

if (AMDGPU::isEntryFunctionCC(F->getCallingConv())) {
indicatePessimisticFixpoint();
return;
}

auto &InfoCache = static_cast<AMDGPUInformationCache &>(A.getInfoCache());

if (const auto *AssumedGroupSize = A.getAAFor<AAAMDFlatWorkGroupSize>(
Expand All @@ -856,6 +847,9 @@ struct AAAMDWavesPerEU : public AAAMDSizeRangeAttribute {
ConstantRange Range(APInt(32, Min), APInt(32, Max + 1));
intersectKnown(Range);
}

if (AMDGPU::isEntryFunctionCC(F->getCallingConv()))
indicatePessimisticFixpoint();
}

ChangeStatus updateImpl(Attributor &A) override {
Expand Down

0 comments on commit 9a7519f

Please sign in to comment.