-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
AMDGPU: Use isWave[32|64] instead of comparing size value #117411
Merged
arsenm
merged 1 commit into
main
from
users/arsenm/wavesize-check-iswavesize-instead-of-value
Nov 23, 2024
Merged
AMDGPU: Use isWave[32|64] instead of comparing size value #117411
arsenm
merged 1 commit into
main
from
users/arsenm/wavesize-check-iswavesize-instead-of-value
Nov 23, 2024
Conversation
This file contains 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 stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesFull diff: https://github.com/llvm/llvm-project/pull/117411.diff 3 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index e520dfff1016b2..73ca59fe320d27 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -16677,8 +16677,8 @@ SITargetLowering::getRegClassFor(MVT VT, bool isDivergent) const {
const TargetRegisterClass *RC = TargetLoweringBase::getRegClassFor(VT, false);
const SIRegisterInfo *TRI = Subtarget->getRegisterInfo();
if (RC == &AMDGPU::VReg_1RegClass && !isDivergent)
- return Subtarget->getWavefrontSize() == 64 ? &AMDGPU::SReg_64RegClass
- : &AMDGPU::SReg_32RegClass;
+ return Subtarget->isWave64() ? &AMDGPU::SReg_64RegClass
+ : &AMDGPU::SReg_32RegClass;
if (!TRI->isSGPRClass(RC) && !isDivergent)
return TRI->getEquivalentSGPRClass(RC);
if (TRI->isSGPRClass(RC) && isDivergent)
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index b7c008235fb7ae..74c840f5b3ba07 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -7699,8 +7699,8 @@ void SIInstrInfo::lowerSelect(SIInstrWorklist &Worklist, MachineInstr &Inst,
// Insert a trivial select instead of creating a copy, because a copy from
// SCC would semantically mean just copying a single bit, but we may need
// the result to be a vector condition mask that needs preserving.
- unsigned Opcode = (ST.getWavefrontSize() == 64) ? AMDGPU::S_CSELECT_B64
- : AMDGPU::S_CSELECT_B32;
+ unsigned Opcode =
+ ST.isWave64() ? AMDGPU::S_CSELECT_B64 : AMDGPU::S_CSELECT_B32;
auto NewSelect =
BuildMI(MBB, MII, DL, get(Opcode), NewCondReg).addImm(-1).addImm(0);
NewSelect->getOperand(3).setIsUndef(Cond.isUndef());
@@ -8712,7 +8712,7 @@ uint64_t SIInstrInfo::getScratchRsrcWords23() const {
}
// IndexStride = 64 / 32.
- uint64_t IndexStride = ST.getWavefrontSize() == 64 ? 3 : 2;
+ uint64_t IndexStride = ST.isWave64() ? 3 : 2;
Rsrc23 |= IndexStride << AMDGPU::RSRC_INDEX_STRIDE_SHIFT;
// If TID_ENABLE is set, DATA_FORMAT specifies stride bits [14:17].
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.td b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
index 885f72494a8f68..78348b8fab0c6a 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.td
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.td
@@ -6,9 +6,9 @@
//
//===----------------------------------------------------------------------===//
-def isWave32 : Predicate<"Subtarget->getWavefrontSize() == 32">,
+def isWave32 : Predicate<"Subtarget->isWave32()">,
AssemblerPredicate <(all_of FeatureWavefrontSize32)>;
-def isWave64 : Predicate<"Subtarget->getWavefrontSize() == 64">,
+def isWave64 : Predicate<"Subtarget->isWave64()">,
AssemblerPredicate <(all_of FeatureWavefrontSize64)>;
class AMDGPUMnemonicAlias<string From, string To, string VariantName = "">
|
jhuber6
approved these changes
Nov 23, 2024
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.
LG
arsenm
force-pushed
the
users/arsenm/remove-wave64-feature-from-default-target
branch
from
November 23, 2024 05:55
dad0898
to
a9b9b65
Compare
arsenm
force-pushed
the
users/arsenm/wavesize-check-iswavesize-instead-of-value
branch
from
November 23, 2024 05:55
7016169
to
7dfd593
Compare
This was referenced Nov 23, 2024
arsenm
force-pushed
the
users/arsenm/wavesize-check-iswavesize-instead-of-value
branch
from
November 23, 2024 05:59
7dfd593
to
baa4dc1
Compare
arsenm
force-pushed
the
users/arsenm/remove-wave64-feature-from-default-target
branch
from
November 23, 2024 16:06
0f6254a
to
79ff6e6
Compare
arsenm
force-pushed
the
users/arsenm/wavesize-check-iswavesize-instead-of-value
branch
from
November 23, 2024 16:06
baa4dc1
to
af7d891
Compare
arsenm
force-pushed
the
users/arsenm/remove-wave64-feature-from-default-target
branch
from
November 23, 2024 17:25
79ff6e6
to
6fa5b9a
Compare
Base automatically changed from
users/arsenm/remove-wave64-feature-from-default-target
to
main
November 23, 2024 17:27
arsenm
force-pushed
the
users/arsenm/wavesize-check-iswavesize-instead-of-value
branch
from
November 23, 2024 17:28
af7d891
to
149c84e
Compare
arsenm
deleted the
users/arsenm/wavesize-check-iswavesize-instead-of-value
branch
November 23, 2024 17:31
huixie90
pushed a commit
to huixie90/llvm-project
that referenced
this pull request
Nov 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.