1 ; REQUIRES: x86-registered-target
2 ; RUN: llc -mtriple x86_64-apple-darwin %s -pass-remarks-analysis='size-info'\
3 ; RUN: -pass-remarks-output=%t.yaml -o /dev/null < %s 2> %t; \
4 ; RUN: cat %t %t.yaml | FileCheck %s
6 ; Make sure that machine-level size remarks work.
8 ; - When we create a MachineFunction (e.g, during instruction selection), it
10 ; - The initial size of the function after filling it is positive.
11 ; - After that, we can increase or decrease the size of the function.
12 ; - ... The final size must be positive.
13 ; - ... The delta can be negative or positive.
15 ; CHECK: remark: <unknown>:0:0: X86 DAG->DAG Instruction Selection: Function:
16 ; CHECK-SAME: main: MI Instruction count changed from 0
17 ; CHECK-SAME: to [[INIT:[1-9][0-9]*]]; Delta: [[INIT]]
18 ; CHECK-NEXT: remark: <unknown>:0:0: Simple Register Coalescing: Function: main:
19 ; CHECK-SAME: MI Instruction count changed from [[INIT]] to
20 ; CHECK-SAME: [[FINAL:[1-9][0-9]*]];
21 ; CHECK-SAME: Delta: [[DELTA:-?[1-9][0-9]*]]
22 ; CHECK-NEXT: --- !Analysis
23 ; CHECK-NEXT: Pass: size-info
24 ; CHECK-NEXT: Name: FunctionMISizeChange
25 ; CHECK-NEXT: Function: main
27 ; CHECK-NEXT: - Pass: 'X86 DAG->DAG Instruction Selection'
28 ; CHECK-NEXT: - String: ': Function: '
29 ; CHECK-NEXT: - Function: main
30 ; CHECK-NEXT: - String: ': '
31 ; CHECK-NEXT: - String: 'MI Instruction count changed from '
32 ; CHECK-NEXT: - MIInstrsBefore: '0'
33 ; CHECK-NEXT: - String: ' to '
34 ; CHECK-NEXT: - MIInstrsAfter: '[[INIT]]'
35 ; CHECK-NEXT: - String: '; Delta: '
36 ; CHECK-NEXT: - Delta: '[[INIT]]'
37 ; CHECK-DAG: --- !Analysis
38 ; CHECK-NEXT: Pass: size-info
39 ; CHECK-NEXT: Name: FunctionMISizeChange
40 ; CHECK-NEXT: Function: main
42 ; CHECK-NEXT: - Pass: Simple Register Coalescing
43 ; CHECK-NEXT: - String: ': Function: '
44 ; CHECK-NEXT: - Function: main
45 ; CHECK-NEXT: - String: ': '
46 ; CHECK-NEXT: - String: 'MI Instruction count changed from '
47 ; CHECK-NEXT: - MIInstrsBefore: '[[INIT]]'
48 ; CHECK-NEXT: - String: ' to '
49 ; CHECK-NEXT: - MIInstrsAfter: '[[FINAL]]'
50 ; CHECK-NEXT: - String: '; Delta: '
51 ; CHECK-NEXT: - Delta: '[[DELTA]]'
52 define i32 @main() #0 {
54 %retval = alloca i32, align 4
55 store i32 0, i32* %retval, align 4
59 attributes #0 = { noinline nounwind optnone ssp uwtable }