[PATCH] D104063: [SimplifyCFG] avoid crash on degenerate loop

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 05:18:50 PDT 2021


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

In D104063#2813104 <https://reviews.llvm.org/D104063#2813104>, @spatel wrote:

> Patch updated:
> Make the bailout more general and try to explain the problem pattern in a code comment.

Thanks, that's precisely what i meant.
Thanks.



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2718
+  // can't be the candidate if-condition for a select that we want to form.
+  if (auto *IfCondInst = dyn_cast<Instruction>(IfCond))
+    if (IfCondInst->getParent() == BB)
----------------
I think we only need to care about PHI nodes


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

https://reviews.llvm.org/D104063



More information about the llvm-commits mailing list