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
This commit is contained in:
David Peixotto
2014-09-24 16:48:31 +00:00
parent 8c4e64af8a
commit cfc42962c8
4 changed files with 63 additions and 0 deletions

View File

@@ -130,6 +130,9 @@ namespace {
/// set.
void deleteAnalysisValue(Value *V, Loop *L) override;
/// Simple Analysis hook. Delete loop L from alias set map.
void deleteAnalysisLoop(Loop *L) override;
/// SinkRegion - Walk the specified region of the CFG (defined by all blocks
/// dominated by the specified block, and that are in the current loop) in
/// reverse depth first order w.r.t the DominatorTree. This allows us to
@@ -943,3 +946,13 @@ void LICM::deleteAnalysisValue(Value *V, Loop *L) {
AST->deleteValue(V);
}
/// Simple Analysis hook. Delete value L from alias set map.
void LICM::deleteAnalysisLoop(Loop *L) {
AliasSetTracker *AST = LoopToAliasSetMap.lookup(L);
if (!AST)
return;
delete AST;
LoopToAliasSetMap.erase(L);
}