[DAGCombine] Move setcc of freeze fold to brcond
authorNikita Popov <npopov@redhat.com>
Fri, 9 Jun 2023 15:07:15 +0000 (17:07 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 12 Jun 2023 10:01:29 +0000 (12:01 +0200)
commit5c6ff3a6025570479da5b72fcd02ca93b470683b
tree26fea44f173af36631df650455e65ba694e8c055
parentea20f339d91f57694899c29198f2dfb41bf9a03a
[DAGCombine] Move setcc of freeze fold to brcond

This fold goes against the usual approach of pushing freeze into
operands. The idea behind the fold is that if the setcc feeds into
a brcond, the freeze can be dropped entirely.

Move the fold to brcond, where we can remove the freeze directly.
This ensures that there can be no infinite combine loops due to
conflicting transforms.

Differential Revision: https://reviews.llvm.org/D152544
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp