brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · a742ea8 Raw
55 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<simplify>' -polly-print-simplify -disable-output -aa-pipeline=basic-aa < %s | FileCheck %s -match-full-lines2;3; Do not remove redundant stores in the middle of region statements.4; The store in region_true could be removed, but in practice we do try to5; determine the relative ordering of block in region statements.6;7; for (int j = 0; j < n; j += 1) {8;   double val = A[0];9;   if (val == 0.0)10;     A[0] = val;11;   else12;     A[0] = 0.0;13; }14;15define void @notredundant_region(i32 %n, ptr noalias nonnull %A) {16entry:17  br label %for18 19for:20  %j = phi i32 [0, %entry], [%j.inc, %inc]21  %j.cmp = icmp slt i32 %j, %n22  br i1 %j.cmp, label %region_entry, label %exit23 24 25    region_entry:26      %val = load double, ptr %A27      %cmp = fcmp oeq double %val, 0.028      br i1 %cmp, label %region_true, label %region_false29 30    region_true:31      store double %val, ptr %A32      br label %region_exit33 34    region_false:35      store double 0.0, ptr %A36      br label %region_exit37 38    region_exit:39      br label %inc40 41 42inc:43  %j.inc = add nuw nsw i32 %j, 144  br label %for45 46exit:47  br label %return48 49return:50  ret void51}52 53 54; CHECK: SCoP could not be simplified55