Module: Mesa
Branch: main
Commit: bc7e363f8e1a26342e6fd7241c1f0ebb722338d6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc7e363f8e1a26342e6fd7241c1f0ebb722338d6

Author: Kai Wasserbäch <k...@dev.carbon-project.org>
Date:   Wed Nov 22 20:21:11 2023 +0100

fix: ac/llvm: LLVM 18: remove useless passes, partially removed upstream

Upstream removed llvm::createLoopSinkPass() in commit
<https://github.com/llvm/llvm-project/commit/b9975cec0ea0a2f10d65b7bd1197d9e1706cbd3d>
and there is no useful alternative except moving to the new pass
manager.

On top of that, the usage of this optimisation pass and
PromoteMemoryToRegisterPass were just useless, according to the
upstream developer of the commit named above. Therefore the easiest
solution is, as him, Marek and Dave suggested, to just remove these two
passes from the pipeline for now.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10192
Reference: https://github.com/llvm/llvm-project/pull/72811
Reference: 
https://github.com/llvm/llvm-project/commit/b9975cec0ea0a2f10d65b7bd1197d9e1706cbd3d
Suggested-by: Dave Airlie <airl...@redhat.com>
Suggested-by: Aiden Grossman <agrossman...@yahoo.com>
Suggested-by: Marek Olšák <mar...@gmail.com>
Signed-off-by: Kai Wasserbäch <k...@dev.carbon-project.org>
Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26336>

---

 src/amd/llvm/ac_llvm_helper.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/amd/llvm/ac_llvm_helper.cpp b/src/amd/llvm/ac_llvm_helper.cpp
index 40a4399e705..5d065279ad1 100644
--- a/src/amd/llvm/ac_llvm_helper.cpp
+++ b/src/amd/llvm/ac_llvm_helper.cpp
@@ -299,17 +299,12 @@ LLVMPassManagerRef 
ac_create_passmgr(LLVMTargetLibraryInfoRef target_library_inf
     */
    unwrap(passmgr)->add(createBarrierNoopPass());
 
-   /* This pass eliminates all loads and stores on alloca'd pointers. */
-   unwrap(passmgr)->add(createPromoteMemoryToRegisterPass());
    #if LLVM_VERSION_MAJOR >= 16
    unwrap(passmgr)->add(createSROAPass(true));
    #else
    unwrap(passmgr)->add(createSROAPass());
    #endif
    /* TODO: restore IPSCCP */
-   if (LLVM_VERSION_MAJOR >= 16)
-      unwrap(passmgr)->add(createLoopSinkPass());
-   /* TODO: restore IPSCCP */
    unwrap(passmgr)->add(createLICMPass());
    unwrap(passmgr)->add(createCFGSimplificationPass());
    /* This is recommended by the instruction combining pass. */

Reply via email to