-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[AMDGPU] Avoid changing minOccupancy if unclustered schedule was not run for any region. #162025
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
294fe5a
[AMDGPU] Reset minOccupancy if unclustered schedule was not run for a…
dhruvachak c2419e7
Move IsAnyRegionScheduled to UnclusteredHighRPStage.
dhruvachak 19555ec
Avoid modifying DAG and MFI minOccupancy before a region is scheduled.
dhruvachak 48c6120
Addressed feedback.
dhruvachak 38b5016
Dropped all the LLT references.
dhruvachak aebd821
Added option -stress-regalloc, allowing the test to be shortened.
dhruvachak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
56 changes: 56 additions & 0 deletions
56
llvm/test/CodeGen/AMDGPU/schedule-regpressure-no-unclustered-regions.mir
This file contains hidden or 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,56 @@ | ||
| # REQUIRES: asserts | ||
| # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -start-before=machine-scheduler -stop-after=greedy,2 -stress-regalloc=4 -debug-only=machine-scheduler %s -o - 2>&1 | FileCheck %s | ||
|
|
||
| --- | | ||
| define amdgpu_kernel void @no_sched_metric_due_to_spills() #0 { | ||
| ret void | ||
| } | ||
|
|
||
| attributes #0 = { "amdgpu-flat-work-group-size"="1,256" } | ||
| ... | ||
|
|
||
| # This test checks for the following scenario: Unclustered high-RP-reschedule | ||
| # stage raises the occupancy target temporarily but no region gets scheduled | ||
| # because of constraints. Then, DAG and MFI min-occupancy should not be changed | ||
| # at the end of the unclustered schedule stage. | ||
| # CHECK: Retrying function scheduling without clustering. Aggressively try to reduce register pressure to achieve occupancy 5. | ||
| # CHECK: Unclustered High Register Pressure Reschedule: No regions scheduled, min occupancy stays at 4, MFI occupancy stays at 4. | ||
|
|
||
| --- | ||
| name: no_sched_metric_due_to_spills | ||
| tracksRegLiveness: true | ||
| machineFunctionInfo: | ||
| stackPtrOffsetReg: '$sgpr32' | ||
| occupancy: 4 | ||
| body: | | ||
| bb.0: | ||
| liveins: $vgpr0, $sgpr0_sgpr1, $sgpr15 | ||
|
|
||
| %0:sgpr_32 = COPY $sgpr15 | ||
| %1:sgpr_64 = COPY $sgpr0_sgpr1 | ||
| %2:vgpr_32 = COPY $vgpr0 | ||
| %3:sgpr_128 = S_LOAD_DWORDX4_IMM %1, 0, 0 :: (dereferenceable invariant load (s128), addrspace 4) | ||
| undef %4.sub0_sub1:sgpr_128 = S_LOAD_DWORDX2_IMM %1, 16, 0 :: (dereferenceable invariant load (s64), align 16, addrspace 4) | ||
| %5:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 32, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %6:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 64, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %7:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 84, 0 :: (dereferenceable invariant load (s32), addrspace 4) | ||
| %8:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 112, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %9:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 128, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %10:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 176, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %11:sreg_32_xm0_xexec = S_LOAD_DWORD_IMM %1, 192, 0 :: (dereferenceable invariant load (s32), align 8, addrspace 4) | ||
| %12:sreg_64_xexec = S_LOAD_DWORDX2_IMM %1, 216, 0 :: (dereferenceable invariant load (s64), addrspace 4) | ||
| %13:sreg_32 = S_ADD_I32 %12.sub0, 127, implicit-def dead $scc | ||
| %14:sreg_32 = S_ASHR_I32 %13, 31, implicit-def dead $scc | ||
| %15:sreg_32 = S_LSHR_B32 %14, 25, implicit-def dead $scc | ||
| %16:sreg_32 = S_ADD_I32 %13, %15, implicit-def dead $scc | ||
| %17:sreg_32 = S_ASHR_I32 %16, 7, implicit-def dead $scc | ||
| %18:sreg_32 = S_ADD_I32 %12.sub1, 255, implicit-def dead $scc | ||
| %19:sreg_32 = S_ASHR_I32 %18, 31, implicit-def dead $scc | ||
| %20:sreg_32 = S_LSHR_B32 %19, 24, implicit-def dead $scc | ||
| %21:sreg_32 = S_ADD_I32 %18, %20, implicit-def dead $scc | ||
| %22:sreg_32 = S_ASHR_I32 %21, 8, implicit-def dead $scc | ||
| %23:sreg_32 = nsw S_MUL_I32 %22, %17 | ||
| %24:sreg_32 = S_ASHR_I32 %0, 31, implicit-def dead $scc | ||
| S_ENDPGM 0 | ||
|
|
||
| ... | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.