brintos

brintos / llvm-project-archived public Read only

0
0
Text · 901 B · 13ca40f Raw
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 scalar stores.4;5; for (int j = 0; j < n; j += 1) {6; bodyA:7;   double val = A[0];8;9; bodyB:10;   A[0] = val;11; }12;13define void @redundant_scalarwrite(i32 %n, ptr noalias nonnull %A) {14entry:15  br label %for16 17for:18  %j = phi i32 [0, %entry], [%j.inc, %inc]19  %j.cmp = icmp slt i32 %j, %n20  br i1 %j.cmp, label %bodyA, label %exit21 22 23    bodyA:24      %val = load double, ptr %A25      br label %bodyB26 27    bodyB: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