2018-01-11 05:05:07 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -filetype=obj < %s \
|
|
|
|
; RUN: -o /dev/null 2>&1
|
|
|
|
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s | FileCheck %s
|
|
|
|
|
2019-05-23 20:43:13 +08:00
|
|
|
define void @relax_bcc(i1 %a) nounwind {
|
2018-01-11 05:05:07 +08:00
|
|
|
; CHECK-LABEL: relax_bcc:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: andi a0, a0, 1
|
|
|
|
; CHECK-NEXT: bnez a0, .LBB0_1
|
|
|
|
; CHECK-NEXT: j .LBB0_2
|
|
|
|
; CHECK-NEXT: .LBB0_1: # %iftrue
|
|
|
|
; CHECK-NEXT: #APP
|
|
|
|
; CHECK-NEXT: .space 4096
|
|
|
|
; CHECK-NEXT: #NO_APP
|
|
|
|
; CHECK-NEXT: .LBB0_2: # %tail
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
br i1 %a, label %iftrue, label %tail
|
|
|
|
|
|
|
|
iftrue:
|
|
|
|
call void asm sideeffect ".space 4096", ""()
|
|
|
|
br label %tail
|
|
|
|
|
|
|
|
tail:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2019-07-16 12:56:43 +08:00
|
|
|
; TODO: Extend simm12's MCOperandPredicate so the jalr zero is printed as a jr.
|
2019-05-23 20:43:13 +08:00
|
|
|
define i32 @relax_jal(i1 %a) nounwind {
|
2018-01-11 05:05:07 +08:00
|
|
|
; CHECK-LABEL: relax_jal:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: andi a0, a0, 1
|
|
|
|
; CHECK-NEXT: bnez a0, .LBB1_1
|
2018-01-18 19:34:02 +08:00
|
|
|
; CHECK-NEXT: # %bb.3:
|
2018-01-11 05:05:07 +08:00
|
|
|
; CHECK-NEXT: lui a0, %hi(.LBB1_2)
|
2019-07-16 12:56:43 +08:00
|
|
|
; CHECK-NEXT: jalr zero, %lo(.LBB1_2)(a0)
|
2018-01-11 05:05:07 +08:00
|
|
|
; CHECK-NEXT: .LBB1_1: # %iftrue
|
|
|
|
; CHECK-NEXT: #APP
|
|
|
|
; CHECK-NEXT: #NO_APP
|
|
|
|
; CHECK-NEXT: #APP
|
|
|
|
; CHECK-NEXT: .space 1048576
|
|
|
|
; CHECK-NEXT: #NO_APP
|
2018-01-18 19:34:02 +08:00
|
|
|
; CHECK-NEXT: addi a0, zero, 1
|
|
|
|
; CHECK-NEXT: ret
|
2018-01-11 05:05:07 +08:00
|
|
|
; CHECK-NEXT: .LBB1_2: # %jmp
|
|
|
|
; CHECK-NEXT: #APP
|
|
|
|
; CHECK-NEXT: #NO_APP
|
|
|
|
; CHECK-NEXT: addi a0, zero, 1
|
|
|
|
; CHECK-NEXT: ret
|
|
|
|
br i1 %a, label %iftrue, label %jmp
|
|
|
|
|
|
|
|
jmp:
|
|
|
|
call void asm sideeffect "", ""()
|
|
|
|
br label %tail
|
|
|
|
|
|
|
|
iftrue:
|
|
|
|
call void asm sideeffect "", ""()
|
|
|
|
br label %space
|
|
|
|
|
|
|
|
space:
|
|
|
|
call void asm sideeffect ".space 1048576", ""()
|
|
|
|
br label %tail
|
|
|
|
|
|
|
|
tail:
|
|
|
|
ret i32 1
|
|
|
|
}
|