Skip to content

Commit d5c9d40

Browse files
committed
[AMDGPU] Fix warnings about unused variables [NFC]
Without this gcc warned like ../lib/Target/AMDGPU/GCNDPPCombine.cpp:371: warning: unused variable 'OpSelOpr' [-Wunused-variable] 371 | if (auto *OpSelOpr = | ../lib/Target/AMDGPU/GCNDPPCombine.cpp:388: warning: unused variable 'OpSelHiOpr' [-Wunused-variable] 388 | if (auto *OpSelHiOpr = | Remove the unused variables.
1 parent fa13c3e commit d5c9d40

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
368368
}
369369
// Validate OP_SEL has to be set to all 0 and OP_SEL_HI has to be set to
370370
// all 1.
371-
if (auto *OpSelOpr =
372-
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
371+
if (TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel)) {
373372
int64_t OpSel = 0;
374373
OpSel |= (Mod0 ? (!!(Mod0->getImm() & SISrcMods::OP_SEL_0) << 0) : 0);
375374
OpSel |= (Mod1 ? (!!(Mod1->getImm() & SISrcMods::OP_SEL_0) << 1) : 0);
@@ -385,8 +384,7 @@ MachineInstr *GCNDPPCombine::createDPPInst(MachineInstr &OrigMI,
385384
if (AMDGPU::hasNamedOperand(DPPOp, AMDGPU::OpName::op_sel))
386385
DPPInst.addImm(OpSel);
387386
}
388-
if (auto *OpSelHiOpr =
389-
TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
387+
if (TII->getNamedOperand(OrigMI, AMDGPU::OpName::op_sel_hi)) {
390388
int64_t OpSelHi = 0;
391389
OpSelHi |= (Mod0 ? (!!(Mod0->getImm() & SISrcMods::OP_SEL_1) << 0) : 0);
392390
OpSelHi |= (Mod1 ? (!!(Mod1->getImm() & SISrcMods::OP_SEL_1) << 1) : 0);

0 commit comments

Comments
 (0)