summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenOpenCL/vectorLoadStore.cl
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2012-08-16 00:10:13 +0000
committerTanya Lattner <tonic@nondot.org>2012-08-16 00:10:13 +0000
commita9dd49fe5b327babb9cd8128cd91ce198767fe71 (patch)
tree50b05d00f2a08b4dcf9ac9b0464c1b5227587c83 /clang/test/CodeGenOpenCL/vectorLoadStore.cl
parenta7e1d39309ed8840999b4cb009195820fea39c9d (diff)
Convert loads and stores of vec3 to vec4 to achieve better code generation. Add test case.
llvm-svn: 162002
Diffstat (limited to 'clang/test/CodeGenOpenCL/vectorLoadStore.cl')
-rw-r--r--clang/test/CodeGenOpenCL/vectorLoadStore.cl9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenOpenCL/vectorLoadStore.cl b/clang/test/CodeGenOpenCL/vectorLoadStore.cl
new file mode 100644
index 000000000000..ba0405d09863
--- /dev/null
+++ b/clang/test/CodeGenOpenCL/vectorLoadStore.cl
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s
+
+typedef char char3 __attribute((ext_vector_type(3)));;
+
+// Check for optimized vec3 load/store which treats vec3 as vec4.
+void foo(char3 *P, char3 *Q) {
+ *P = *Q;
+ // CHECK: %extractVec = shufflevector <4 x i8> %loadVec4, <4 x i8> undef, <3 x i32> <i32 0, i32 1, i32 2>
+}