diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-07-07 01:12:56 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-07-07 01:12:56 +0000 |
commit | d8b0c8ce1b30035221a8623fea5b4a0735fcac5c (patch) | |
tree | b10a6ac5c3e755984029f85c70f6b72af1f4f8f4 /lldb/packages/Python/lldbsuite/test/python_api | |
parent | 2c27e33a580f4802b564b6a2b9628f6b4b5e21dc (diff) | |
download | bcm5719-llvm-d8b0c8ce1b30035221a8623fea5b4a0735fcac5c.tar.gz bcm5719-llvm-d8b0c8ce1b30035221a8623fea5b4a0735fcac5c.zip |
[PM/LoopUnswitch] Fix PR37889, producing the correct loop nest structure
after trivial unswitching.
This PR illustrates that a fundamental analysis update was not performed
with the new loop unswitch. This update is also somewhat fundamental to
the core idea of the new loop unswitch -- we actually *update* the CFG
based on the unswitching. In order to do that, we need to update the
loop nest in addition to the domtree.
For some reason, when writing trivial unswitching, I thought that the
loop nest structure cannot be changed by the transformation. But the PR
helps illustrate that it clearly can. I've expanded this to a number of
different test cases that try to cover the different cases of this. When
we unswitch, we move an exit edge of a loop out of the loop. If this
exit edge changes which loop reached by an exit is the innermost loop,
it changes the parent of the loop. Essentially, this transformation may
hoist the inner loop up the nest. I've added the simple logic to handle
this reliably in the trivial unswitching case. This just requires
updating LoopInfo and rebuilding LCSSA on the impacted loops. In the
trivial case, we don't even need to handle dedicated exits because we're
only hoisting the one loop and we just split its preheader.
I've also ported all of these tests to non-trivial unswitching and
verified that the logic already there correctly handles the loop nest
updates necessary.
Differential Revision: https://reviews.llvm.org/D48851
llvm-svn: 336477
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
0 files changed, 0 insertions, 0 deletions