Skip to content

Commit

Permalink
[TailDuplication] Add pre-commit test for Add option to enable tail d…
Browse files Browse the repository at this point in the history
…uplication of fallthrough BBs

Signed-off-by: Vladimir Radosavljevic <[email protected]>
  • Loading branch information
vladimirradosavljevic authored and akiramenai committed Oct 30, 2024
1 parent 801623b commit e3e4c2f
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions llvm/test/CodeGen/EraVM/tail-dup-fallthrough-bbs.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
# RUN: llc -x mir -run-pass tailduplication -verify-machineinstrs -compile-twice=false < %s | FileCheck %s

--- |

target datalayout = "E-p:256:256-i256:256:256-S32-a:256:256"
target triple = "eravm"

define void @test(i256 %cond) { ret void }

...
---
name: test
tracksRegLiveness: true
body: |
; CHECK-LABEL: name: test
; CHECK: bb.0:
; CHECK-NEXT: successors: %bb.1(0x80000000)
; CHECK-NEXT: liveins: $r1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: J %bb.1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.1:
; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.2(0x40000000)
; CHECK-NEXT: liveins: $r1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: dead $r0 = SUBxrr_v i256 10, $r1, i256 0, implicit-def $flags
; CHECK-NEXT: JCl %bb.3, i256 3, implicit killed $flags
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2:
; CHECK-NEXT: liveins: $r1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: $r1 = MOVEIMM i256 4
; CHECK-NEXT: RET 0, implicit $r1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3:
; CHECK-NEXT: liveins: $r1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: $r1 = MOVEIMM i256 5
; CHECK-NEXT: RET 0, implicit $r1
bb.0:
liveins: $r1
J %bb.1
bb.1:
liveins: $r1
dead $r0 = SUBxrr_v i256 10, $r1, i256 0, implicit-def $flags
JCl %bb.4, i256 3, implicit killed $flags
bb.3:
liveins: $r1
$r1 = MOVEIMM i256 4
RET 0, implicit $r1
bb.4:
liveins: $r1
$r1 = MOVEIMM i256 5
RET 0, implicit $r1

0 comments on commit e3e4c2f

Please sign in to comment.