[llvm] [SimplifyCFG] Hoist out implied conditions from successor (PR #158773)
Vedant Paranjape via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 16 02:54:17 PDT 2025
VedantParanjape wrote:
Formalizing this more, we want to hoist only if the set of possible values
in the outer condition is much bigger than set of possible values in the
implied condition. So the outer predicate should be relational and the
implied predicate should be an equality?
> It looks like currently you are just looking for any icmp inside the
block and hoisting it.
Should I only check for icmps if they share a common operand?
On Tue, Sep 16, 2025, 05:21 Nikita Popov ***@***.***> wrote:
> ***@***.**** requested changes on this pull request.
>
> It looks like currently you are just looking for any icmp inside the block
> and hoisting it. This is not correct: It needs to be connected to the
> control flow in a specific way. Hoisting the condition means that the
> branch is executed in fewer cases, and you need to make sure that's fine.
>
> (As a trivial counter example, consider the case where the block just
> contains a completely unused icmp.)
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/llvm/llvm-project/pull/158773#pullrequestreview-3228652786>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFMU6VCW3KN4JSTYIY5XZOT3S7JDFAVCNFSM6AAAAACGTNLMZ2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTEMRYGY2TENZYGY>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
https://github.com/llvm/llvm-project/pull/158773
More information about the llvm-commits
mailing list