Skip to content

Commit 5d3a864

Browse files
committed
[GlobalISel] Move getOpcode() calls inside assert() to avoid (void)s. NFC.
Tidier solution to the unused variable warnings - we already do this in other places in this file.
1 parent a190fcd commit 5d3a864

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,9 +4618,8 @@ bool CombinerHelper::matchMulOBy2(MachineInstr &MI, BuildFnTy &MatchInfo) {
46184618

46194619
bool CombinerHelper::matchMulOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
46204620
// (G_*MULO x, 0) -> 0 + no carry out
4621-
unsigned Opc = MI.getOpcode();
4622-
(void)Opc;
4623-
assert(Opc == TargetOpcode::G_UMULO || Opc == TargetOpcode::G_SMULO);
4621+
assert(MI.getOpcode() == TargetOpcode::G_UMULO ||
4622+
MI.getOpcode() == TargetOpcode::G_SMULO);
46244623
if (!mi_match(MI.getOperand(3).getReg(), MRI, m_SpecificICstOrSplat(0)))
46254624
return false;
46264625
Register Dst = MI.getOperand(0).getReg();
@@ -4637,9 +4636,8 @@ bool CombinerHelper::matchMulOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
46374636

46384637
bool CombinerHelper::matchAddOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
46394638
// (G_*ADDO x, 0) -> x + no carry out
4640-
unsigned Opc = MI.getOpcode();
4641-
(void)Opc;
4642-
assert(Opc == TargetOpcode::G_UADDO || Opc == TargetOpcode::G_SADDO);
4639+
assert(MI.getOpcode() == TargetOpcode::G_UADDO ||
4640+
MI.getOpcode() == TargetOpcode::G_SADDO);
46434641
if (!mi_match(MI.getOperand(3).getReg(), MRI, m_SpecificICstOrSplat(0)))
46444642
return false;
46454643
Register Carry = MI.getOperand(1).getReg();

0 commit comments

Comments
 (0)