Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,14 +767,17 @@ 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 @@ -833,6 +836,12 @@ 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 @@ -847,9 +856,6 @@ 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
Loading