brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 3de50c0 Raw
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 %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_scalar(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 %bodyA, label %exit14 15 16    bodyA:17      %val1 = load double, ptr %A18      br label %region_entry19 20    region_entry:21      %val2 = load double, ptr %A22      %cmp = fcmp oeq double %val1, 0.023      br i1 %cmp, label %region_true, label %region_exit24 25    region_true:26      br label %region_exit27 28    region_exit:29      br label %bodyB30 31    bodyB:32      store double %val2, ptr %A33      br label %inc34 35 36inc:37  %j.inc = add nuw nsw i32 %j, 138  br label %for39 40exit:41  br label %return42 43return:44  ret void45}46 47 48; CHECK: Statistics {49; CHECK:     Redundant writes removed: 350; CHECK: }51 52; CHECK:      After accesses {53; CHECK-NEXT: }54