forked from OSchip/llvm-project
[FIX] Correctly handle scalar dependences of branch instructions
llvm-svn: 228866
This commit is contained in:
parent
d594aeb248
commit
c47edb51c6
|
|
@ -70,6 +70,8 @@ Value *polly::getPointerOperand(Instruction &Inst) {
|
|||
Type *polly::getAccessInstType(Instruction *AccInst) {
|
||||
if (StoreInst *Store = dyn_cast<StoreInst>(AccInst))
|
||||
return Store->getValueOperand()->getType();
|
||||
if (BranchInst *Branch = dyn_cast<BranchInst>(AccInst))
|
||||
return Branch->getCondition()->getType();
|
||||
return AccInst->getType();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
; RUN: opt %loadPolly -polly-scops -disable-polly-intra-scop-scalar-to-array -polly-model-phi-nodes -analyze < %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
;
|
||||
; CHECK: Statements
|
||||
;
|
||||
; void f(int *A, int c, int d) {
|
||||
; for (int i = 0; i < 1024; i++)
|
||||
; if (c < i)
|
||||
; A[i]++;
|
||||
; }
|
||||
;
|
||||
; CHECK: Stmt_for_cond
|
||||
; CHECK: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
|
||||
; CHECK: [c] -> { Stmt_for_cond[i0] -> MemRef_cmp1[] };
|
||||
; CHECK: Stmt_for_body
|
||||
; CHECK: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
|
||||
; CHECK: [c] -> { Stmt_for_body[i0] -> MemRef_cmp1[] };
|
||||
;
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
|
||||
define void @f(i32* %A, i64 %c) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue