[JumpThreading] Fix branch probabilities in DuplicateCondBranchOnPHIIntoPred()
authorYevgeny Rouban <yrouban@azul.com>
Tue, 17 Nov 2020 07:24:50 +0000 (14:24 +0700)
committerYevgeny Rouban <yrouban@azul.com>
Tue, 17 Nov 2020 07:40:50 +0000 (14:40 +0700)
commita57fe210ff7cf553b721bf08e74df42b0ae1df38
tree878f83184e032914d69ae8cecc1aa758c0f85b26
parente9453e26cbb624d84a49389d64c806f4f001b4ee
[JumpThreading] Fix branch probabilities in DuplicateCondBranchOnPHIIntoPred()

When instructions are cloned from block BB to PredBB in the method
DuplicateCondBranchOnPHIIntoPred() number of successors of PredBB
changes from 1 to number of successors of BB. So we have to copy
branch probabilities from BB to PredBB.

Reviewed By: Kazu Hirata

Differential Revision: https://reviews.llvm.org/D90841
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/thread-prob-3.ll [new file with mode: 0644]