42 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<simplify>' -polly-print-simplify -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines2;3; Remove redundant store (a store that writes the same value already4; at the destination)5;6; for (int j = 0; j < n; j += 1)7; A[0] = A[0];8;9define void @func(i32 %n, ptr noalias nonnull %A) {10entry:11 br label %for12 13for:14 %j = phi i32 [0, %entry], [%j.inc, %inc]15 %j.cmp = icmp slt i32 %j, %n16 br i1 %j.cmp, label %body, label %exit17 18 body:19 %val = load double, ptr %A20 store double %val, ptr %A21 br label %inc22 23inc:24 %j.inc = add nuw nsw i32 %j, 125 br label %for26 27exit:28 br label %return29 30return:31 ret void32}33 34 35; CHECK: Statistics {36; CHECK: Redundant writes removed: 137; CHECK: Stmts removed: 138; CHECK: }39 40; CHECK: After accesses {41; CHECK-NEXT: }42