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

@@ -82,6 +82,11 @@ public:
/// deleteAnalysisValue - Delete analysis info associated with value V.
virtual void deleteAnalysisValue(Value *V, Loop *L) {}
/// Delete analysis info associated with Loop L.
/// Called to notify a Pass that a loop has been deleted and any
/// associated analysis values can be deleted.
virtual void deleteAnalysisLoop(Loop *L) {}
protected:
/// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
/// and most transformation passes should skip it.
@@ -152,6 +157,10 @@ public:
/// that implement simple analysis interface.
void deleteSimpleAnalysisValue(Value *V, Loop *L);
/// Invoke deleteAnalysisLoop hook for all passes that implement simple
/// analysis interface.
void deleteSimpleAnalysisLoop(Loop *L);
private:
std::deque<Loop *> LQ;
bool skipThisLoop;