[PATCH] D105363: [InstCombine] Transitively propagate `unreachable` into predecessors

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 3 01:24:02 PDT 2021


lebedev.ri added a comment.

In D105363#2856664 <https://reviews.llvm.org/D105363#2856664>, @nikic wrote:

> This is walking the edge of what is appropriate for InstCombine, so I'd like to understand why we want to try so hard to remove unreachable code here. As InstCombine does not introduce its own unreachable terminators, after recent changes to SimplifyCFG, running SimplifyCFG+InstCombine should produce an optimal result (as far as unreachable code is concerned). There is no need to iterate between them to reach a fixed point (again, as far as this transform is concerned).

I'm mainly trying to harden the handling of `unreachable` as much as possible before D104870 <https://reviews.llvm.org/D104870>,
in hope that some of the regressions caused by that patch are avoidable.

> InstCombine can introduce pseudo-unreachable code in the form of either the store null pattern, or branches on constants that render certain edges effectively dead. Handling those cases could cut down fixpoint iteration. Is extending towards such cases the plan here?

Yes, dealing with that as much as reasonably possible in instcombine itself is something i'd like to see happen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105363



More information about the llvm-commits mailing list