Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InlineCost] InlineCostAnnotationWriterPass introduced
This class allows to see the inliner's decisions for better optimization verifications and tests. To use, use flag "-passes="print<inline-cost>"". This is the second attempt to integrate the patch. The problem from the first try has been discussed and fixed in D82205. Reviewers: apilipenko, mtrofin, davidxl, fedor.sergeev Reviewed By: mtrofin Differential revision: https://reviews.llvm.org/D81743
- Loading branch information
Kirill Naumov
committed
Jun 24, 2020
1 parent
a61c73d
commit 6a5d7d4
Showing
6 changed files
with
93 additions
and
49 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
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
32 changes: 32 additions & 0 deletions
32
llvm/test/Transforms/Inline/inline-cost-annotation-pass.ll
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,32 @@ | ||
; RUN: opt < %s -passes="print<inline-cost>" 2>&1 | FileCheck %s | ||
|
||
; CHECK: Analyzing call of foo... (caller:main) | ||
; CHECK: define i8 addrspace(1)** @foo() { | ||
; CHECK: cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}} | ||
; CHECK: %1 = inttoptr i64 754974720 to i8 addrspace(1)** | ||
; CHECK: cost before = {{.*}}, cost after = {{.*}}, threshold before = {{.*}}, threshold after = {{.*}}, cost delta = {{.*}} | ||
; CHECK: ret i8 addrspace(1)** %1 | ||
; CHECK: } | ||
; CHECK: NumConstantArgs: {{.*}} | ||
; CHECK: NumConstantOffsetPtrArgs: {{.*}} | ||
; CHECK: NumAllocaArgs: {{.*}} | ||
; CHECK: NumConstantPtrCmps: {{.*}} | ||
; CHECK: NumConstantPtrDiffs: {{.*}} | ||
; CHECK: NumInstructionsSimplified: {{.*}} | ||
; CHECK: NumInstructions: {{.*}} | ||
; CHECK: SROACostSavings: {{.*}} | ||
; CHECK: SROACostSavingsLost: {{.*}} | ||
; CHECK: LoadEliminationCost: {{.*}} | ||
; CHECK: ContainsNoDuplicateCall: {{.*}} | ||
; CHECK: Cost: {{.*}} | ||
; CHECK: Threshold: {{.*}} | ||
|
||
define i8 addrspace(1)** @foo() { | ||
%1 = inttoptr i64 754974720 to i8 addrspace(1)** | ||
ret i8 addrspace(1)** %1 | ||
} | ||
|
||
define i8 addrspace(1)** @main() { | ||
%1 = call i8 addrspace(1)** @foo() | ||
ret i8 addrspace(1)** %1 | ||
} |
22 changes: 0 additions & 22 deletions
22
llvm/test/Transforms/Inline/print-instructions-deltas-unfinished.ll
This file was deleted.
Oops, something went wrong.