brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 888daef Raw
56 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<import-jscop;simplify-0>' -polly-print-simplify -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck -match-full-lines %s2;3; Combine four partial stores into two.4; The stores write to the same array, but never the same element.5;6; for (int j = 0; j < n; j += 1) {7;   A[0] = 21.0;8;   A[1] = 42.0;9;   A[0] = 21.0;10;   A[1] = 42.0;11; }12;13define void @coalesce_disjointelements(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 %body, label %exit21 22    body:23      %A_1 = getelementptr inbounds double, ptr %A, i32 124      store double 21.0, ptr %A25      store double 42.0, ptr %A_126      store double 21.0, ptr %A27      store double 42.0, ptr %A_128      br label %inc29 30inc:31  %j.inc = add nuw nsw i32 %j, 132  br label %for33 34exit:35  br label %return36 37return:38  ret void39}40 41 42; CHECK: Statistics {43; CHECK:     Overwrites removed: 044; CHECK:     Partial writes coalesced: 245; CHECK: }46 47; CHECK:      After accesses {48; CHECK-NEXT:     Stmt_body49; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]50; CHECK-NEXT:                 [n] -> { Stmt_body[i0] -> MemRef_A[0] };51; CHECK-NEXT:            new: [n] -> { Stmt_body[i0] -> MemRef_A[0] };52; CHECK-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]53; CHECK-NEXT:                 [n] -> { Stmt_body[i0] -> MemRef_A[1] };54; CHECK-NEXT:            new: [n] -> { Stmt_body[i0] -> MemRef_A[1] };55; CHECK-NEXT: }56