aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-08-31 06:37:25 +0000
committerTobias Grosser <tobias@grosser.es>2015-08-31 06:37:25 +0000
commitd86bf4271c0c30a93be74cc3453ae744f6e7a544 (patch)
tree192316211be279049706e739ac81468883374c6b
parent692f8683d7db227d49ee3dad45c87ab840f039c3 (diff)
downloadllvm-d86bf4271c0c30a93be74cc3453ae744f6e7a544.zip
llvm-d86bf4271c0c30a93be74cc3453ae744f6e7a544.tar.gz
llvm-d86bf4271c0c30a93be74cc3453ae744f6e7a544.tar.bz2
Do not model scalar references to constant values
llvm-svn: 246418
-rw-r--r--polly/lib/Analysis/TempScopInfo.cpp3
-rw-r--r--polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll6
2 files changed, 8 insertions, 1 deletions
diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp
index c669f55..bb242df 100644
--- a/polly/lib/Analysis/TempScopInfo.cpp
+++ b/polly/lib/Analysis/TempScopInfo.cpp
@@ -210,6 +210,9 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R,
if (R->contains(OpInst))
continue;
+ if (isa<Constant>(Op))
+ continue;
+
IRAccess ScalarAccess(IRAccess::READ, Op, ZeroOffset, 1, true, Op);
AccFuncMap[Inst->getParent()].push_back(
std::make_pair(ScalarAccess, Inst));
diff --git a/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll b/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
index 5f03f55..a22b171 100644
--- a/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
+++ b/polly/test/Isl/CodeGen/phi_loop_carried_float_escape.ll
@@ -1,4 +1,8 @@
-; RUN: opt %loadPolly -S -polly-no-early-exit -polly-detect-unprofitable -polly-codegen < %s | FileCheck %s
+; RUN: opt %loadPolly -S -polly-no-early-exit -polly-detect-unprofitable \
+; RUN: -polly-analyze-read-only-scalars=false -polly-codegen < %s | FileCheck %s
+
+; RUN: opt %loadPolly -S -polly-no-early-exit -polly-detect-unprofitable \
+; RUN: -polly-analyze-read-only-scalars=true -polly-codegen < %s | FileCheck %s
;
; float f(float *A, int N) {
; float tmp = 0;