llvm-project/polly/lib/CodeGen
Michael Kruse 0e370cf1a7 Check whether IslAstInfo and DependenceInfo were computed for the same Scop.
Since -polly-codegen reports itself to preserve DependenceInfo and IslAstInfo,
we might get those analysis that were computed by a different ScopInfo for a
different Scop structure. This would be unfortunate because DependenceInfo and
IslAstInfo hold references to resources allocated by
ScopInfo/ScopBuilder/Scop (e.g. isl_id). If -polly-codegen and
DependenceInfo/IslAstInfo do not agree on which Scop to use, unpredictable
things can happen.

When the ScopInfo/Scop object is freed, there is a high probability that the
new ScopInfo/Scop object will be created at the same heap position with the
same address. Comparing whether the Scop or ScopInfo address is the expected
therefore is unreliable.

Instead, we compare the address of the isl_ctx object. Both, DependenceInfo
and IslAstInfo must hold a reference to the isl_ctx object to ensure it is
not freed before the destruction of those analyses which might happen after
the destruction of the Scop/ScopInfo they refer to.  Hence, the isl_ctx
will not be freed and its address not reused as long there is a
DependenceInfo or IslAstInfo around.

This fixes llvm.org/PR34441

llvm-svn: 313842
2017-09-21 00:01:13 +00:00
..
BlockGenerators.cpp [CodeGen] Bitcast scalar writes to actual value. 2017-09-07 12:15:01 +00:00
CodeGeneration.cpp Check whether IslAstInfo and DependenceInfo were computed for the same Scop. 2017-09-21 00:01:13 +00:00
CodegenCleanup.cpp [CodegenCleanup] Update cleanup passes according (old) PassManagerBuilder. 2017-09-09 21:43:49 +00:00
IRBuilder.cpp [IRBuilder] Only emit alias scop metadata for arrays, but not scalars 2017-08-22 21:58:48 +00:00
IslAst.cpp Check whether IslAstInfo and DependenceInfo were computed for the same Scop. 2017-09-21 00:01:13 +00:00
IslExprBuilder.cpp Move ScopArrayInfo::getFromAccessFunction and getFromId to isl++ 2017-07-24 16:22:27 +00:00
IslNodeBuilder.cpp [ISLNodeBuilder] Materialize Fortran array sizes of arrays without memory accesses. 2017-09-01 18:55:43 +00:00
LoopGenerators.cpp Disable the Loop Vectorizer in case of GEMM 2017-08-22 17:38:46 +00:00
ManagedMemoryRewrite.cpp [ManagedMemoryRewrite] Use `unit64_t` to store size, not `int`. 2017-08-22 09:30:37 +00:00
PPCGCodeGeneration.cpp [PPCGCodeGen] Document pre-composition with Zero in getExtent. [NFC] 2017-09-07 11:57:33 +00:00
PerfMonitor.cpp Fix a lot of typos. NFC. 2017-06-08 12:06:15 +00:00
RuntimeDebugBuilder.cpp Update for alloca construction changes 2017-04-11 00:12:58 +00:00
Utils.cpp [PPCGCodeGeneration] Fix runtime check adjustments since they make assumptions about BB layout. 2017-07-14 10:00:25 +00:00