50 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 %s -match-full-lines2;3; Remove redundant store (a store that writes the same value already4; at the destination) in a region.5;6define void @redundant_region(i32 %n, ptr noalias nonnull %A) {7entry:8 br label %for9 10for:11 %j = phi i32 [0, %entry], [%j.inc, %inc]12 %j.cmp = icmp slt i32 %j, %n13 br i1 %j.cmp, label %region_entry, label %exit14 15 16 region_entry:17 %val = load double, ptr %A18 %cmp = fcmp oeq double %val, 0.019 br i1 %cmp, label %region_true, label %region_exit20 21 region_true:22 br label %region_exit23 24 region_exit:25 br label %body26 27 body:28 store double %val, ptr %A29 br label %inc30 31 32inc:33 %j.inc = add nuw nsw i32 %j, 134 br label %for35 36exit:37 br label %return38 39return:40 ret void41}42 43 44; CHECK: Statistics {45; CHECK: Redundant writes removed: 246; CHECK: }47 48; CHECK: After accesses {49; CHECK-NEXT: }50