-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[AMDGPU] Remove wavefrontsize feature from GFX10+ #98400
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 1 commit
ac6a483
55dda8d
d09e31c
f5ebe7c
51b32be
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 |
---|---|---|
|
@@ -105,6 +105,14 @@ GCNSubtarget::initializeSubtargetDependencies(const Triple &TT, | |
: AMDGPUSubtarget::SOUTHERN_ISLANDS; | ||
} | ||
|
||
if (!hasFeature(AMDGPU::FeatureWavefrontSize32) && | ||
!hasFeature(AMDGPU::FeatureWavefrontSize64)) { | ||
if (getGeneration() >= AMDGPUSubtarget::GFX10) | ||
ToggleFeature(AMDGPU::FeatureWavefrontSize32); | ||
else | ||
ToggleFeature(AMDGPU::FeatureWavefrontSize64); | ||
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. I think we can avoid this by having a separate SupportsWave32 feature implied by FeatureWavefrontSize32 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. We still need to select default somewhere. So say a subtarget has FeatureSupportsWave32, then what? 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. I.e. the line Also I shall mention, this 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. Just did that, unconditionally add wave32 if none is set. 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. I mean if you use the implies feature, the feature parsing logic should flip the incompatible case for you instead of manually doing it here 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. I do not see a way to tell it is incompatible in the first place. OK, wave32 implies it supports wave32. How does it turn wave32 automatically? How does it tell that wave64 is incompatible with wave32? 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. IMHO to do what you want features must be:
None of that exists. 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. I mean if there's a SupportsWave32 feature, implied by FeatureWavefrontSize32, if you specify wavefrontsize32 to a wave64-only target, the incompatible feature check in the parsing logic will hit and it will assume you specified an invalid target and unset the target-cpu. |
||
} | ||
|
||
// We don't support FP64 for EG/NI atm. | ||
assert(!hasFP64() || (getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS)); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,10 +45,26 @@ using namespace llvm; | |
|
||
using DecodeStatus = llvm::MCDisassembler::DecodeStatus; | ||
|
||
static const MCSubtargetInfo &addDefaultWaveSize(const MCSubtargetInfo &STI, | ||
MCContext &Ctx) { | ||
if (!STI.hasFeature(AMDGPU::FeatureWavefrontSize64) && | ||
!STI.hasFeature(AMDGPU::FeatureWavefrontSize32)) { | ||
MCSubtargetInfo &STICopy = Ctx.getSubtargetCopy(STI); | ||
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. Don't really understand this subtargetcopy business 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. STI is const, I cannot just flip the bit. The same is done in the AsmParser with copySTI(). |
||
if (AMDGPU::isGFX10Plus(STI)) | ||
STICopy.ToggleFeature(AMDGPU::FeatureWavefrontSize32); | ||
else | ||
STICopy.ToggleFeature(AMDGPU::FeatureWavefrontSize64); | ||
return STICopy; | ||
} | ||
|
||
return STI; | ||
} | ||
|
||
AMDGPUDisassembler::AMDGPUDisassembler(const MCSubtargetInfo &STI, | ||
MCContext &Ctx, MCInstrInfo const *MCII) | ||
: MCDisassembler(STI, Ctx), MCII(MCII), MRI(*Ctx.getRegisterInfo()), | ||
MAI(*Ctx.getAsmInfo()), TargetMaxInstBytes(MAI.getMaxInstLength(&STI)), | ||
: MCDisassembler(addDefaultWaveSize(STI, Ctx), Ctx), MCII(MCII), | ||
MRI(*Ctx.getRegisterInfo()), MAI(*Ctx.getAsmInfo()), | ||
TargetMaxInstBytes(MAI.getMaxInstLength(&STI)), | ||
CodeObjectVersion(AMDGPU::getDefaultAMDHSACodeObjectVersion()) { | ||
// ToDo: AMDGPUDisassembler supports only VI ISA. | ||
if (!STI.hasFeature(AMDGPU::FeatureGCN3Encoding) && !isGFX10Plus()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
; RUN: not llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=-wavefrontsize32,-wavefrontsize64 < %s 2>&1 | FileCheck %s -check-prefix=ERR -implicit-check-not=error: | ||
; RUN: not llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -mattr=-wavefrontsize32,-wavefrontsize64 < %s 2>&1 | FileCheck %s -check-prefix=ERR -implicit-check-not=error: | ||
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. This diagnostics is now missing, BE will just initialize wavesize to default. If we want to catch this case we would still need to scan the original string. |
||
; RUN: not llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,+wavefrontsize64 < %s 2>&1 | FileCheck %s -check-prefix=ERR -implicit-check-not=error: | ||
; RUN: not llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize32,+wavefrontsize64 < %s 2>&1 | FileCheck %s -check-prefix=ERR -implicit-check-not=error: | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.