radeon/llvm: enable LICM and DCE pass v2
authorChristian König <christian.koenig@amd.com>
Wed, 27 Feb 2013 21:40:24 +0000 (22:40 +0100)
committerChristian König <christian.koenig@amd.com>
Thu, 7 Mar 2013 09:03:22 +0000 (10:03 +0100)
LICM stands for Loop Invariant Code Motion. Instructions that
does not depend of loop index are moved outside of loop body.

DCE is DeadCodeElimination.

v2: updated commit msg, thx to Vincent.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c

index f7b758670dd571d3837d51d0e3c727575c775238..f017b873217b67841e228c7b93f6bb76a70d051a 100644 (file)
@@ -1281,6 +1281,8 @@ void radeon_llvm_finalize_module(struct radeon_llvm_context * ctx)
 
        /* Add some optimization passes */
        LLVMAddScalarReplAggregatesPass(gallivm->passmgr);
+       LLVMAddLICMPass(gallivm->passmgr);
+       LLVMAddAggressiveDCEPass(gallivm->passmgr);
        LLVMAddCFGSimplificationPass(gallivm->passmgr);
 
        /* Run the passs */