[BPI] Look through bitcasts in calcZeroHeuristic
authorSam Parker <sam.parker@arm.com>
Fri, 15 Feb 2019 11:50:21 +0000 (11:50 +0000)
committerSam Parker <sam.parker@arm.com>
Fri, 15 Feb 2019 11:50:21 +0000 (11:50 +0000)
commit0b53e8454b11340353610162191edb8eccd775cd
tree2ddcc72bde7790ac08cddf9cafab1f87707b01a4
parent136f09bea19b2584a7b8b4739ca4935dde319753
[BPI] Look through bitcasts in calcZeroHeuristic

Constant hoisting may have hidden a constant behind a bitcast so that
it isn't folded into its users. However, this prevents BPI from
calculating some of its heuristics that are based upon constant
values. So, I've added a simple helper function to look through these
casts.

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

llvm-svn: 354119
llvm/lib/Analysis/BranchProbabilityInfo.cpp
llvm/test/Analysis/BranchProbabilityInfo/zero_heuristics.ll [new file with mode: 0644]