[SimplifyCFG] Revise common code sinking
authorMichael Liao <michael.liao@intel.com>
Tue, 23 Dec 2014 08:26:55 +0000 (08:26 +0000)
committerMichael Liao <michael.liao@intel.com>
Tue, 23 Dec 2014 08:26:55 +0000 (08:26 +0000)
commitb9e302f3ca7abce64ca3e2851710cb8dca27f117
treeeb4560796f0afd859149cd1518daac1a79281171
parentfc86f5fc9f42458408d938df9928f53a1c27e0fd
[SimplifyCFG] Revise common code sinking

- Fix the case where more than 1 common instructions derived from the same
  operand cannot be sunk. When a pair of value has more than 1 derived values
  in both branches, only 1 derived value could be sunk.
- Replace BB1 -> (BB2, PN) map with joint value map, i.e.
  map of (BB1, BB2) -> PN, which is more accurate to track common ops.

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