[PATCH] D117045: [SimplifyCFG] Be more aggressive when sinking into unreachable-post-dominated block

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 12:29:15 PST 2022


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2056
+  bool PostDominatedByUnreachable =
+      IsBlockPostDominatedByDeoptOrUnreachable(BB, /*FollowDivergence=*/true);
+
----------------
efriedma wrote:
> Where is the implementation of IsBlockPostDominatedByDeoptOrUnreachable?
> 
> In any case, just from the name, I'm not sure this quite captures the property you want here. There's a difference between sinking into a block that ends in unreachable, vs. a block where the control flow eventually leads to unreachable.  There could be a non-trivial amount of code between the code you're transforming, and the actual unreachable instruction.  (e.g. the main loop of a program likely ends with a call to exit(), so all blocks in the main function are post-dominated by unreachable).
> Where is the implementation of IsBlockPostDominatedByDeoptOrUnreachable?

Uploaded now.

> <...>

Yes, that's the question. Okay, let's not do that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117045



More information about the llvm-commits mailing list