Skip to content

Commit 7016169

Browse files
committed
AMDGPU: Use isWave[32|64] instead of comparing size value
1 parent dad0898 commit 7016169

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16677,8 +16677,8 @@ SITargetLowering::getRegClassFor(MVT VT, bool isDivergent) const {
1667716677
const TargetRegisterClass *RC = TargetLoweringBase::getRegClassFor(VT, false);
1667816678
const SIRegisterInfo *TRI = Subtarget->getRegisterInfo();
1667916679
if (RC == &AMDGPU::VReg_1RegClass && !isDivergent)
16680-
return Subtarget->getWavefrontSize() == 64 ? &AMDGPU::SReg_64RegClass
16681-
: &AMDGPU::SReg_32RegClass;
16680+
return Subtarget->isWave64() ? &AMDGPU::SReg_64RegClass
16681+
: &AMDGPU::SReg_32RegClass;
1668216682
if (!TRI->isSGPRClass(RC) && !isDivergent)
1668316683
return TRI->getEquivalentSGPRClass(RC);
1668416684
if (TRI->isSGPRClass(RC) && isDivergent)

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7699,8 +7699,8 @@ void SIInstrInfo::lowerSelect(SIInstrWorklist &Worklist, MachineInstr &Inst,
76997699
// Insert a trivial select instead of creating a copy, because a copy from
77007700
// SCC would semantically mean just copying a single bit, but we may need
77017701
// the result to be a vector condition mask that needs preserving.
7702-
unsigned Opcode = (ST.getWavefrontSize() == 64) ? AMDGPU::S_CSELECT_B64
7703-
: AMDGPU::S_CSELECT_B32;
7702+
unsigned Opcode =
7703+
ST.isWave64() ? AMDGPU::S_CSELECT_B64 : AMDGPU::S_CSELECT_B32;
77047704
auto NewSelect =
77057705
BuildMI(MBB, MII, DL, get(Opcode), NewCondReg).addImm(-1).addImm(0);
77067706
NewSelect->getOperand(3).setIsUndef(Cond.isUndef());
@@ -8712,7 +8712,7 @@ uint64_t SIInstrInfo::getScratchRsrcWords23() const {
87128712
}
87138713

87148714
// IndexStride = 64 / 32.
8715-
uint64_t IndexStride = ST.getWavefrontSize() == 64 ? 3 : 2;
8715+
uint64_t IndexStride = ST.isWave64() ? 3 : 2;
87168716
Rsrc23 |= IndexStride << AMDGPU::RSRC_INDEX_STRIDE_SHIFT;
87178717

87188718
// If TID_ENABLE is set, DATA_FORMAT specifies stride bits [14:17].

llvm/lib/Target/AMDGPU/SIInstrInfo.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
def isWave32 : Predicate<"Subtarget->getWavefrontSize() == 32">,
9+
def isWave32 : Predicate<"Subtarget->isWave32()">,
1010
AssemblerPredicate <(all_of FeatureWavefrontSize32)>;
11-
def isWave64 : Predicate<"Subtarget->getWavefrontSize() == 64">,
11+
def isWave64 : Predicate<"Subtarget->isWave64()">,
1212
AssemblerPredicate <(all_of FeatureWavefrontSize64)>;
1313

1414
class AMDGPUMnemonicAlias<string From, string To, string VariantName = "">

0 commit comments

Comments
 (0)