Do not model scalar references to constant values

llvm-svn: 246418
This commit is contained in:
Tobias Grosser 2015-08-31 06:37:25 +00:00
parent 692f8683d7
commit d86bf4271c
2 changed files with 8 additions and 1 deletions

View File

@ -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));

View File

@ -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;