I noticed in one of the test updates for rL368898 that we hadn't been able to compute a backedge taken count for a loop with a constant exit. This seems unfortunate, so I took a stab at a solution.
At the moment, this isn't ready to go in, I'm mostly looking for feedback on the idea and approach. Is this a good idea? Should I restrict it to only constants? Should this be done somewhere else?
One point I'm a bit concerned about is whether setting the exact count to an arbitrary unreachable value breaks some assumption. I can't think of any, but...
If this is the direction we want to take, I'll do the following:
- Autogen a couple of tests which need updated
- Submit an NFC which computes the max BE taken count in a pre-loop to the main one which tracks computable exits.
- Rebase this on top of both of the above for actual review.