]> granicus.if.org Git - llvm/commit
[LV] Don't panic when encountering the IV of an outer loop.
authorMichael Kuperstein <mkuper@google.com>
Tue, 10 Jan 2017 19:32:30 +0000 (19:32 +0000)
committerMichael Kuperstein <mkuper@google.com>
Tue, 10 Jan 2017 19:32:30 +0000 (19:32 +0000)
commitc7eb5df9be401ee84f6ce04691f72e9ff97a2075
tree3f07ea2ed9d176fa24dbc3b01856b46e379fd3d9
parent2cf892fefa486af61f51f2ed7800e6314c2ffd0b
[LV] Don't panic when encountering the IV of an outer loop.

Bail out instead of asserting when we encounter this situation,
which can actually happen.

The reason the test uses the new PM is that the "bad" phi, incidentally, gets
cleaned up by LoopSimplify. But LICM can create this kind of phi and preserve
loop simplify form, so the cleanup has no chance to run.

This fixes PR31190.
We may want to solve this in a less conservative manner, since this phi is
actually uniform within the inner loop (or we may want LICM to output a cleaner
promotion to begin with).

Differential Revision: https://reviews.llvm.org/D28490

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291589 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopUtils.cpp
test/Transforms/LoopVectorize/pr31190.ll [new file with mode: 0644]