Skip to content

Commit 7d86904

Browse files
authored
[AMDGPU] Hoist some constant stuff out of the loop in AMDGPUAsmParser.cpp. NFC. (#133398)
1 parent 319045d commit 7d86904

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9428,6 +9428,12 @@ void AMDGPUAsmParser::cvtVOP3DPP(MCInst &Inst, const OperandVector &Operands,
94289428
}
94299429

94309430
int Fi = 0;
9431+
int VdstInIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdst_in);
9432+
bool IsVOP3CvtSrDpp = Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp8_gfx12 ||
9433+
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp8_gfx12 ||
9434+
Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp_gfx12 ||
9435+
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp_gfx12;
9436+
94319437
for (unsigned E = Operands.size(); I != E; ++I) {
94329438

94339439
if (IsMAC) {
@@ -9442,16 +9448,10 @@ void AMDGPUAsmParser::cvtVOP3DPP(MCInst &Inst, const OperandVector &Operands,
94429448
}
94439449
}
94449450

9445-
int VdstInIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdst_in);
94469451
if (VdstInIdx == static_cast<int>(Inst.getNumOperands())) {
94479452
Inst.addOperand(Inst.getOperand(0));
94489453
}
94499454

9450-
bool IsVOP3CvtSrDpp =
9451-
Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp8_gfx12 ||
9452-
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp8_gfx12 ||
9453-
Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp_gfx12 ||
9454-
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp_gfx12;
94559455
if (IsVOP3CvtSrDpp) {
94569456
if (Src2ModIdx == static_cast<int>(Inst.getNumOperands())) {
94579457
Inst.addOperand(MCOperand::createImm(0));

0 commit comments

Comments
 (0)