OSDN Git Service

[SimplifyCFG] When merging conditional stores, don't count the store we're merging...
authorCraig Topper <craig.topper@intel.com>
Fri, 3 Nov 2017 21:08:13 +0000 (21:08 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 3 Nov 2017 21:08:13 +0000 (21:08 +0000)
commit4fedc84270af2e8925439152e8c324487d01c8d7
tree4902f284f7b1cb06031b9a124ed61b32670bb5da
parent7711c315b294abaa47e3933ec470e04fa5b8ae80
[SimplifyCFG] When merging conditional stores, don't count the store we're merging against the PHINodeFoldingThreshold

Merging conditional stores tries to check to see if the code is if convertible after the store is moved. But the store hasn't been moved yet so its being counted against the threshold.

The patch adds 1 to the threshold comparison to make sure we don't count the store. I've adjusted a test to use a lower threshold to ensure we still do that conversion with the lower threshold.

Differential Revision: https://reviews.llvm.org/D39570

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317368 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/merge-cond-stores-2.ll