[SimplifyCFG] Handle branch on same condition in pred more directly
authorNikita Popov <npopov@redhat.com>
Wed, 20 Apr 2022 15:03:45 +0000 (17:03 +0200)
committerNikita Popov <npopov@redhat.com>
Thu, 21 Apr 2022 09:22:02 +0000 (11:22 +0200)
commit3df86e799e46bc1139372a2f40c31333716e3ad6
tree90c96d5570ef34988f37cf18ab14e2ebe802a8bf
parent1234b1c6d8113d50beef5801be607ad1d502b2f7
[SimplifyCFG] Handle branch on same condition in pred more directly

Rather than creating a PHI node and then using the PHI threading
code, directly handle this case in
FoldCondBranchOnValueKnownInPredecessor().

This change is supposed to be NFC-ish, but may cause changes due
to different transform order.
llvm/lib/Transforms/Utils/SimplifyCFG.cpp