[PATCH] D125627: [SCEV] Serialize function calls in function arguments.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 12:09:06 PDT 2022


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM with some code style suggestions.



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:1807
+      const auto *LHSz = getZeroExtendExpr(LHS, Ty, Depth + 1);
+      const auto *RHSz = getZeroExtendExpr(RHS, Ty, Depth + 1);
+      return getURemExpr(LHSz, RHSz);
----------------
I'd just reassign LHS and RHS here (and below). The LHSz/RHSz names are bit unusual.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:3127
+        if (Add->getNumOperands() == 2 && containsConstantInAddMulChain(Add)) {
+          const auto *LHS = getMulExpr(LHSC, Add->getOperand(0),
+                                       SCEV::FlagAnyWrap, Depth + 1);
----------------
`const SCEV *` here and elsewhere. This `auto` is not saving a lot of characters :)


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:7576
+    if (isKnownNonNegative(LHS = getSCEV(U->getOperand(0))) &&
+        isKnownNonNegative(RHS = getSCEV(U->getOperand(1))))
+      return getUDivExpr(LHS, RHS);
----------------
Please move these as separate assignments before the `if` (here and below).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125627



More information about the llvm-commits mailing list