amd/llvm: switch to 3-spaces style Follow-up of !4319 using the same clang-format config. Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5310>
ac/llvm: add better code for fsign There are 2 improvements: - better code for 16, 32, and 64 bits - vector support for 16 and 32 bits Totals: SGPRS: 2639738 -> 2625882 (-0.52 %) VGPRS: 1534120 -> 1533916 (-0.01 %) Spilled SGPRs: 3541 -> 3557 (0.45 %) Spilled VGPRs: 33 -> 33 (0.00 %) Private memory VGPRs: 256 -> 256 (0.00 %) Scratch size: 292 -> 292 (0.00 %) dwords per thread Code Size: 55640332 -> 55384892 (-0.46 %) bytes Max Waves: 964785 -> 964857 (0.01 %) Totals from affected shaders: SGPRS: 377352 -> 363496 (-3.67 %) VGPRS: 209800 -> 209596 (-0.10 %) Spilled SGPRs: 1979 -> 1995 (0.81 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 256 -> 256 (0.00 %) Scratch size: 256 -> 256 (0.00 %) dwords per thread Code Size: 12549300 -> 12293860 (-2.04 %) bytes Max Waves: 105762 -> 105834 (0.07 %) Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6284>
Revert "ac: generate FMA for inexact instructions for radeonsi" This reverts commit 4b9370cb0f3a2d9030e827f847f66bdefeaf08fd. Fixes: 4b9370cb0f3a2d9030e827f847f66bdefeaf08fd Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3429 Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6284>
ac/llvm: handle static/shared llvm init separately Having a single init function works as expected for shared llvm, but when using a static llvm only one llvm will get initialized. This commit introduces 2 separate init function: - shared llvm = single public init function - static llvm = one init function for each module using llvm Fixes: 50d20dc055d ("ac/llvm: export ac_init_llvm_once in targets") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3376 Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6253>
amd/llvm: Mark pointer function arguments as 32-byte aligned. Otherwise LLVM does not see the pointers as allowing speculative loads. The pipeline-db results are pretty wild, but mostly what is to be expected from allowing more code movement in LLVM: Totals from affected shaders: SGPRS: 157728 -> 168336 (6.73 %) VGPRS: 158628 -> 158664 (0.02 %) Spilled SGPRs: 10845 -> 24753 (128.24 %) Spilled VGPRs: 13 -> 13 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 8 -> 8 (0.00 %) dwords per thread Code Size: 17189180 -> 17313712 (0.72 %) bytes LDS: 204 -> 204 (0.00 %) blocks Max Waves: 5700 -> 5687 (-0.23 %) Wait states: 0 -> 0 (0.00 %) This gives some boosts for shaders we can move a descriptor load outside a loop. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3159>
radv: remove the load/store workaround for Monster Hunter World with LLVM Now that ACO is default, this is pointless. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5658>
Revert "ac,radeonsi: fix compilations issues with LLVM 11" This reverts commit 42b1696ef627a5bfee29911a780fa0a4dbf04610. The corresponding LLVM changes were reverted. Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5087>
ac,radeonsi: fix compilations issues with LLVM 11 Latest LLVM replaced LLVMVectorTypeKind. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2826 Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4755>
ac: generate FMA for inexact instructions for radeonsi NIR mostly does this already. Totals: SGPRS: 2588520 -> 2591784 (0.13 %) VGPRS: 1666984 -> 1666888 (-0.01 %) Spilled SGPRs: 4074 -> 4131 (1.40 %) Spilled VGPRs: 38 -> 38 (0.00 %) Private memory VGPRs: 2176 -> 2176 (0.00 %) Scratch size: 2228 -> 2228 (0.00 %) dwords per thread Code Size: 52726872 -> 52715468 (-0.02 %) bytes LDS: 92 -> 92 (0.00 %) blocks Max Waves: 479872 -> 479897 (0.01 %) Wait states: 0 -> 0 (0.00 %) Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4696>
ac: update and document fast math flags used by radeonsi This should have no effect, because we never use FP division, but it's safer for the future. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4696>
radeonsi: remove AMD_DEBUG=sisched option sisched is not maintained anymore in LLVM. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4059> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4059>
radv: remove useless RADV_DEBUG=unsafemath debug option This option is useless and shouldn't be used at all. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
ac/llvm: add AC_FLOAT_MODE_ROUND_TO_ZERO Because some instructions will be optimized by the backend compiler, the driver has to manually flush to zero to keep the result exact. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
amd: Move all amd/common code that depends on LLVM to amd/llvm. This commit is a step towards the goal of being able to build RADV without LLVM. In the future we would like to offer the option to use RADV solely with ACO. There is still a need for the common AMD code located in amd/common but the LLVM specific parts need to be separated. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>