diff options
author | Zack Rusin <zackr@vmware.com> | 2010-02-08 21:50:33 -0500 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2010-02-08 21:50:33 -0500 |
commit | 85c7ec70ad41c8ada75a4cbace83d16815d3e2c5 (patch) | |
tree | 7154254e4d6c26e27e410524f814a52329ff46d3 /src/gallium/auxiliary/gallivm/lp_bld_logic.c | |
parent | 257267ee9817d67e6963e81766a121c367478f65 (diff) |
llvmpipe: switch to using dynamic stack allocation instead of registers
with mutable vars we don't need to follow the phi nodes. meaning that
control flow becomes trivial as we don't have scan the rest of the tgsi
to figure out the variable usage anymore. futhermore the memory2register
pass promotes alloca/store/load to registers while inserting the right phi
nodes. so we get simplicity and performance.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_logic.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_logic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index d23de4f0ef..41ac81b744 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -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), ""); + } +} |