-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[llvm][CodeGen] Fixed max cycle calculation with zero-cost instructions for window scheduler #99454
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,45 @@ | ||
# REQUIRES: asserts | ||
# RUN: llc --march=hexagon %s -run-pass=pipeliner -debug-only=pipeliner \ | ||
# RUN: -window-sched=force -filetype=null -verify-machineinstrs 2>&1 \ | ||
# RUN: | FileCheck %s | ||
|
||
# CHECK-NOT: Can't find a valid II. Keep searching... | ||
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. A check-not check for a specific message is fragile and practically useless. This needs positive checks 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. Updated 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. CHECK-NEXT and -implicit-check-not are more reliable than putting a CHECK-NOT in one place |
||
# CHECK: Start analyzing II | ||
# CHECK: Start scheduling Phis | ||
# CHECK: Current window Offset is {{[0-9]+}} and II is {{[0-9]+}} | ||
|
||
--- | ||
name: relu | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
successors: %bb.2(0x30000000), %bb.1(0x50000000) | ||
liveins: $r0, $r1, $r2 | ||
%0:intregs = COPY $r2 | ||
%1:intregs = COPY $r1 | ||
%2:intregs = COPY $r0 | ||
%3:predregs = C2_cmpeqi %2, 0 | ||
J2_jumpt killed %3, %bb.2, implicit-def dead $pc | ||
J2_jump %bb.1, implicit-def dead $pc | ||
bb.1: | ||
successors: %bb.3(0x80000000) | ||
%4:hvxvr = V6_vd0 | ||
%5:intregs = A2_addi %2, 31 | ||
%6:intregs = S2_lsr_i_r %5, 5 | ||
%7:intregs = COPY %6 | ||
J2_loop0r %bb.3, %7, implicit-def $lc0, implicit-def $sa0, implicit-def $usr | ||
J2_jump %bb.3, implicit-def dead $pc | ||
bb.2: | ||
PS_jmpret $r31, implicit-def dead $pc | ||
bb.3 (machine-block-address-taken): | ||
successors: %bb.3(0x7c000000), %bb.2(0x04000000) | ||
%8:intregs = PHI %1, %bb.1, %9, %bb.3 | ||
%10:intregs = PHI %0, %bb.1, %14, %bb.3 | ||
%11:hvxvr, %9:intregs = V6_vL32b_pi %8, 128 | ||
%12:intregs = COPY %10 | ||
%13:hvxvr = V6_vmaxw killed %11, %4 | ||
%14:intregs = V6_vS32b_pi %12, 128, killed %13 | ||
ENDLOOP0 %bb.3, implicit-def $pc, implicit-def $lc0, implicit $sa0, implicit $lc0 | ||
J2_jump %bb.2, implicit-def dead $pc | ||
... | ||
|
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.
Why does this hook exist? How is it different from isMetaInstruction?
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.
Also copy should need resource checks?
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.
COPY
is a typical example of a zero-cost instructionCOPY
do not occupy hardware resources so they do not require resource checks, they still need to be handled during instruction scheduling to ensure proper execution.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.
This is a very target specific assumption but ok