-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AMDGPU] Avoid put implicit_def into bundle that break reg's liveness #142563
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 70 commits
3dc03fb
2fcb149
80decd5
f58ef06
09b8fe5
f3550df
915335a
c1b220c
a002223
03e031b
f42e25d
11659cd
77a7133
645776b
f606540
cfa6151
b18da74
3d8ef74
cbbc41e
d4db5d5
027802b
849b834
88c1ac8
abd5e4b
5f2f332
d5d3d62
1f90eda
a651fbf
44d8db6
e422935
3d81548
5d5bb3a
fa9c8fe
48c869d
047ef09
9f6ea59
d90bc62
810092f
4e8b5c4
daffa51
b36f3fc
51b0d71
2e72677
49f6ee5
5403864
eac10fb
3c3b15d
fc87143
09c4b66
d75fa3d
114ce02
cf3344e
1026e5e
8706753
e59fe4e
23f8c29
db3dbfc
fb35271
957b617
500e352
39115f1
6326f19
939051b
0e4e1b8
63e957e
b54bb86
002ecc5
a9b4c4e
4ba4334
7abccdd
6eadc58
eee8139
58ebd67
c0febed
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,19 @@ static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, | |||||
| return DebugLoc(); | ||||||
| } | ||||||
|
|
||||||
| static bool containReg(SmallSetVector<Register, 32> LocalDefsV, | ||||||
|
||||||
| SmallSetVector<MCRegUnit, 32> LocalDefsP, Register Reg, | ||||||
| const TargetRegisterInfo *TRI) { | ||||||
| if (Reg.isPhysical()) { | ||||||
| for (MCRegUnit Unit : TRI->regunits(MCRegister::from(Reg.id()))) | ||||||
|
||||||
| for (MCRegUnit Unit : TRI->regunits(MCRegister::from(Reg.id()))) | |
| for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg()))) |
Outdated
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.
RegUnits are supposed to be treated as a bitmask, using a SmallSetVector for them is unnecessarily heavy
Outdated
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.
| if (containReg(LocalDefs, LocalDefsP, Reg, TRI)) { | |
| if (containsReg(LocalDefs, LocalDefsP, Reg, TRI)) { |
Outdated
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.
| for (MCRegUnit Unit : TRI->regunits(MCRegister::from(Reg.id()))) | |
| for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg()))) |
Outdated
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.
LocalDefsP.insert(TRI->regunits()) probably works, but this should be a BitVector (e.g. see LiveRegUnits' usage)
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
| # RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-insert-hard-clauses -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN-CLAUSE %s | ||
| # RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-post-ra-bundler -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN-BUNDLE %s | ||
|
|
||
| --- | ||
| name: clause_implicit_def | ||
| tracksRegLiveness: true | ||
| body: | | ||
| bb.0: | ||
| liveins: $vgpr0, $sgpr32 | ||
|
|
||
| ; GCN-CLAUSE-LABEL: name: clause_implicit_def | ||
| ; GCN-CLAUSE: liveins: $vgpr0, $sgpr32 | ||
| ; GCN-CLAUSE-NEXT: {{ $}} | ||
| ; GCN-CLAUSE-NEXT: BUNDLE implicit-def $vgpr2, implicit-def $vgpr3, implicit $vgpr0, implicit $sgpr32, implicit $exec, implicit $flat_scr { | ||
| ; GCN-CLAUSE-NEXT: S_CLAUSE 1 | ||
| ; GCN-CLAUSE-NEXT: SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr | ||
| ; GCN-CLAUSE-NEXT: $vgpr2 = IMPLICIT_DEF | ||
| ; GCN-CLAUSE-NEXT: $vgpr3 = IMPLICIT_DEF | ||
| ; GCN-CLAUSE-NEXT: SCRATCH_STORE_DWORDX2_SADDR internal $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr | ||
| ; GCN-CLAUSE-NEXT: } | ||
| ; | ||
| ; GCN-BUNDLE-LABEL: name: clause_implicit_def | ||
| ; GCN-BUNDLE: liveins: $vgpr0, $sgpr32 | ||
| ; GCN-BUNDLE-NEXT: {{ $}} | ||
| ; GCN-BUNDLE-NEXT: BUNDLE implicit-def $vgpr2, implicit-def $vgpr3, implicit $vgpr0, implicit $sgpr32, implicit $exec, implicit $flat_scr { | ||
| ; GCN-BUNDLE-NEXT: SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr | ||
| ; GCN-BUNDLE-NEXT: $vgpr2 = IMPLICIT_DEF | ||
| ; GCN-BUNDLE-NEXT: $vgpr3 = IMPLICIT_DEF | ||
| ; GCN-BUNDLE-NEXT: SCRATCH_STORE_DWORDX2_SADDR internal $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr | ||
| ; GCN-BUNDLE-NEXT: } | ||
| SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr | ||
| $vgpr2 = IMPLICIT_DEF | ||
| $vgpr3 = IMPLICIT_DEF | ||
| SCRATCH_STORE_DWORDX2_SADDR $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr | ||
| ... |
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.