[LICM] Teach LICM how to handle cases where the alias set tracker was
authorChandler Carruth <chandlerc@gmail.com>
Sat, 27 Feb 2016 04:34:07 +0000 (04:34 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 27 Feb 2016 04:34:07 +0000 (04:34 +0000)
commitad8cb382fa6d0bcc0359d99a3ddec381c218ba89
tree5b8f54fde3219ae0997260c6831ea247587b4baf
parentbf821db9322b57160886c79f022a73182d5ce280
[LICM] Teach LICM how to handle cases where the alias set tracker was
merged into a loop that was subsequently unrolled (or otherwise nuked).

In this case it can't merge in the ASTs for any remaining nested loops,
it needs to re-add their instructions dircetly.

The fix is very isolated, but I've pulled the code for merging blocks
into the AST into a single place in the process. The only behavior
change is in the case which would have crashed before.

This fixes a crash reported by Mikael Holmen on the list after r261316
restored much of the loop pass pipelining and allowed us to actually do
this kind of nested transformation sequenc. I've taken that test case
and further reduced it into the somewhat twisty maze of loops in the
included test case. This does in fact trigger the bug even in this
reduced form.

llvm-svn: 262108
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/alias-set-tracker-loss.ll [new file with mode: 0644]