glsl: Disallow vectorization of vector_insert/extract.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 5 Jan 2016 13:34:24 +0000 (05:34 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Jan 2016 05:22:06 +0000 (21:22 -0800)
vector_insert takes a vector, a scalar location, and a scalar value,
and produces a new vector with that component updated.  As such, it
can't be vectorized properly.

vector_extract takes a vector and a scalar location, and returns
that scalar component of the vector.  Vectorization doesn't really
make any sense.

Treating both as horizontal operations makes sure the vectorizer
won't try to touch these.

Found by inspection.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ir.h

index c56c95994b8ca816b25a3c4df0d354b4e0d04b16..a728c036e6b7382145a32f2335b2c3e3243dfde0 100644 (file)
@@ -1724,6 +1724,8 @@ public:
       return operation == ir_binop_all_equal ||
              operation == ir_binop_any_nequal ||
              operation == ir_binop_dot ||
+             operation == ir_binop_vector_extract ||
+             operation == ir_triop_vector_insert ||
              operation == ir_quadop_vector;
    }