llvmpipe: switch to using dynamic stack allocation instead of registers
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_logic.c
index d23de4f0ef8ca7fafaf7f557ac9dd380338a6648..41ac81b7441d2af42e4fcab41dafbcdc92c6f118 100644 (file)
@@ -419,3 +419,15 @@ lp_build_select_aos(struct lp_build_context *bld,
 #endif
    }
 }
+
+LLVMValueRef
+lp_build_alloca(struct lp_build_context *bld)
+{
+   const struct lp_type type = bld->type;
+
+   if (type.length > 1) { /*vector*/
+      return LLVMBuildAlloca(bld->builder, lp_build_vec_type(type), "");
+   } else { /*scalar*/
+      return LLVMBuildAlloca(bld->builder, lp_build_elem_type(type), "");
+   }
+}