summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_init.c5
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp14
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index b5902e86429..ef2580e8263 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -621,7 +621,10 @@ gallivm_compile_module(struct gallivm_state *gallivm)
util_snprintf(filename, sizeof(filename), "ir_%s.bc", gallivm->module_name);
LLVMWriteBitcodeToFile(gallivm->module, filename);
debug_printf("%s written\n", filename);
- debug_printf("Invoke as \"llc -o - %s\"\n", filename);
+ debug_printf("Invoke as \"llc %s%s -o - %s\"\n",
+ (HAVE_LLVM >= 0x0305) ? "[-mcpu=<-mcpu option] " : "",
+ "[-mattr=<-mattr option(s)>]",
+ filename);
}
if (use_mcjit) {
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index 498bbd78095..4115f1e9f40 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -93,6 +93,7 @@
#include "util/u_cpu_detect.h"
#include "lp_bld_misc.h"
+#include "lp_bld_debug.h"
namespace {
@@ -619,6 +620,16 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
builder.setMAttrs(MAttrs);
+ if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) {
+ int n = MAttrs.size();
+ if (n > 0) {
+ debug_printf("llc -mattr option(s): ");
+ for (int i = 0; i < n; i++)
+ debug_printf("%s%s", MAttrs[i].c_str(), (i < n - 1) ? "," : "");
+ debug_printf("\n");
+ }
+ }
+
#if HAVE_LLVM >= 0x0305
StringRef MCPU = llvm::sys::getHostCPUName();
/*
@@ -634,6 +645,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
* can't handle. Not entirely sure if we really need to do anything yet.
*/
builder.setMCPU(MCPU);
+ if (gallivm_debug & (GALLIVM_DEBUG_IR | GALLIVM_DEBUG_ASM | GALLIVM_DEBUG_DUMP_BC)) {
+ debug_printf("llc -mcpu option: %s\n", MCPU.str().c_str());
+ }
#endif
ShaderMemoryManager *MM = NULL;