Skip to content

Commit

Permalink
[EraVM] Add pre-commit test for Optimize copies when src is used duri…
Browse files Browse the repository at this point in the history
…ng backward propagation

Signed-off-by: Vladimir Radosavljevic <[email protected]>
  • Loading branch information
vladimirradosavljevic committed Oct 9, 2024
1 parent 4836425 commit 6da66c0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions llvm/test/CodeGen/EraVM/machine-cp-backward-users.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
# RUN: llc -x mir -run-pass machine-cp -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 %a, i256 %b) { ret void }

...
---
name: test
tracksRegLiveness: true
body: |
bb.0:
liveins: $r1, $r2, $r4
; CHECK-LABEL: name: test
; CHECK: liveins: $r1, $r2, $r4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: renamable $r3 = ADDirr_s i256 1, killed renamable $r1, i256 0
; CHECK-NEXT: dead $r0 = SUBrrr_v renamable $r3, renamable $r2, i256 0, implicit-def $flags
; CHECK-NEXT: renamable $r1 = COPY killed renamable $r3
; CHECK-NEXT: RET 0, implicit $r1
renamable $r3 = ADDirr_s i256 1, killed renamable $r1, i256 0
dead $r0 = SUBrrr_v renamable $r3, renamable $r2, i256 0, implicit-def $flags
renamable $r1 = COPY killed renamable $r3
RET 0, implicit $r1

0 comments on commit 6da66c0

Please sign in to comment.