[RISCV][NFC] Simplify PatFrag mul_const_oneuse
authorBen Shi <ben.shi@streamcomputing.com>
Fri, 31 Mar 2023 09:59:31 +0000 (17:59 +0800)
committerBen Shi <ben.shi@streamcomputing.com>
Sat, 1 Apr 2023 04:58:44 +0000 (12:58 +0800)
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D147309

llvm/lib/Target/RISCV/RISCVInstrInfo.td

index 888c9b3..a13f672 100644 (file)
@@ -1247,8 +1247,7 @@ def mul_oneuse : binop_oneuse<mul>;
 def mul_const_oneuse : PatFrag<(ops node:$A, node:$B),
                                (mul node:$A, node:$B), [{
   if (auto *N1C = dyn_cast<ConstantSDNode>(N->getOperand(1)))
-    if (N1C->hasOneUse())
-      return true;
+    return N1C->hasOneUse();
   return false;
 }]>;