#include "util/u_memory.h"
#include "util/u_debug.h"
+#include <stdio.h>
#include <llvm-c/Core.h>
#include <llvm-c/Transforms/Scalar.h>
case TGSI_FILE_TEMPORARY:
{
+ char name[16] = "";
LLVMValueRef array_alloca = NULL;
unsigned decl_size;
first = decl->Range.First;
}
if (!array_alloca) {
for (i = 0; i < decl_size; ++i) {
+#ifdef DEBUG
+ snprintf(name, sizeof(name), "TEMP%d.%c",
+ first + i / 4, "xyzw"[i % 4]);
+#endif
ctx->temps[first * TGSI_NUM_CHANNELS + i] =
si_build_alloca_undef(bld_base->base.gallivm,
bld_base->base.vec_type,
- "temp");
+ name);
}
} else {
LLVMValueRef idxs[2] = {
NULL
};
for (i = 0; i < decl_size; ++i) {
+#ifdef DEBUG
+ snprintf(name, sizeof(name), "TEMP%d.%c",
+ first + i / 4, "xyzw"[i % 4]);
+#endif
idxs[1] = lp_build_const_int32(bld_base->base.gallivm, i);
ctx->temps[first * TGSI_NUM_CHANNELS + i] =
- LLVMBuildGEP(builder, array_alloca, idxs, 2, "temp");
+ LLVMBuildGEP(builder, array_alloca, idxs, 2, name);
}
}
break;