diff options
author | Matt Turner <[email protected]> | 2014-02-22 16:35:15 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-02-28 14:32:39 -0800 |
commit | 3305b9c96b8c1f00e66bda59aa69b44a5ff861db (patch) | |
tree | b2c1183d3d981c2b19a235957f38a8d1309dc1cb /src | |
parent | a43b8bfa780baf8974a1c949459c8781449af238 (diff) |
glsl: Don't vectorize horizontal expressions.
Cc: "10.1" <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75224
(cherry picked from commit 4bd7f1d044eee17587d6523322303a61aeb8d660)
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/opt_vectorize.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/glsl/opt_vectorize.cpp b/src/glsl/opt_vectorize.cpp index dba303d3131..13faac05ef1 100644 --- a/src/glsl/opt_vectorize.cpp +++ b/src/glsl/opt_vectorize.cpp @@ -83,6 +83,7 @@ public: virtual ir_visitor_status visit_enter(ir_assignment *); virtual ir_visitor_status visit_enter(ir_swizzle *); virtual ir_visitor_status visit_enter(ir_dereference_array *); + virtual ir_visitor_status visit_enter(ir_expression *); virtual ir_visitor_status visit_enter(ir_if *); virtual ir_visitor_status visit_enter(ir_loop *); @@ -303,6 +304,20 @@ ir_vectorize_visitor::visit_enter(ir_dereference_array *ir) return visit_continue_with_parent; } +/** + * Upon entering an ir_expression, remove the current assignment from further + * consideration if the expression operates horizontally on vectors. + */ +ir_visitor_status +ir_vectorize_visitor::visit_enter(ir_expression *ir) +{ + if (ir->is_horizontal()) { + this->current_assignment = NULL; + return visit_continue_with_parent; + } + return visit_continue; +} + /* Since there is no statement to visit between the "then" and "else" * instructions try to vectorize before, in between, and after them to avoid * combining statements from different basic blocks. |