[PATCH] D93842: [EarlyCSE] Use m_LogicalAnd/Or matchers to handle branch conditions

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 12:27:19 PST 2020


aqjune marked an inline comment as done.
aqjune added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/EarlyCSE.cpp:1075
+    Value *LHS = nullptr, *RHS = nullptr;
+    if (MatchBinOp(Curr, PropagateOpcode, LHS, RHS)) {}
+      for (auto &Op : { LHS, RHS })
----------------
nikic wrote:
> As clang-format points out, these braces were probably intended to go around the whole block? With that fixed, you should be able to drop the nullptr initialization and use dyn_cast instead of dyn_cast_or_null below.
That was a silly mistake, fixed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93842



More information about the llvm-commits mailing list