From 50dc80680e8ecfce202ed9ea50303e6613e97ef5 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Tue, 14 Jul 2020 14:18:15 +0100 Subject: [PATCH] [AMDGPU] Simplify AMDGPUSubtarget::getWavesPerEU. NFC. --- lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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