Resubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata handling...
authorYevgeny Rouban <yevgeny.rouban@azul.com>
Wed, 5 Jun 2019 05:46:40 +0000 (05:46 +0000)
committerYevgeny Rouban <yevgeny.rouban@azul.com>
Wed, 5 Jun 2019 05:46:40 +0000 (05:46 +0000)
commita3e16719c46aff109a6902c32787c06831c0e61d
treee32e338790f39c374724f86a54eab43849f5ee24
parentfa449a9bb27abdc43a4dbd17dc84d920f5f408d8
Resubmit "[CorrelatedValuePropagation] Fix prof branch_weights metadata handling for SwitchInst"

This reverts commit 5b32f60ec31ce136edac6f693538aeb6039f4ad0.
The fix is in commit 4f9e68148bd0dada2d6997625432385918ac2e2c.

This patch fixes the CorrelatedValuePropagation pass to keep
prof branch_weights metadata of SwitchInst consistent.
It makes use of SwitchInstProfUpdateWrapper.
New tests are added.

Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D62126

llvm-svn: 362583
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
llvm/test/Transforms/CorrelatedValuePropagation/profmd.ll [new file with mode: 0644]