gallivm: Add an alternative to LLVMDumpValue that works with Windows GUI apps.
[mesa.git] / src / gallium / drivers / llvmpipe / lp_jit.c
index 466a2f54fbe29f8ea4e11c9eca599e2c8de55f7f..b10ee7a463a3d1f258051b5db03ca2ef30208472 100644 (file)
@@ -151,9 +151,8 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
       screen->context_ptr_type = LLVMPointerType(context_type, 0);
    }
 
-#ifdef DEBUG
-   LLVMDumpModule(screen->module);
-#endif
+   if (LP_DEBUG & DEBUG_JIT)
+      LLVMDumpModule(screen->module);
 }
 
 
@@ -185,6 +184,8 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
       /* These are the passes currently listed in llvm-c/Transforms/Scalar.h,
        * but there are more on SVN. */
       /* TODO: Add more passes */
+      LLVMAddCFGSimplificationPass(screen->pass);
+      LLVMAddPromoteMemoryToRegisterPass(screen->pass);
       LLVMAddConstantPropagationPass(screen->pass);
       if(util_cpu_caps.has_sse4_1) {
          /* FIXME: There is a bug in this pass, whereby the combination of fptosi
@@ -193,9 +194,7 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
           */
          LLVMAddInstructionCombiningPass(screen->pass);
       }
-      LLVMAddPromoteMemoryToRegisterPass(screen->pass);
       LLVMAddGVNPass(screen->pass);
-      LLVMAddCFGSimplificationPass(screen->pass);
    }
 
    lp_jit_init_globals(screen);