[CodeGen] Fix the branch probability assertion in r318202
authorRong Xu <xur@google.com>
Thu, 16 Nov 2017 00:14:05 +0000 (00:14 +0000)
committerRong Xu <xur@google.com>
Thu, 16 Nov 2017 00:14:05 +0000 (00:14 +0000)
commite4572c6b733243962103b8d18ea2c3872cbef91a
treede0d6dae859c26f7a948197359a3a7d62ae27c45
parent725584e26d79d00ad4b14cab15babc4b4499d22e
[CodeGen] Fix the branch probability assertion in r318202

Due to integer precision, we might have numerator greater than denominator in
the branch probability scaling. Add a check to prevent this from happening.

llvm-svn: 318353
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp