[Mesa-dev] [PATCH] gallivm: print declarations of intrinsics with GALLIVM_DEBUG=ir

sroland at vmware.com sroland at vmware.com
Tue May 10 01:50:28 UTC 2016


From: Roland Scheidegger <sroland at vmware.com>

Those aren't really interesting, however outputting them is helpful when
trying to feed the IR to llvm llc (or opt) for debugging.
---
 src/gallium/auxiliary/gallivm/lp_bld_intr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_intr.c b/src/gallium/auxiliary/gallivm/lp_bld_intr.c
index f806503..0a8f996 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_intr.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_intr.c
@@ -51,6 +51,7 @@
 #include "lp_bld_intr.h"
 #include "lp_bld_type.h"
 #include "lp_bld_pack.h"
+#include "lp_bld_debug.h"
 
 
 void
@@ -146,6 +147,10 @@ lp_build_intrinsic(LLVMBuilderRef builder,
 
       if (attr)
           LLVMAddFunctionAttr(function, attr);
+
+      if (gallivm_debug & GALLIVM_DEBUG_IR) {
+         lp_debug_dump_value(function);
+      }
    }
 
    return LLVMBuildCall(builder, function, args, num_args, "");
-- 
2.1.4



More information about the mesa-dev mailing list