[PATCH] D131941: [DAGCombiner][NFC] Merge two if statement into one

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 09:31:03 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4127
+    const APInt &C0 = N0.getConstantOperandAPInt(0);
+    const APInt &NewStep = C0 * MulVal;
+    return DAG.getStepVector(DL, VT, NewStep);
----------------
NewStep isn't a reference - its a new result.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9194
+    if (ShlVal.ult(C0.getBitWidth())) {
+      const APInt &NewStep = C0 << ShlVal;
+      return DAG.getStepVector(SDLoc(N), VT, NewStep);
----------------
NewStep isn't a reference - its a new result.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131941/new/

https://reviews.llvm.org/D131941



More information about the llvm-commits mailing list