-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeGen] Fix InstructionCount remarks for MI bundles (#107621)
For MI bundles, the instruction count remark doesn't count the instructions inside the bundle.
- Loading branch information
Showing
2 changed files
with
108 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# RUN: llc -mtriple=riscv32 -verify-machineinstrs -start-before=riscv-expand-pseudo -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 | ||
... |