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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 12:12:39 PST 2020


nikic 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 })
----------------
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.


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