BFI: Saturate when combining edges to a successor
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 5 Dec 2014 19:13:42 +0000 (19:13 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 5 Dec 2014 19:13:42 +0000 (19:13 +0000)
commit1a283409bc0e0e426b879c5990d78406f7fb0fe2
tree28f652bdc77ad9cc35ef2bb3cbab09fc2ce6f246
parent78ec9010c5055d57a506770296d14e01f2a7f2ac
BFI: Saturate when combining edges to a successor

When a loop gets bundled up, its outgoing edges are quite large, and can
just barely overflow 64-bits.  If one successor has multiple incoming
edges -- and that successor is getting all the incoming mass --
combining just its edges can overflow.  Handle that by saturating rather
than asserting.

This fixes PR21622.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223500 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BlockFrequencyInfoImpl.cpp
test/Analysis/BlockFrequencyInfo/extremely-likely-loop-successor.ll [new file with mode: 0644]