[all-commits] [llvm/llvm-project] b7738e: [MIRPrinter] Don't print space when there is no su...

Quentin Dian via All-commits all-commits at lists.llvm.org
Wed Jan 31 06:35:54 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b7738e275dc097f224d00434253b485288a6caff
      https://github.com/llvm/llvm-project/commit/b7738e275dc097f224d00434253b485288a6caff
  Author: Quentin Dian <dianqk at dianqk.net>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    M llvm/lib/CodeGen/MIRPrinter.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/uaddo-8-16-bits.mir
    M llvm/test/CodeGen/AArch64/regalloc-last-chance-recolor-with-split.mir
    M llvm/test/CodeGen/AArch64/tail-dup-redundant-phi.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-trap.mir
    M llvm/test/CodeGen/ARM/constant-island-movwt.mir
    A llvm/test/CodeGen/MIR/X86/unreachable-block-print.mir
    M llvm/test/CodeGen/X86/statepoint-invoke-ra-enter-at-end.mir
    M llvm/test/CodeGen/X86/statepoint-invoke-ra-remove-back-copies.mir
    M llvm/test/CodeGen/X86/statepoint-vreg-invoke.ll

  Log Message:
  -----------
  [MIRPrinter] Don't print space when there is no successor (#80143)

Extra space causes the checks generated by update_mir_test_checks to be
unavailable.

```
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
# RUN: llc -mtriple=x86_64-- -o - %s -run-pass=none -verify-machineinstrs -simplify-mir | FileCheck %s
---
name: foo
body: |
  ; CHECK-LABEL: name: foo
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors:
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   RET 0, $eax
  bb.0:
    successors:

  bb.1:
    RET 0, $eax
...
```

The failure log is as follows:

```
llvm/test/CodeGen/MIR/X86/unreachable-block-print.mir:9:16: error: CHECK-NEXT: is on the same line as previous match
 ; CHECK-NEXT: {{ $}}
               ^
<stdin>:21:13: note: 'next' match was here
 successors:
            ^
<stdin>:21:13: note: previous match ended here
 successors:
```




More information about the All-commits mailing list