|
| 1 | +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 |
| 2 | +# RUN: llc %s -mtriple=riscv64 -mattr=+v \ |
| 3 | +# RUN: -run-pass=prologepilog,cfi-instr-inserter \ |
| 4 | +# RUN: -riscv-enable-cfi-instr-inserter=true \ |
| 5 | +# RUN: | FileCheck %s |
| 6 | +# |
| 7 | +# In this test prolog will be inserted in bb.3. We need to save the scalable vector register v1. |
| 8 | +# This will emit cfi_escape in bb.3. We need to emit the same cfi_escape in the begining of bb.2. |
| 9 | +# Currently, CFIInstrInserter doesn't handle escape, so we have wrong cfi in this example. |
| 10 | + |
| 11 | +--- | |
| 12 | + |
| 13 | + define riscv_vector_cc void @test0(ptr %p0, ptr %p1) #0 { |
| 14 | + entry: |
| 15 | + %v = load <4 x i32>, ptr %p0, align 16 |
| 16 | + store <4 x i32> %v, ptr %p1, align 16 |
| 17 | + ret void |
| 18 | + } |
| 19 | + |
| 20 | + attributes #0 = { "target-features"="+v" } |
| 21 | + |
| 22 | +... |
| 23 | +--- |
| 24 | +name: test0 |
| 25 | +tracksRegLiveness: true |
| 26 | +frameInfo: |
| 27 | + savePoint: '%bb.3' |
| 28 | + restorePoint: '%bb.2' |
| 29 | +body: | |
| 30 | + ; CHECK-LABEL: name: test0 |
| 31 | + ; CHECK: bb.0.entry: |
| 32 | + ; CHECK-NEXT: successors: %bb.3(0x40000000), %bb.1(0x40000000) |
| 33 | + ; CHECK-NEXT: liveins: $x10, $x11, $v1 |
| 34 | + ; CHECK-NEXT: {{ $}} |
| 35 | + ; CHECK-NEXT: BEQ $x10, $x0, %bb.3 |
| 36 | + ; CHECK-NEXT: {{ $}} |
| 37 | + ; CHECK-NEXT: bb.1: |
| 38 | + ; CHECK-NEXT: liveins: $v1 |
| 39 | + ; CHECK-NEXT: {{ $}} |
| 40 | + ; CHECK-NEXT: PseudoRET |
| 41 | + ; CHECK-NEXT: {{ $}} |
| 42 | + ; CHECK-NEXT: bb.2: |
| 43 | + ; CHECK-NEXT: successors: %bb.1(0x80000000) |
| 44 | + ; CHECK-NEXT: {{ $}} |
| 45 | + ; CHECK-NEXT: CFI_INSTRUCTION def_cfa_offset 16 |
| 46 | + ; CHECK-NEXT: $x10 = ADDI $x2, 16 |
| 47 | + ; CHECK-NEXT: $v1 = frame-destroy VL1RE8_V killed $x10 :: (load unknown-size from %stack.0, align 8) |
| 48 | + ; CHECK-NEXT: $x10 = frame-destroy PseudoReadVLENB |
| 49 | + ; CHECK-NEXT: $x2 = frame-destroy ADD $x2, killed $x10 |
| 50 | + ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa $x2, 16 |
| 51 | + ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION restore $v1 |
| 52 | + ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 16 |
| 53 | + ; CHECK-NEXT: frame-destroy CFI_INSTRUCTION def_cfa_offset 0 |
| 54 | + ; CHECK-NEXT: PseudoBR %bb.1 |
| 55 | + ; CHECK-NEXT: {{ $}} |
| 56 | + ; CHECK-NEXT: bb.3: |
| 57 | + ; CHECK-NEXT: successors: %bb.2(0x80000000) |
| 58 | + ; CHECK-NEXT: liveins: $x10, $x11, $v1 |
| 59 | + ; CHECK-NEXT: {{ $}} |
| 60 | + ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -16 |
| 61 | + ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 16 |
| 62 | + ; CHECK-NEXT: $x12 = frame-setup PseudoReadVLENB |
| 63 | + ; CHECK-NEXT: $x2 = frame-setup SUB $x2, killed $x12 |
| 64 | + ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x01, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 |
| 65 | + ; CHECK-NEXT: $x12 = ADDI $x2, 16 |
| 66 | + ; CHECK-NEXT: frame-setup VS1R_V killed $v1, killed $x12 :: (store unknown-size into %stack.0, align 8) |
| 67 | + ; CHECK-NEXT: frame-setup CFI_INSTRUCTION escape 0x10, 0x61, 0x08, 0x11, 0x7f, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 |
| 68 | + ; CHECK-NEXT: dead $x0 = PseudoVSETIVLI 4, 208 /* e32, m1, ta, ma */, implicit-def $vl, implicit-def $vtype |
| 69 | + ; CHECK-NEXT: renamable $v1 = PseudoVLE32_V_M1 undef renamable $v1, killed renamable $x10, 4, 5 /* e32 */, 2 /* tu, ma */, implicit $vl, implicit $vtype |
| 70 | + ; CHECK-NEXT: PseudoVSE32_V_M1 killed renamable $v1, killed renamable $x11, 4, 5 /* e32 */, implicit $vl, implicit $vtype |
| 71 | + ; CHECK-NEXT: PseudoBR %bb.2 |
| 72 | + bb.0.entry: |
| 73 | + liveins: $x10, $x11 |
| 74 | + BEQ $x10, $x0, %bb.3 |
| 75 | +
|
| 76 | + bb.1: |
| 77 | + PseudoRET |
| 78 | +
|
| 79 | + bb.2: |
| 80 | + PseudoBR %bb.1 |
| 81 | +
|
| 82 | + bb.3: |
| 83 | + liveins: $x10, $x11 |
| 84 | + dead $x0 = PseudoVSETIVLI 4, 208, implicit-def $vl, implicit-def $vtype |
| 85 | + renamable $v1 = PseudoVLE32_V_M1 undef renamable $v1, killed renamable $x10, 4, 5, 2, implicit $vl, implicit $vtype |
| 86 | + PseudoVSE32_V_M1 killed renamable $v1, killed renamable $x11, 4, 5, implicit $vl, implicit $vtype |
| 87 | + PseudoBR %bb.2 |
| 88 | +... |
0 commit comments