2020-08-24 11:21:38 +02:00
; RUN: opt -S -verify -iroutliner -o /dev/null \
; RUN: -pass-remarks=iroutliner -pass-remarks-missed=iroutliner < %s \
; RUN: 2>&1 | FileCheck -check-prefix=CHECK %s
; RUN: opt -S -verify -iroutliner -o /dev/null \
; RUN: -pass-remarks-output=%t < %s
; RUN: cat %t | FileCheck -check-prefix=YAML %s
2021-01-04 06:44:20 +01:00
; CHECK: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 12 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 5 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
; CHECK-NEXT: remark: <unknown>:0:0: outlined 2 regions with decrease of 2 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 05:51:15 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 10 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 06:44:20 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 11 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 12 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 05:51:15 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 13 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 06:44:20 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 14 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 05:51:15 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 10 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2021-01-04 06:44:20 +01:00
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 11 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 17 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
; CHECK-NEXT: remark: <unknown>:0:0: did not outline 2 regions due to estimated increase of 13 instructions at locations <UNKNOWN LOCATION> <UNKNOWN LOCATION>
2020-08-24 11:21:38 +02:00
2021-01-04 06:44:20 +01:00
; YAML: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function3
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
; YAML-NEXT: - InstructionIncrease: '12'
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function3
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
; YAML-NEXT: - InstructionIncrease: '5'
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Passed
2020-08-24 11:21:38 +02:00
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: Outlined
; YAML-NEXT: Function: function3.outlined
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'outlined '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions with decrease of '
2021-01-04 05:51:15 +01:00
; YAML-NEXT: - Benefit: '2'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '10'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '11'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '12'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '13'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '14'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '10'
2020-08-24 11:21:38 +02:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
2021-01-04 05:51:15 +01:00
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '11'
2021-01-04 05:51:15 +01:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '17'
2021-01-04 05:51:15 +01:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
; YAML-NEXT: --- !Missed
; YAML-NEXT: Pass: iroutliner
; YAML-NEXT: Name: WouldNotDecreaseSize
; YAML-NEXT: Function: function1
; YAML-NEXT: Args:
; YAML-NEXT: - String: 'did not outline '
; YAML-NEXT: - String: '2'
; YAML-NEXT: - String: ' regions due to estimated increase of '
2021-01-04 06:44:20 +01:00
; YAML-NEXT: - InstructionIncrease: '13'
2021-01-04 05:51:15 +01:00
; YAML-NEXT: - String: ' instructions at locations '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: - String: ' '
; YAML-NEXT: - DebugLoc: '<UNKNOWN LOCATION>'
; YAML-NEXT: ...
2020-08-24 11:21:38 +02:00
define void @function1 ( ) #0 {
entry:
%a = alloca i32 , align 4
%b = alloca i32 , align 4
%output = alloca i32 , align 4
%result = alloca i32 , align 4
store i32 2 , i32 * %a , align 4
store i32 3 , i32 * %b , align 4
%0 = load i32 , i32 * %a , align 4
%1 = load i32 , i32 * %b , align 4
%add = add i32 %0 , %1
store i32 %add , i32 * %output , align 4
%2 = load i32 , i32 * %output , align 4
%3 = load i32 , i32 * %output , align 4
%mul = mul i32 %2 , %add
store i32 %mul , i32 * %result , align 4
ret void
}
define void @function2 ( ) #0 {
entry:
%a = alloca i32 , align 4
%b = alloca i32 , align 4
%output = alloca i32 , align 4
%result = alloca i32 , align 4
store i32 2 , i32 * %a , align 4
store i32 3 , i32 * %b , align 4
%0 = load i32 , i32 * %a , align 4
%1 = load i32 , i32 * %b , align 4
%add = add i32 %0 , %1
store i32 %add , i32 * %output , align 4
%2 = load i32 , i32 * %output , align 4
2021-01-04 05:51:15 +01:00
%3 = load i32 , i32 * %output , align 4
2020-08-24 11:21:38 +02:00
%mul = mul i32 %2 , %add
store i32 %mul , i32 * %result , align 4
ret void
}
define void @function3 ( ) #0 {
entry:
%a = alloca i32 , align 4
%b = alloca i32 , align 4
%0 = load i32 , i32 * %a , align 4
%1 = load i32 , i32 * %b , align 4
%add = add i32 %0 , %1
%mul = mul i32 %0 , %1
%sub = sub i32 %0 , %1
%div = sdiv i32 %0 , %1
2021-01-04 06:44:20 +01:00
%add1 = add i32 %0 , %1
%mul1 = mul i32 %0 , %1
%sub1 = sub i32 %0 , %1
%div1 = sdiv i32 %0 , %1
2020-08-24 11:21:38 +02:00
%add2 = add i32 %0 , %1
%mul2 = mul i32 %0 , %1
%sub2 = sub i32 %0 , %1
%div2 = sdiv i32 %0 , %1
2021-01-04 06:44:20 +01:00
%mul3 = mul i32 %0 , %1
2020-08-24 11:21:38 +02:00
ret void
}
define void @function4 ( ) #0 {
entry:
%a = alloca i32 , align 4
%b = alloca i32 , align 4
%0 = load i32 , i32 * %a , align 4
%1 = load i32 , i32 * %b , align 4
%add = add i32 %0 , %1
%mul = mul i32 %0 , %1
%sub = sub i32 %0 , %1
%div = sdiv i32 %0 , %1
2021-01-04 06:44:20 +01:00
%add1 = add i32 %0 , %1
%mul1 = mul i32 %0 , %1
%sub1 = sub i32 %0 , %1
%div1 = sdiv i32 %0 , %1
2020-08-24 11:21:38 +02:00
%add2 = add i32 %0 , %1
%mul2 = mul i32 %0 , %1
%sub2 = sub i32 %0 , %1
%div2 = sdiv i32 %0 , %1
2021-01-04 06:44:20 +01:00
%div3 = sdiv i32 %0 , %1
2020-08-24 11:21:38 +02:00
ret void
}