[PATCH] D80397: SimplifyCFG: Clean up optforfuzzing implementation

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 21 15:12:04 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6183
 
-  // If there is a trivial two-entry PHI node in this basic block, and we can
-  // eliminate it, do so now.
-  if (auto *PN = dyn_cast<PHINode>(BB->begin()))
-    if (PN->getNumIncomingValues() == 2)
-      Changed |= FoldTwoEntryPHINode(PN, TTI, DL);
+  if (Options.FoldTwoEntryPHINode) {
+    // If there is a trivial two-entry PHI node in this basic block, and we can
----------------
morehouse wrote:
> Should this go in the `FoldTwoEntryPHINode` function in case any future calls to the function are added?
I was going with the example of Options.SinkCommonInsts. If you are directly calling FoldTwoEntryPHINode, I would expect it to do as it claims regardless of the option


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

https://reviews.llvm.org/D80397





More information about the llvm-commits mailing list