[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.
This commit is contained in:
Simon Pilgrim 2022-02-07 09:50:09 +00:00
parent a190fcdfcc
commit 5d3a86489f
1 changed files with 4 additions and 6 deletions

View File

@ -4618,9 +4618,8 @@ bool CombinerHelper::matchMulOBy2(MachineInstr &MI, BuildFnTy &MatchInfo) {
bool CombinerHelper::matchMulOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
// (G_*MULO x, 0) -> 0 + no carry out
unsigned Opc = MI.getOpcode();
(void)Opc;
assert(Opc == TargetOpcode::G_UMULO || Opc == TargetOpcode::G_SMULO);
assert(MI.getOpcode() == TargetOpcode::G_UMULO ||
MI.getOpcode() == TargetOpcode::G_SMULO);
if (!mi_match(MI.getOperand(3).getReg(), MRI, m_SpecificICstOrSplat(0)))
return false;
Register Dst = MI.getOperand(0).getReg();
@ -4637,9 +4636,8 @@ bool CombinerHelper::matchMulOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
bool CombinerHelper::matchAddOBy0(MachineInstr &MI, BuildFnTy &MatchInfo) {
// (G_*ADDO x, 0) -> x + no carry out
unsigned Opc = MI.getOpcode();
(void)Opc;
assert(Opc == TargetOpcode::G_UADDO || Opc == TargetOpcode::G_SADDO);
assert(MI.getOpcode() == TargetOpcode::G_UADDO ||
MI.getOpcode() == TargetOpcode::G_SADDO);
if (!mi_match(MI.getOperand(3).getReg(), MRI, m_SpecificICstOrSplat(0)))
return false;
Register Carry = MI.getOperand(1).getReg();