From 6da66c065449fda1ae5be53af349febe77d31d17 Mon Sep 17 00:00:00 2001 From: Vladimir Radosavljevic Date: Mon, 7 Oct 2024 16:15:23 +0200 Subject: [PATCH] [EraVM] Add pre-commit test for Optimize copies when src is used during backward propagation Signed-off-by: Vladimir Radosavljevic --- .../EraVM/machine-cp-backward-users.mir | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 llvm/test/CodeGen/EraVM/machine-cp-backward-users.mir diff --git a/llvm/test/CodeGen/EraVM/machine-cp-backward-users.mir b/llvm/test/CodeGen/EraVM/machine-cp-backward-users.mir new file mode 100644 index 000000000000..a9bfe588a0c7 --- /dev/null +++ b/llvm/test/CodeGen/EraVM/machine-cp-backward-users.mir @@ -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