This is an archive of the discontinued LLVM Phabricator instance.

[LICM] Clear LoopToAliasSetMap when a loop being deleted is outermost or removed from its parent loop.
AbandonedPublic

Authored by huihuiz on Oct 2 2018, 1:04 PM.

Details

Summary

Fix pr31141.

If a loop is nested inside another loop, alias information is saved in
LoopToAliasSetMap. Later when processing the outer loop, this alias
information is collected and erased from LoopToAliasSetMap.

However, when the outer loop is deleted by other loop pass, the information
saved in LoopToAliasSetMap by its subloops will not get erased. This patch
clear the LoopToAliasSetMap when a loop being deleted is outermost or
removed from its parent loop.

Diff Detail

Repository
rL LLVM

Event Timeline

huihuiz created this revision.Oct 2 2018, 1:04 PM

The commit message should refer to https://bugs.llvm.org/show_bug.cgi?id=31141 (assuming this patch fixes that bug).

lib/Transforms/Scalar/LICM.cpp
1600

Need an explanation here for why we're clearing the map in exactly these circumstances. It isn't obvious that we won't lose useful cached information, or that we don't need to clear the map if the loop has a parent.

huihuiz updated this revision to Diff 168055.EditedOct 2 2018, 4:59 PM
huihuiz edited the summary of this revision. (Show Details)

Clear the LoopToAliasSetMap only when the loop being deleted is outermost loop
or removed from its parent. Otherwise, the alias information saved by its subloops
is cached, and later collected and erased by their nearest outer loop.

huihuiz updated this revision to Diff 168062.Oct 2 2018, 6:06 PM

Update comment message.

huihuiz retitled this revision from Clear LoopToAliasSetMap when outermost loop is deleted to [LICM] Clear LoopToAliasSetMap when a loop being deleted is outermost or removed from its parent loop..Oct 2 2018, 6:10 PM
huihuiz edited the summary of this revision. (Show Details)
huihuiz abandoned this revision.Jun 20 2019, 2:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2019, 2:26 PM
Herald added a subscriber: asbirlea. · View Herald Transcript