
Register assembly printer passes in the pass registry. This makes it possible to use `llc -start-before=<target>-asm-printer ...` in tests. Adds a `char &ID` parameter to the AssemblyPrinter constructor to allow targets to use the `INITIALIZE_PASS` macros and register the pass in the pass registry. This currently has a default parameter so it won't break any targets that have not been updated.
76 lines
1.6 KiB
YAML
76 lines
1.6 KiB
YAML
# RUN: llc -mtriple=riscv32 -verify-machineinstrs -start-before=riscv-asm-printer -simplify-mir -o /dev/null -pass-remarks-analysis=asm-printer %s 2>&1 | FileCheck %s
|
|
---
|
|
name: instrs
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = LW $x0, 0
|
|
$x0 = LW $x0, 0
|
|
$x0 = XORI $x0, 0
|
|
; CHECK: addi : 3
|
|
; CHECK-NEXT: lw : 2
|
|
; CHECK-NEXT: xori : 1
|
|
; CHECK: 6 instructions in function
|
|
...
|
|
---
|
|
name: bundles
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
$x0 = ADDI $x0, 0
|
|
BUNDLE {
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = LW $x0, 0
|
|
}
|
|
$x0 = LW $x0, 0
|
|
$x0 = XORI $x0, 0
|
|
; CHECK: addi : 3
|
|
; CHECK-NEXT: lw : 2
|
|
; CHECK-NEXT: xori : 1
|
|
; CHECK: 6 instructions in function
|
|
...
|
|
---
|
|
name: metainstrs
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = IMPLICIT_DEF
|
|
$x0 = LW $x0, 0
|
|
$x0 = LW $x0, 0
|
|
CFI_INSTRUCTION adjust_cfa_offset 4
|
|
$x0 = XORI $x0, 0
|
|
DBG_VALUE $x0, 0
|
|
; CHECK: addi : 3
|
|
; CHECK-NEXT: lw : 2
|
|
; CHECK-NEXT: xori : 1
|
|
; CHECK: 6 instructions in function
|
|
...
|
|
---
|
|
name: metabundles
|
|
tracksRegLiveness: true
|
|
body: |
|
|
bb.0:
|
|
$x0 = ADDI $x0, 0
|
|
BUNDLE {
|
|
CFI_INSTRUCTION adjust_cfa_offset 4
|
|
$x0 = ADDI $x0, 0
|
|
$x0 = ADDI $x0, 0
|
|
DBG_VALUE $x0, 0
|
|
$x0 = LW $x0, 0
|
|
}
|
|
$x0 = LW $x0, 0
|
|
$x0 = IMPLICIT_DEF
|
|
$x0 = XORI $x0, 0
|
|
; CHECK: addi : 3
|
|
; CHECK-NEXT: lw : 2
|
|
; CHECK-NEXT: xori : 1
|
|
; CHECK: 6 instructions in function
|
|
...
|