OSDN Git Service

[SimplifyCFG] Harden up the profitability heuristic for block splitting during sinking
authorJames Molloy <james.molloy@arm.com>
Sun, 11 Sep 2016 08:07:30 +0000 (08:07 +0000)
committerJames Molloy <james.molloy@arm.com>
Sun, 11 Sep 2016 08:07:30 +0000 (08:07 +0000)
commit3daf6c830e094083671ea7a815aa4fd15a51e90e
tree8df1cea168a44698b8d866eaba7c778b935ff354
parent2628aff56683b7652abe9f9eb9e54a82d1716aa7
[SimplifyCFG] Harden up the profitability heuristic for block splitting during sinking

Exposed by PR30244, we will split a block currently if we think we can sink at least one instruction. However this isn't right - the reason we split predecessors is so that we can sink instructions that otherwise couldn't be sunk because it isn't safe to do so - stores, for example.

So, change the heuristic to only split if it thinks it can sink at least one non-speculatable instruction.

Should fix PR30244.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281160 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/sink-common-code.ll