brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 399c023 Raw
47 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<simplify>' -polly-print-simplify -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines2;3; Remove a dead load-instruction4; (an load whose result is not used anywhere)5;6; for (int j = 0; j < n; j += 1) {7;   double val = A[0];8;   A[0] = 42.0;9; }10;11define void @func(i32 %n, ptr noalias nonnull %A) {12entry:13  br label %for14 15for:16  %j = phi i32 [0, %entry], [%j.inc, %inc]17  %j.cmp = icmp slt i32 %j, %n18  br i1 %j.cmp, label %body, label %exit19 20    body:21      %val = load double, ptr %A22      store double 42.0, ptr %A23      br label %inc24 25inc:26  %j.inc = add nuw nsw i32 %j, 127  br label %for28 29exit:30  br label %return31 32return:33  ret void34}35 36 37; CHECK: Statistics {38; CHECK:     Dead accesses removed: 139; CHECK:     Dead instructions removed: 140; CHECK: }41 42; CHECK:      After accesses {43; CHECK-NEXT:     Stmt_body44; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]45; CHECK-NEXT:                 [n] -> { Stmt_body[i0] -> MemRef_A[0] };46; CHECK-NEXT: }47