[PATCH] D71578: [CodeMoverUtils] Improve IsControlFlowEquivalent.
Ettore Tiotto via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 18 14:19:45 PST 2019
etiotto added inline comments.
================
Comment at: llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h:39
+ const Value *V;
+ bool IsTrueCondition;
+};
----------------
[suggestion]: Put const to make the member variable immutable.
================
Comment at: llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h:75
+/// collected successfully.
+bool collectControlConditions(const BasicBlock &BB, const BasicBlock &Dominator,
+ const DominatorTree &DT,
----------------
[suggestion]: This is a factory method to construct ControlConditions right? Can you add it as a static member function in the class?
================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:102
+
+ for (const ControlCondition &C : Conditions)
+ if (!Other.getControlConditions().count(C))
----------------
[suggestion]: you could use llvm:all_of to check whether the sets have the same conditions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71578/new/
https://reviews.llvm.org/D71578
More information about the llvm-commits
mailing list