// COM: A NOP sled belongs to its containing kernel. The patchable DS // COM: instruction in second_kernel must not borrow first_kernel padding. // RUN: %clang -target amdgcn-amd-amdhsa -mcpu=gfx1250 -nostdlib %s -o %t.elf // RUN: hotswap-rewrite %t.elf \ // RUN: amdgcn-amd-amdhsa--gfx1250 amdgcn-amd-amdhsa--gfx1250 \ // RUN: --output %t.out.elf \ // RUN: | %FileCheck --check-prefix=API %s // API: RESULT: SUCCESS // RUN: %llvm-objdump -d %t.out.elf | %FileCheck --check-prefix=DISASM %s // DISASM-LABEL: : // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_nop 0 // DISASM-NEXT: s_endpgm // DISASM-LABEL: : // DISASM-NOT: ds_load_2addr_stride64_b32 // DISASM: s_branch // DISASM: s_wait_dscnt 0x0 // DISASM: s_endpgm // DISASM: ds_load_b32 v0 // DISASM: ds_load_b32 v1 // DISASM: s_branch .amdgcn_target "amdgcn-amd-amdhsa--gfx1250" .text .globl first_kernel .p2align 8 .type first_kernel,@function first_kernel: s_nop 0 s_nop 0 s_nop 0 s_nop 0 s_nop 0 s_nop 0 s_nop 0 s_nop 0 s_endpgm .Lfirst_kernel_end: .size first_kernel, .Lfirst_kernel_end-first_kernel .globl second_kernel .p2align 8 .type second_kernel,@function second_kernel: ds_load_2addr_stride64_b32 v[0:1], v2 offset0:1 offset1:3 s_wait_dscnt 0x0 s_endpgm .Lsecond_kernel_end: .size second_kernel, .Lsecond_kernel_end-second_kernel .rodata .p2align 8 .amdhsa_kernel first_kernel .amdhsa_next_free_vgpr 3 .amdhsa_next_free_sgpr 1 .end_amdhsa_kernel .amdhsa_kernel second_kernel .amdhsa_next_free_vgpr 3 .amdhsa_next_free_sgpr 1 .end_amdhsa_kernel