llvmpipe: First verify LLVM IR, only then run optimizing passes.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 29 Sep 2009 16:22:39 +0000 (17:22 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 29 Sep 2009 16:28:15 +0000 (17:28 +0100)
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 9faed5a0b18894d17da4f2a9b69f9ee7a5b84daa..d5ce6993c5d1fbdc55de381c5796de7de0f7b5c7 100644 (file)
@@ -582,6 +582,11 @@ generate_fragment(struct llvmpipe_context *lp,
     * Translate the LLVM IR into machine code.
     */
 
+   if(LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
+      LLVMDumpValue(variant->function);
+      abort();
+   }
+
    LLVMRunFunctionPassManager(screen->pass, variant->function);
 
 #ifdef DEBUG
@@ -589,11 +594,6 @@ generate_fragment(struct llvmpipe_context *lp,
    debug_printf("\n");
 #endif
 
-   if(LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
-      LLVMDumpValue(variant->function);
-      abort();
-   }
-
    variant->jit_function = (lp_jit_frag_func)LLVMGetPointerToGlobal(screen->engine, variant->function);
 
 #ifdef DEBUG