[SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 7 Jan 2021 18:18:50 +0000 (21:18 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 7 Jan 2021 23:15:24 +0000 (02:15 +0300)
commit16ab8e5f6dbbeb5b8e900677f4a64c9924ecd7ba
treed4a7ba1ef49119249504b8ad540e2432859343bd
parent087be536feab0aacc043aed52bee2e48e90e538c
[SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier

We need to handle this case before dealing with the case of constant
branch condition, because if the destinations match, latter fold
would try to remove the DomTree edge that would still be present.

This allows to make that particular DomTree update non-permissive
llvm/lib/Transforms/Utils/Local.cpp