]> granicus.if.org Git - llvm/commit
[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)
commit1b41b25fc111c9a72ff017011cc3f92849304146
tree4188176e4a449a1498ae46aca2ade8bcffe0f5c6
parente45a4d28558206cdc048291bc00a18caf55818fc
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354119 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BranchProbabilityInfo.cpp
test/Analysis/BranchProbabilityInfo/zero_heuristics.ll [new file with mode: 0644]