-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SelectionDAG][X86] Preserve unpredictable metadata for conditional branches in SelectionDAG, as well as JCCs generated by X86 backend. #102101
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
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. Pre-commit the test case? 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. +1 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. Good idea. Submitted #102262. |
||
; Currently, unpredictable metadata on conditional branches is lost during CodeGen. | ||
; Make sure MIR generated for conditional branch with unpredictable metadata has unpredictable flag. | ||
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -stop-after=finalize-isel < %s | FileCheck %s | ||
|
||
define void @cond_branch_1(i1 %cond) { | ||
|
@@ -11,7 +11,7 @@ define void @cond_branch_1(i1 %cond) { | |
; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $edi | ||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit | ||
; CHECK-NEXT: TEST8ri killed [[COPY1]], 1, implicit-def $eflags | ||
; CHECK-NEXT: JCC_1 %bb.2, 4, implicit $eflags | ||
; CHECK-NEXT: unpredictable JCC_1 %bb.2, 4, implicit $eflags | ||
; CHECK-NEXT: JMP_1 %bb.1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: bb.1.then: | ||
|
@@ -51,7 +51,7 @@ define void @cond_branch_2(double %a, double %b, i32 %c, i32 %d) nounwind { | |
; CHECK-NEXT: [[SETCCr1:%[0-9]+]]:gr8 = SETCCr 6, implicit $eflags | ||
; CHECK-NEXT: [[OR8rr:%[0-9]+]]:gr8 = OR8rr [[SETCCr]], killed [[SETCCr1]], implicit-def dead $eflags | ||
; CHECK-NEXT: TEST8rr [[OR8rr]], [[OR8rr]], implicit-def $eflags | ||
; CHECK-NEXT: JCC_1 %bb.2, 5, implicit $eflags | ||
; CHECK-NEXT: unpredictable JCC_1 %bb.2, 5, implicit $eflags | ||
; CHECK-NEXT: JMP_1 %bb.1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: bb.1.true: | ||
|
@@ -89,8 +89,8 @@ define void @isint_branch(double %d) nounwind { | |
; CHECK-NEXT: [[CVTDQ2PDrr:%[0-9]+]]:vr128 = CVTDQ2PDrr killed [[CVTTPD2DQrr]] | ||
; CHECK-NEXT: [[COPY2:%[0-9]+]]:fr64 = COPY [[CVTDQ2PDrr]] | ||
; CHECK-NEXT: nofpexcept UCOMISDrr [[COPY]], killed [[COPY2]], implicit-def $eflags, implicit $mxcsr | ||
; CHECK-NEXT: JCC_1 %bb.2, 5, implicit $eflags | ||
; CHECK-NEXT: JCC_1 %bb.2, 10, implicit $eflags | ||
; CHECK-NEXT: unpredictable JCC_1 %bb.2, 5, implicit $eflags | ||
; CHECK-NEXT: unpredictable JCC_1 %bb.2, 10, implicit $eflags | ||
; CHECK-NEXT: JMP_1 %bb.1 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: bb.1.true: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where this get used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind. I found 09515f2 in your description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
SelectionDAGBuilder::visitSwitchCase
.