diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-08-27 12:34:40 -0400 |
---|---|---|
committer | Matt Arsenault <arsenm2@gmail.com> | 2019-11-13 07:11:02 +0530 |
commit | 4b472139513ba460595804f8113497844b41fbcc (patch) | |
tree | 3b9cdac709fc3a0239a04c863dafda580d440f4a /llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | |
parent | 25c5da5a426168b38fb3e9baa918faa75e4a92b4 (diff) | |
download | bcm5719-llvm-4b472139513ba460595804f8113497844b41fbcc.tar.gz bcm5719-llvm-4b472139513ba460595804f8113497844b41fbcc.zip |
AMDGPU: Switch backend default max workgroup size to 1024
Previously this would default to 256, not the maximum supported size
of 1024. Using a maximum lower than the hardware maximum requires
language runtimes to enforce this limit for correctness, which no
language has correctly done. Switch the default to the conservatively
correct maximum, and force frontends to opt-in to the more optimal 256
default maximum.
I don't really understand why the changes in occupancy-levels.ll
increased the computed occupancy, which I expected to decrease. I'm
not sure if these tests should be forcing the old maximum.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp index 46e4d76367f..9a726c320ff 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp @@ -343,11 +343,6 @@ AMDGPUSubtarget::getOccupancyWithLocalMemSize(const MachineFunction &MF) const { std::pair<unsigned, unsigned> AMDGPUSubtarget::getDefaultFlatWorkGroupSize(CallingConv::ID CC) const { switch (CC) { - case CallingConv::AMDGPU_CS: - case CallingConv::AMDGPU_KERNEL: - case CallingConv::SPIR_KERNEL: - return std::make_pair(getWavefrontSize() * 2, - std::max(getWavefrontSize() * 4, 256u)); case CallingConv::AMDGPU_VS: case CallingConv::AMDGPU_LS: case CallingConv::AMDGPU_HS: @@ -356,13 +351,12 @@ AMDGPUSubtarget::getDefaultFlatWorkGroupSize(CallingConv::ID CC) const { case CallingConv::AMDGPU_PS: return std::make_pair(1, getWavefrontSize()); default: - return std::make_pair(1, 16 * getWavefrontSize()); + return std::make_pair(1u, getMaxFlatWorkGroupSize()); } } std::pair<unsigned, unsigned> AMDGPUSubtarget::getFlatWorkGroupSizes( const Function &F) const { - // FIXME: 1024 if function. // Default minimum/maximum flat work group sizes. std::pair<unsigned, unsigned> Default = getDefaultFlatWorkGroupSize(F.getCallingConv()); |