llvmpipe: Enable mem2reg pass even with LP_DEBUG=nopt.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 12 May 2010 19:04:11 +0000 (20:04 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 12 May 2010 19:18:32 +0000 (20:18 +0100)
Otherwise things start crashing.

src/gallium/drivers/llvmpipe/lp_jit.c

index b10ee7a463a3d1f258051b5db03ca2ef30208472..243aea6c3a3c092eb7b8b9ef2f193d658699229b 100644 (file)
@@ -195,6 +195,11 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
          LLVMAddInstructionCombiningPass(screen->pass);
       }
       LLVMAddGVNPass(screen->pass);
+   } else {
+      /* We need at least this pass to prevent the backends to fail in
+       * unexpected ways.
+       */
+      LLVMAddPromoteMemoryToRegisterPass(screen->pass);
    }
 
    lp_jit_init_globals(screen);