diff --git a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index 2849645863a..213788ae0f6 100644 --- a/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -411,11 +411,8 @@ std::pair AMDGPUSubtarget::getWavesPerEU( unsigned MinImpliedByFlatWorkGroupSize = getWavesPerEUForWorkGroup(FlatWorkGroupSizes.second); Default.first = MinImpliedByFlatWorkGroupSize; - bool RequestedFlatWorkGroupSize = false; - - if (F.hasFnAttribute("amdgpu-flat-work-group-size")) { - RequestedFlatWorkGroupSize = true; - } + bool RequestedFlatWorkGroupSize = + F.hasFnAttribute("amdgpu-flat-work-group-size"); // Requested minimum/maximum number of waves per execution unit. std::pair Requested = AMDGPU::getIntegerPairAttribute( @@ -427,9 +424,7 @@ std::pair AMDGPUSubtarget::getWavesPerEU( // Make sure requested values do not violate subtarget's specifications. if (Requested.first < getMinWavesPerEU() || - Requested.first > getMaxWavesPerEU()) - return Default; - if (Requested.second > getMaxWavesPerEU()) + Requested.second > getMaxWavesPerEU()) return Default; // Make sure requested values are compatible with values implied by requested