Assign correct edge weights to unwind destinations when lowering invoke statement.
authorCong Hou <congh@google.com>
Mon, 12 Oct 2015 23:02:58 +0000 (23:02 +0000)
committerCong Hou <congh@google.com>
Mon, 12 Oct 2015 23:02:58 +0000 (23:02 +0000)
commitca7a19a85f82e15bd6756b0715963be0b9988d8a
tree4249abfed8b9c1188bc9a6d3ab1fe8290154a0d1
parentadd7bcf9ae656f3c1e2c5adb4987c541cb95e373
Assign correct edge weights to unwind destinations when lowering invoke statement.

When lowering invoke statement, all unwind destinations are directly added as successors of call site block, and the weight of those new edges are not assigned properly. Actually, default weight 16 are used for those edges. This patch calculates the proper edge weights for those edges when collecting all unwind destinations.

Differential revision: http://reviews.llvm.org/D13354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250119 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/X86/catchpad-weight.ll [new file with mode: 0644]
test/CodeGen/X86/seh-safe-div-win32.ll
test/CodeGen/X86/seh-safe-div.ll
test/CodeGen/X86/win-catchpad.ll