diff options
author | Justin Holewinski <justin.holewinski@gmail.com> | 2012-11-09 23:50:24 +0000 |
---|---|---|
committer | Justin Holewinski <justin.holewinski@gmail.com> | 2012-11-09 23:50:24 +0000 |
commit | 2dc9d072e5a3fffa34963efc8a7dfc7656ea020b (patch) | |
tree | e1c9bae7b2724c424bb22d1599d0d75b1f9bee35 /llvm/test/CodeGen/NVPTX/param-align.ll | |
parent | e0ae5356fcc72a60355a977c864a4a83f06301ce (diff) | |
download | bcm5719-llvm-2dc9d072e5a3fffa34963efc8a7dfc7656ea020b.tar.gz bcm5719-llvm-2dc9d072e5a3fffa34963efc8a7dfc7656ea020b.zip |
[NVPTX] Use ABI alignment for parameters when alignment is not specified.
Affects SM 2.0+. Fixes bug 13324.
llvm-svn: 167646
Diffstat (limited to 'llvm/test/CodeGen/NVPTX/param-align.ll')
-rw-r--r-- | llvm/test/CodeGen/NVPTX/param-align.ll | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/param-align.ll b/llvm/test/CodeGen/NVPTX/param-align.ll new file mode 100644 index 00000000000..84ccb650d40 --- /dev/null +++ b/llvm/test/CodeGen/NVPTX/param-align.ll @@ -0,0 +1,25 @@ +; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s + +;;; Need 4-byte alignment on float* passed byval +define ptx_device void @t1(float* byval %x) { +; CHECK: .func t1 +; CHECK: .param .align 4 .b8 t1_param_0[4] + ret void +} + + +;;; Need 8-byte alignment on double* passed byval +define ptx_device void @t2(double* byval %x) { +; CHECK: .func t2 +; CHECK: .param .align 8 .b8 t2_param_0[8] + ret void +} + + +;;; Need 4-byte alignment on float2* passed byval +%struct.float2 = type { float, float } +define ptx_device void @t3(%struct.float2* byval %x) { +; CHECK: .func t3 +; CHECK: .param .align 4 .b8 t3_param_0[8] + ret void +} |