Update edge weights properly when merging blocks in if-conversion.
authorCong Hou <congh@google.com>
Fri, 18 Sep 2015 20:22:41 +0000 (20:22 +0000)
committerCong Hou <congh@google.com>
Fri, 18 Sep 2015 20:22:41 +0000 (20:22 +0000)
commit2f91ab3d22ce0bf70d2e41856a15bb4e866e3994
tree8cc7f568796d9146a74099cc7d30d0f921d3ac9f
parentc4db514911db565709bb166d39f8bfe7ad6e47bf
Update edge weights properly when merging blocks in if-conversion.

In if-conversion, there is a utility function MergeBlocks() that is used to merge blocks. However, when new edges are built in this function the edge weight is either not provided or not updated properly, leading to a modified CFG with incorrect edge weights. This patch corrects this issue.

Differential Revision: http://reviews.llvm.org/D12513

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248030 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/IfConversion.cpp
test/CodeGen/ARM/ifcvt-iter-indbr.ll
test/CodeGen/Hexagon/ifcvt-edge-weight.ll [new file with mode: 0644]