From e3e4c2f00606162c83cacbb9a5572e117150adf4 Mon Sep 17 00:00:00 2001 From: Vladimir Radosavljevic Date: Tue, 29 Oct 2024 16:09:26 +0100 Subject: [PATCH] [TailDuplication] Add pre-commit test for Add option to enable tail duplication of fallthrough BBs Signed-off-by: Vladimir Radosavljevic --- .../EraVM/tail-dup-fallthrough-bbs.mir | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 llvm/test/CodeGen/EraVM/tail-dup-fallthrough-bbs.mir diff --git a/llvm/test/CodeGen/EraVM/tail-dup-fallthrough-bbs.mir b/llvm/test/CodeGen/EraVM/tail-dup-fallthrough-bbs.mir new file mode 100644 index 000000000000..68c3d32bfca6 --- /dev/null +++ b/llvm/test/CodeGen/EraVM/tail-dup-fallthrough-bbs.mir @@ -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