Fix PR 24723 - Handle 0-mass backedges in irreducible loops
authorDiego Novillo <dnovillo@google.com>
Tue, 8 Sep 2015 19:22:17 +0000 (19:22 +0000)
committerDiego Novillo <dnovillo@google.com>
Tue, 8 Sep 2015 19:22:17 +0000 (19:22 +0000)
commit965f2c2437c272146c447eb1775c65abd3d4bb57
treec6cdd799dea9a10f70a731f676eb8d6effc3da0b
parent5bd1a50ca220d9a2280b9639da57284ad30961ab
Fix PR 24723 - Handle 0-mass backedges in irreducible loops

This corner case happens when we have an irreducible SCC that is
deeply nested.  As we work down the tree, the backedge masses start
getting smaller and smaller until we reach one that is down to 0.

Since we distribute the incoming mass using the backedge masses as
weight, the distributor does not allow zero weights.  So, we simply
ignore them (which will just use the weights of the non-zero nodes).

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