[OpenCL] Fix as_type(vec3) invalid store creation
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Thu, 19 Aug 2021 10:57:09 +0000 (11:57 +0100)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Thu, 19 Aug 2021 10:57:09 +0000 (11:57 +0100)
commit7bda1a0711c67fde5f9bac5e1c9bd68163659d0e
treeaa2f51e228de5b7f7b4a6f7818c2a3b45d0e773d
parent36d51386195e3d606e0d40495f1135ab180bd6ae
[OpenCL] Fix as_type(vec3) invalid store creation

With -fpreserve-vec3-type enabled, a cast was not created when
converting from a vec3 type to a non-vec3 type, even though a
conversion to vec4 was performed.  This resulted in creation of
invalid store instructions.

Differential Revision: https://reviews.llvm.org/D107963
clang/lib/CodeGen/CGExprScalar.cpp
clang/test/CodeGenOpenCL/preserve_vec3.cl