OSDN Git Service

[SimplifyCFG] FoldBranchToCommonDest: don't require that cmp of br is last instruction
authorRoman Lebedev <lebedev.ri@gmail.com>
Tue, 1 Dec 2020 08:07:28 +0000 (11:07 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Tue, 1 Dec 2020 12:13:06 +0000 (15:13 +0300)
commit15f8060f6f2388d503fcd400e1226c69554c1924
tree60006271ed6d1b91ca897cd3e3c61dea3c465267
parentb52029224c183d33c5a3bd9b14f3375e25f15fa5
[SimplifyCFG] FoldBranchToCommonDest: don't require that cmp of br is last instruction

There is no correctness need for that, and since we allow live-out
uses, this could theoretically happen, because currently nothing
will move the cond to right before the branch in those tests.
But regardless, lifting that restriction even makes the transform
easier to understand.

This makes the transform happen in 81 more cases (+0.55%)
)
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll