summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-08-09 12:25:43 +0200
committerNicolai Hähnle <[email protected]>2016-08-17 12:11:24 +0200
commit41001ca4bdcb6effe9fd52f6d7db84084b8337a3 (patch)
treecdc628bdfa66634eca71c346dbeb3e78ba7f240b /src
parent17e88e276ca5baeda4867713871219ebdf925d33 (diff)
gallivm: add lp_build_alloca_undef
Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_flow.c19
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_flow.h5
2 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.c b/src/gallium/auxiliary/gallivm/lp_bld_flow.c
index 9183f457b11..c522bc4f4ab 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_flow.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.c
@@ -508,6 +508,25 @@ lp_build_alloca(struct gallivm_state *gallivm,
/**
+ * Like lp_build_alloca, but do not zero-initialize the variable.
+ */
+LLVMValueRef
+lp_build_alloca_undef(struct gallivm_state *gallivm,
+ LLVMTypeRef type,
+ const char *name)
+{
+ LLVMBuilderRef first_builder = create_builder_at_entry(gallivm);
+ LLVMValueRef res;
+
+ res = LLVMBuildAlloca(first_builder, type, name);
+
+ LLVMDisposeBuilder(first_builder);
+
+ return res;
+}
+
+
+/**
* Allocate an array of scalars/vectors.
*
* mem2reg pass is not capable of promoting structs or arrays to registers, but
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_flow.h b/src/gallium/auxiliary/gallivm/lp_bld_flow.h
index 083b0ad9fec..674fc189f1a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_flow.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_flow.h
@@ -196,6 +196,11 @@ lp_build_alloca(struct gallivm_state *gallivm,
const char *name);
LLVMValueRef
+lp_build_alloca_undef(struct gallivm_state *gallivm,
+ LLVMTypeRef type,
+ const char *name);
+
+LLVMValueRef
lp_build_array_alloca(struct gallivm_state *gallivm,
LLVMTypeRef type,
LLVMValueRef count,