Skip to content

Commit 2ad029b

Browse files
committed
[AMDGPU] Hoist some constant stuff out of the loop in AMDGPUAsmParser.cpp. NFC.
1 parent 71f43a7 commit 2ad029b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9428,6 +9428,13 @@ 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 =
9433+
Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp8_gfx12 ||
9434+
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp8_gfx12 ||
9435+
Opc == AMDGPU::V_CVT_SR_BF8_F32_gfx12_e64_dpp_gfx12 ||
9436+
Opc == AMDGPU::V_CVT_SR_FP8_F32_gfx12_e64_dpp_gfx12;
9437+
94319438
for (unsigned E = Operands.size(); I != E; ++I) {
94329439

94339440
if (IsMAC) {
@@ -9442,16 +9449,10 @@ void AMDGPUAsmParser::cvtVOP3DPP(MCInst &Inst, const OperandVector &Operands,
94429449
}
94439450
}
94449451

9445-
int VdstInIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdst_in);
94469452
if (VdstInIdx == static_cast<int>(Inst.getNumOperands())) {
94479453
Inst.addOperand(Inst.getOperand(0));
94489454
}
94499455

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;
94559456
if (IsVOP3CvtSrDpp) {
94569457
if (Src2ModIdx == static_cast<int>(Inst.getNumOperands())) {
94579458
Inst.addOperand(MCOperand::createImm(0));

0 commit comments

Comments
 (0)