Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This adds three Function methods to handle function entry counts: setEntryCount() and getEntryCount(). Entry counts are stored under the MD_prof metadata node with the name "function_entry_count". They are unsigned 64 bit values set by profilers (instrumentation and sample profiler changes coming up). Added documentation for new profile metadata and tests. Reviewers: dexonsmith, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9628 llvm-svn: 237260
- Loading branch information
Showing
9 changed files
with
146 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s | ||
|
||
define i32 @bad1() !prof !0 { | ||
ret i32 0 | ||
} | ||
|
||
!0 = !{i32 123, i32 3} | ||
; CHECK: assembly parsed, but does not verify as correct! | ||
; CHECK-NEXT: expected string with name of the !prof annotation | ||
; CHECK-NEXT: !0 = !{i32 123, i32 3} | ||
|
||
define i32 @bad2() !prof !1 { | ||
ret i32 0 | ||
} | ||
|
||
!1 = !{!"function_entry_count"} | ||
; CHECK-NEXT: !prof annotations should have exactly 2 operands | ||
; CHECK-NEXT: !1 = !{!"function_entry_count"} | ||
|
||
|
||
define i32 @bad3() !prof !2 { | ||
ret i32 0 | ||
} | ||
|
||
!2 = !{!"some_other_count", i64 200} | ||
; CHECK-NEXT: first operand should be 'function_entry_count' | ||
; CHECK-NEXT: !2 = !{!"some_other_count", i64 200} | ||
|
||
define i32 @bad4() !prof !3 { | ||
ret i32 0 | ||
} | ||
|
||
!3 = !{!"function_entry_count", !"string"} | ||
; CHECK-NEXT: expected integer argument to function_entry_count | ||
; CHECK-NEXT: !3 = !{!"function_entry_count", !"string"} |
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,8 @@ | ||
; RUN: llvm-as < %s -o /dev/null 2>&1 | ||
|
||
; Function foo() is called 2,304 times at runtime. | ||
define i32 @foo() !prof !0 { | ||
ret i32 0 | ||
} | ||
|
||
!0 = !{!"function_entry_count", i32 2304} |
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