[llvm] 989ebc1 - [DAGCombiner][NFC] Tidy up unnecessary brackets in visitADD.
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 18 00:55:13 PDT 2022
Author: wanglian
Date: 2022-08-18T15:48:22+08:00
New Revision: 989ebc1783a591630f142d41fd59bb57a6942be4
URL: https://github.com/llvm/llvm-project/commit/989ebc1783a591630f142d41fd59bb57a6942be4
DIFF: https://github.com/llvm/llvm-project/commit/989ebc1783a591630f142d41fd59bb57a6942be4.diff
LOG: [DAGCombiner][NFC] Tidy up unnecessary brackets in visitADD.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D132107
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 1739f1804183..56beea3e248a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2672,9 +2672,9 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
}
// fold a+vscale(c1)+vscale(c2) -> a+vscale(c1+c2)
- if ((N0.getOpcode() == ISD::ADD) &&
- (N0.getOperand(1).getOpcode() == ISD::VSCALE) &&
- (N1.getOpcode() == ISD::VSCALE)) {
+ if (N0.getOpcode() == ISD::ADD &&
+ N0.getOperand(1).getOpcode() == ISD::VSCALE &&
+ N1.getOpcode() == ISD::VSCALE) {
const APInt &VS0 = N0.getOperand(1)->getConstantOperandAPInt(0);
const APInt &VS1 = N1->getConstantOperandAPInt(0);
SDValue VS = DAG.getVScale(DL, VT, VS0 + VS1);
@@ -2691,9 +2691,9 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
}
// Fold a + step_vector(c1) + step_vector(c2) to a + step_vector(c1+c2)
- if ((N0.getOpcode() == ISD::ADD) &&
- (N0.getOperand(1).getOpcode() == ISD::STEP_VECTOR) &&
- (N1.getOpcode() == ISD::STEP_VECTOR)) {
+ if (N0.getOpcode() == ISD::ADD &&
+ N0.getOperand(1).getOpcode() == ISD::STEP_VECTOR &&
+ N1.getOpcode() == ISD::STEP_VECTOR) {
const APInt &SV0 = N0.getOperand(1)->getConstantOperandAPInt(0);
const APInt &SV1 = N1->getConstantOperandAPInt(0);
APInt NewStep = SV0 + SV1;
More information about the llvm-commits
mailing list