no-bundle-asm.ll 1.13 KB
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck %s

; SIPostRABundler used to incorrectly try to form a bundle containing
; inline asm.

define amdgpu_kernel void @no_bundle_asm_sideeffect() {
; CHECK-LABEL: no_bundle_asm_sideeffect:
; CHECK:       ; %bb.0:
; CHECK-NEXT:    ;;#ASMSTART
; CHECK-NEXT:    s_mov_b32 s0, 42
; CHECK-NEXT:    ;;#ASMEND
; CHECK-NEXT:    ;;#ASMSTART
; CHECK-NEXT:    s_mov_b64 s[0:1], 42
; CHECK-NEXT:    ;;#ASMEND
; CHECK-NEXT:    s_endpgm
  call void asm sideeffect "s_mov_b32 s0, $0", "i,~{s0}"(i32 42)
  call void asm sideeffect "s_mov_b64 s[0:1], $0", "i,~{s[0:1]}"(i64 42)
  ret void
}

define amdgpu_kernel void @no_bundle_asm() {
; CHECK-LABEL: no_bundle_asm:
; CHECK:       ; %bb.0:
; CHECK-NEXT:    ;;#ASMSTART
; CHECK-NEXT:    s_mov_b32 s0, 42
; CHECK-NEXT:    ;;#ASMEND
; CHECK-NEXT:    ;;#ASMSTART
; CHECK-NEXT:    s_mov_b64 s[0:1], 42
; CHECK-NEXT:    ;;#ASMEND
; CHECK-NEXT:    s_endpgm
  call void asm "s_mov_b32 s0, $0", "i,~{s0}"(i32 42)
  call void asm "s_mov_b64 s[0:1], $0", "i,~{s[0:1]}"(i64 42)
  ret void
}