[ScopDetection] Remove unused DetectionContexts during expansion.
authorMichael Kruse <llvm@meinersbur.de>
Mon, 8 Aug 2016 22:39:32 +0000 (22:39 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Mon, 8 Aug 2016 22:39:32 +0000 (22:39 +0000)
commita6cc0d3a2d4e217036623496f6f269694bb56464
tree3c2f0f5a5002b4e10c7badcc9c381eeac7faa6e8
parent52930b5f4acb2eba288bf4b2cf2cdd499524adb0
[ScopDetection] Remove unused DetectionContexts during expansion.

The function expandRegion() frees Region* objects again when it determines that
these are not valid SCoPs. However, the DetectionContext added to the
DetectionContextMap still holds a reference. The validity is checked using the
ValidRegions lookup table. When a new Region is added to that list, it might
share the same address, such that the DetectionContext contains two
Region* associations that are in ValidRegions, but that are unrelated and of
which one has already been free.

Also remove the DetectionContext when not a valid expansion.

llvm-svn: 278062
polly/lib/Analysis/ScopDetection.cpp