brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · bc5b2df Raw
45 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<simplify>' -polly-print-simplify -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s2;3; Remove a store that is overwritten by another store in the same statement.4;5; for (int j = 0; j < n; j += 1) {6;   A[0] = 21.0;7;   A[0] = 42.0;8; }9;10define void @overwritten(i32 %n, ptr noalias nonnull %A) {11entry:12  br label %for13 14for:15  %j = phi i32 [0, %entry], [%j.inc, %inc]16  %j.cmp = icmp slt i32 %j, %n17  br i1 %j.cmp, label %body, label %exit18 19    body:20      store double 21.0, ptr %A21      store double 42.0, ptr %A22      br label %inc23 24inc:25  %j.inc = add nuw nsw i32 %j, 126  br label %for27 28exit:29  br label %return30 31return:32  ret void33}34 35 36; CHECK: Statistics {37; CHECK:     Overwrites removed: 138; CHECK: }39 40; CHECK:      After accesses {41; CHECK-NEXT:     Stmt_body42; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]43; CHECK-NEXT:                 [n] -> { Stmt_body[i0] -> MemRef_A[0] };44; CHECK-NEXT: }45