summaryrefslogtreecommitdiffstats
path: root/polly/include
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-12-02 17:49:52 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-12-02 17:49:52 +0000
commita94ae1aedefd38f04d3c9bc53980d46b835f5361 (patch)
tree28a936531916ae517b6ec9bf13f817a9b42e23cb /polly/include
parent91d1ed5ee6061fd49e36d6c2a20146ec160fed62 (diff)
downloadbcm5719-llvm-a94ae1aedefd38f04d3c9bc53980d46b835f5361.tar.gz
bcm5719-llvm-a94ae1aedefd38f04d3c9bc53980d46b835f5361.zip
Do not allow multiple possibly aliasing ptrs in an expression
Relational comparisons should not involve multiple potentially aliasing pointers. Similarly this should hold for switch conditions and the two conditions involved in equality comparisons (separately!). This is a heuristic based on the C semantics that does only allow such operations when the base pointers do point into the same object. Since this makes aliasing likely we will bail out early instead of producing a probably failing runtime check. llvm-svn: 288516
Diffstat (limited to 'polly/include')
-rw-r--r--polly/include/polly/ScopDetection.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h
index ef6c95ebf01..2bca384041f 100644
--- a/polly/include/polly/ScopDetection.h
+++ b/polly/include/polly/ScopDetection.h
@@ -219,6 +219,16 @@ private:
/// Remove cached results for the children of @p R recursively.
void removeCachedResultsRecursively(const Region &R);
+ /// Check if @p S0 and @p S1 do contain multiple possibly aliasing pointers.
+ ///
+ /// @param S0 A expression to check.
+ /// @param S1 Another expression to check or nullptr.
+ /// @param Scope The loop/scope the expressions are checked in.
+ ///
+ /// @returns True, if multiple possibly aliasing pointers are used in @p S0
+ /// (and @p S1 if given).
+ bool involvesMultiplePtrs(const SCEV *S0, const SCEV *S1, Loop *Scope) const;
+
/// Add the region @p AR as over approximated sub-region in @p Context.
///
/// @param AR The non-affine subregion.
OpenPOWER on IntegriCloud