diff options
author | Tanya Lattner <tonic@nondot.org> | 2012-08-16 00:10:13 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2012-08-16 00:10:13 +0000 |
commit | c58dcdc8facb646d88675bb6fbcb5c787166c4be (patch) | |
tree | 5c00fdcc75e64d345b0d2fa8eff5d431436c7176 /test/CodeGenOpenCL | |
parent | 058ab170a5b8597f32c3f343a1e9de2cd7b05848 (diff) |
Convert loads and stores of vec3 to vec4 to achieve better code generation. Add test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenOpenCL')
-rw-r--r-- | test/CodeGenOpenCL/vectorLoadStore.cl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGenOpenCL/vectorLoadStore.cl b/test/CodeGenOpenCL/vectorLoadStore.cl new file mode 100644 index 0000000000..ba0405d098 --- /dev/null +++ b/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> +} |