-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[profcheck] Require unknown
metadata have an origin parameter
#157594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
; RUN: opt -passes=verify %t/unknown-correct.ll --disable-output | ||
|
||
; RUN: not opt -passes=verify %t/unknown-invalid.ll --disable-output 2>&1 | FileCheck %s --check-prefix=EXTRA-ARGS | ||
; RUN: not opt -passes=verify %t/unknown-noargs.ll --disable-output 2>&1 | FileCheck %s --check-prefix=NO-ARGS | ||
; RUN: not opt -passes=verify %t/unknown-empty.ll --disable-output 2>&1 | FileCheck %s --check-prefix=EMPTY-ARGS | ||
; RUN: opt -passes=verify %t/unknown-on-function1.ll -S -o - | FileCheck %s --check-prefix=ON-FUNCTION1 | ||
; RUN: not opt -passes=verify %t/unknown-on-function2.ll --disable-output 2>&1 | FileCheck %s --check-prefix=ON-FUNCTION2 | ||
; RUN: not opt -passes=verify %t/invalid-unknown-placement.ll --disable-output 2>&1 | FileCheck %s --check-prefix=INVALID-UNKNOWN-PLACEMENT | ||
|
@@ -111,7 +113,7 @@ exit: | |
ret i32 %r | ||
} | ||
|
||
!0 = !{!"unknown"} | ||
!0 = !{!"unknown", !"test"} | ||
|
||
;--- unknown-invalid.ll | ||
define void @test(i32 %a) { | ||
|
@@ -124,14 +126,14 @@ no: | |
} | ||
|
||
!0 = !{!"unknown", i32 12, i32 67} | ||
; EXTRA-ARGS: 'unknown' !prof should have no additional operands | ||
; EXTRA-ARGS: 'unknown' !prof should have a single additional operand | ||
|
||
;--- unknown-on-function1.ll | ||
define void @test() !prof !0 { | ||
ret void | ||
} | ||
|
||
!0 = !{!"unknown"} | ||
!0 = !{!"unknown", !"test"} | ||
; ON-FUNCTION1: define void @test() !prof !0 | ||
|
||
;--- unknown-on-function2.ll | ||
|
@@ -140,12 +142,38 @@ define void @test() !prof !0 { | |
} | ||
|
||
!0 = !{!"unknown", i64 123} | ||
; ON-FUNCTION2: first operand should be 'function_entry_count' or 'synthetic_function_entry_count' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens to this error message (about entry count)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it became more specific. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a different check -- the original test case intends to check entry count being the first one, so perhaps change this test to have value second operand. |
||
; ON-FUNCTION2: 'unknown' !prof should have an additional operand of type string | ||
|
||
;--- invalid-unknown-placement.ll | ||
define i32 @test() { | ||
%r = add i32 1, 2, !prof !0 | ||
ret i32 %r | ||
} | ||
!0 = !{!"unknown"} | ||
!0 = !{!"unknown", !"test"} | ||
; INVALID-UNKNOWN-PLACEMENT: 'unknown' !prof should only appear on instructions on which 'branch_weights' would | ||
mtrofin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
;--- unknown-noargs.ll | ||
define void @test(i32 %a) { | ||
%c = icmp eq i32 %a, 0 | ||
br i1 %c, label %yes, label %no, !prof !0 | ||
yes: | ||
ret void | ||
no: | ||
ret void | ||
} | ||
|
||
!0 = !{!"unknown"} | ||
; NO-ARGS: 'unknown' !prof should have a single additional operand | ||
|
||
;--- unknown-empty.ll | ||
define void @test(i32 %a) { | ||
%c = icmp eq i32 %a, 0 | ||
br i1 %c, label %yes, label %no, !prof !0 | ||
yes: | ||
ret void | ||
no: | ||
ret void | ||
} | ||
|
||
!0 = !{!"unknown", !""} | ||
; EMPTY-ARGS: the 'unknown' !prof operand should not be an empty string |
Uh oh!
There was an error while loading. Please reload this page.