-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IR][PGO] Verify invalid MD_prof
metadata on instructions
#145576
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
; Test MD_prof validation | ||
|
||
; RUN: split-file %s %t | ||
; RUN: opt -passes=verify %t/valid.ll --disable-output | ||
; RUN: not opt -passes=verify %t/invalid1.ll --disable-output 2>&1 | FileCheck %s | ||
; RUN: not opt -passes=verify %t/invalid2.ll --disable-output 2>&1 | FileCheck %s | ||
Comment on lines
+5
to
+6
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. Seems a bit ad-hoc to share the rely on the check annotation of the source file. I'm unsure how this is done normally, so maybe this is fine(?). 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. The usual way to do this is passing |
||
|
||
;--- valid.ll | ||
define void @test(i1 %0) { | ||
br i1 %0, label %2, label %3, !prof !0 | ||
2: | ||
ret void | ||
3: | ||
ret void | ||
} | ||
!0 = !{!"branch_weights", i32 1, i32 2} | ||
|
||
;--- invalid1.ll | ||
define void @test(i1 %0) { | ||
br i1 %0, label %2, label %3, !prof !0 | ||
2: | ||
ret void | ||
3: | ||
ret void | ||
} | ||
!0 = !{!"invalid", i32 1, i32 2} | ||
|
||
;--- invalid2.ll | ||
define void @test(i1 %0) { | ||
br i1 %0, label %2, label %3, !prof !0 | ||
2: | ||
ret void | ||
3: | ||
ret void | ||
} | ||
|
||
!0 = !{!"function_entry_count", i32 1} | ||
|
||
; CHECK: expected either branch_weights or VP profile name |
Uh oh!
There was an error while loading. Please reload this page.