• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3;;; Need 4-byte alignment on float* passed byval
4define ptx_device void @t1(float* byval %x) {
5; CHECK: .func t1
6; CHECK: .param .align 4 .b8 t1_param_0[4]
7  ret void
8}
9
10
11;;; Need 8-byte alignment on double* passed byval
12define ptx_device void @t2(double* byval %x) {
13; CHECK: .func t2
14; CHECK: .param .align 8 .b8 t2_param_0[8]
15  ret void
16}
17
18
19;;; Need 4-byte alignment on float2* passed byval
20%struct.float2 = type { float, float }
21define ptx_device void @t3(%struct.float2* byval %x) {
22; CHECK: .func t3
23; CHECK: .param .align 4 .b8 t3_param_0[8]
24  ret void
25}
26
27;;; Need at least 4-byte alignment in order to avoid miscompilation by
28;;; ptxas for sm_50+
29define ptx_device void @t4(i8* byval %x) {
30; CHECK: .func t4
31; CHECK: .param .align 4 .b8 t4_param_0[1]
32  ret void
33}
34
35;;; Make sure we adjust alignment at the call site as well.
36define ptx_device void @t5(i8* align 2 byval %x) {
37; CHECK: .func t5
38; CHECK: .param .align 4 .b8 t5_param_0[1]
39; CHECK: {
40; CHECK: .param .align 4 .b8 param0[1];
41; CHECK: call.uni
42  call void @t4(i8* byval %x)
43  ret void
44}
45