HomePhabricator

[LFTR] Fix a (latent?) bug related to nested loops

Description

[LFTR] Fix a (latent?) bug related to nested loops

I can't actually come up with a test case this triggers on without an out of tree change, but in theory, it's a bug in the recently added multiple exit LFTR support. The root issue is that an exiting block common to two loops can (in theory) have computable exit counts for both loops. Rewriting the exit of an inner loop in terms of the outer loops IV would cause the inner loop to either a) run forever, or b) terminate on the first iteration.

In practice, we appear to get lucky and not have the exit count computable for the outer loop, except when it's trivially zero. Given we bail on zero exit counts, we don't appear to ever trigger this. But I can't come up with a reason we *can't* compute an exit count for the outer loop on the common exiting block, so this may very well be triggering in some cases.

Details

Committed
reamesJun 20 2019, 11:45 AM
Parents
rL363963: [NFC] Fix for InterfaceStubs tests (adding REQUIRES: x86-registered-target).
Branches
Unknown
Tags
Unknown