OSDN Git Service

[SimplifyCFG] Fix prof branch_weights MD while removing unreachable switch cases
authorYevgeny Rouban <yevgeny.rouban@azul.com>
Mon, 17 Jun 2019 05:55:12 +0000 (05:55 +0000)
committerYevgeny Rouban <yevgeny.rouban@azul.com>
Mon, 17 Jun 2019 05:55:12 +0000 (05:55 +0000)
commit90e12ffba71f4d3bd617a1ffacec209c2026292a
tree19c4ffbc339b42ad3f19611a76db0a2fcd656483
parent05b9698f31b026b7d17b4c38c9b03e67c4ddfd0b
[SimplifyCFG] Fix prof branch_weights MD while removing unreachable switch cases

SimplifyCFG has a bug that results in inconsistent prof branch_weights metadata
if unreachable switch cases are removed. This patch fixes this bug by making use
of the newly introduced SwitchInstProfUpdateWrapper class (see patch D62122).
A new test is created.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363527 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/switch-profmd.ll [new file with mode: 0644]