Mesa (master): gallivm: remove LICM pass

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Apr 24 02:50:09 UTC 2018


Module: Mesa
Branch: master
Commit: 45b8f620a545bcdb8a4942bafd505c9418f6d9f2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=45b8f620a545bcdb8a4942bafd505c9418f6d9f2

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Mon Apr 23 04:39:00 2018 +0200

gallivm: remove LICM pass

LICM is simply too expensive, even though it presumably can help quite
a bit in some cases.
It was definitely cheaper in llvm 3.3, though as far as I can tell with
llvm 3.3 it failed to do anything in most cases. early-cse also actually
seems to cause licm to be able to move things when it previously couldn't,
which causes noticeable compile time increases.
There's more loop passes in llvm, but I'm not sure which ones are helpful,
and I couldn't find anything which would roughly do what the old licm in
llvm 3.3 did, so ditch it.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_init.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index ca36b467ca..a9968649c0 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -144,7 +144,15 @@ create_pass_manager(struct gallivm_state *gallivm)
       LLVMAddScalarReplAggregatesPass(gallivm->passmgr);
       LLVMAddEarlyCSEPass(gallivm->passmgr);
       LLVMAddCFGSimplificationPass(gallivm->passmgr);
-      LLVMAddLICMPass(gallivm->passmgr);
+      /*
+       * FIXME: LICM is potentially quite useful. However, for some
+       * rather crazy shaders the compile time can reach _hours_ per shader,
+       * due to licm implying lcssa (since llvm 3.5), which can take forever.
+       * Even for sane shaders, the cost of licm is rather high (and not just
+       * due to lcssa, licm itself too), though mostly only in cases when it
+       * can actually move things, so having to disable it is a pity.
+       * LLVMAddLICMPass(gallivm->passmgr);
+       */
       LLVMAddReassociatePass(gallivm->passmgr);
       LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
       LLVMAddConstantPropagationPass(gallivm->passmgr);




More information about the mesa-commit mailing list