summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-03-31 23:37:34 +0100
committerJose Fonseca <[email protected]>2016-04-01 09:05:19 +0100
commitcdf7c6b83dad7eb6a7600af61403315b02dcf13f (patch)
tree3536cbe9c97e88d1a05fcde5f1a34b642852cc37 /src
parentcd7d631c71bb1342a6607a193918ccb3289c0bbf (diff)
gallivm: Use vector selects on LLVM 3.3+.
This is an old patch I had around. Vector selects seem to work well from LLVM 3.3. Using them should improve code quality, as it might make constant propagation pass more effective. Tested lp_test_* Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_logic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
index 19d30d0d63c..5b0b6c6b234 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
@@ -314,11 +314,13 @@ lp_build_select(struct lp_build_context *bld,
mask = LLVMBuildTrunc(builder, mask, LLVMInt1TypeInContext(lc), "");
res = LLVMBuildSelect(builder, mask, a, b, "");
}
- else if (0) {
+ else if (HAVE_LLVM >= 0x0303) {
/* Generate a vector select.
*
- * XXX: Using vector selects would avoid emitting intrinsics, but they aren't
- * properly supported yet.
+ * Using vector selects would avoid emitting intrinsics, but they weren't
+ * properly supported yet for a long time.
+ *
+ * LLVM 3.3 appears to reliably support it.
*
* LLVM 3.1 supports it, but it yields buggy code (e.g. lp_blend_test).
*