54 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<import-jscop;simplify-0>' -polly-print-simplify -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck -match-full-lines %s2;3; Remove a store that is overwritten by another store in the same statement.4; Check that this works even if one of the writes is a scalar MemoryKind.5;6; for (int j = 0; j < n; j += 1) {7; body:8; val = 21.0 + 21.0;9; A[1] = val;10;11; user:12; A[0] = val;13; }14;15define void @overwritten_implicit_and_explicit(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %C) {16entry:17 br label %for18 19for:20 %j = phi i32 [0, %entry], [%j.inc, %inc]21 %j.cmp = icmp slt i32 %j, %n22 br i1 %j.cmp, label %body, label %exit23 24 body:25 %val = fadd double 21.0, 21.026 store double %val, ptr %A27 br label %user28 29 user:30 store double %val, ptr %C31 br label %inc32 33inc:34 %j.inc = add nuw nsw i32 %j, 135 br label %for36 37exit:38 br label %return39 40return:41 ret void42}43 44 45; CHECK: Statistics {46; CHECK: Overwrites removed: 147; CHECK: }48 49; CHECK: Stmt_body50; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]51; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_val[] };52; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[0] };53; CHECK-NEXT: Stmt_user54