Fix assertion in LICM doFinalization()
authorDavid Peixotto <dpeixott@codeaurora.org>
Wed, 24 Sep 2014 16:48:31 +0000 (16:48 +0000)
committerDavid Peixotto <dpeixott@codeaurora.org>
Wed, 24 Sep 2014 16:48:31 +0000 (16:48 +0000)
commitcfc42962c8c730d62c8483d351843802a1aca802
tree67f602b02de0af6feb31ad0013b1cacccceda560
parent8c4e64af8af34f433c14c8b69e8dd122887cfcb8
Fix assertion in LICM doFinalization()

The doFinalization method checks that the LoopToAliasSetMap is
empty. LICM populates that map as it runs through the loop nest,
deleting the entries for child loops as it goes. However, if a child
loop is deleted by another pass (e.g. unrolling) then the loop will
never be deleted from the map because LICM walks the loop nest to
find entries it can delete.

The fix is to delete the loop from the map and free the alias set
when the loop is deleted from the loop nest.

Differential Revision: http://reviews.llvm.org/D5305

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218387 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopPass.h
lib/Analysis/LoopPass.cpp
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/2014-09-10-doFinalizationAssert.ll [new file with mode: 0644]