brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · ae67c3a Raw
50 lines · plain
1; RUN: opt < %s -passes='loop-mssa(loop-rotate,licm)' -S | FileCheck %s2; PR96043 4@g_3 = global i32 0, align 45@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00"6 7define i32 @main() nounwind {8entry:9  %tmp = load i32, ptr @g_3, align 410  %tobool = icmp eq i32 %tmp, 011  br i1 %tobool, label %for.cond, label %if.then12 13if.then:                                          ; preds = %entry14  br label %for.cond15 16for.cond:                                         ; preds = %for.inc10, %if.then, %entry17  %g.0 = phi ptr [ %g.0, %for.inc10 ], [ @g_3, %entry ], [ null, %if.then ]18  %x.0 = phi i32 [ %inc12, %for.inc10 ], [ 0, %entry ], [ 0, %if.then ]19  %cmp = icmp slt i32 %x.0, 520  br i1 %cmp, label %for.cond4, label %for.end1321 22for.cond4:                                        ; preds = %for.body7, %for.cond23  %y.0 = phi i32 [ %inc, %for.body7 ], [ 0, %for.cond ]24  %cmp6 = icmp slt i32 %y.0, 525  br i1 %cmp6, label %for.body7, label %for.inc1026 27; CHECK: for.body7:28; CHECK-NEXT: phi29; CHECK-NEXT: store i32 030; CHECK-NEXT: store i32 131 32for.body7:                                        ; preds = %for.cond433  store i32 0, ptr @g_3, align 434  store i32 1, ptr %g.0, align 435  %inc = add nsw i32 %y.0, 136  br label %for.cond437 38for.inc10:                                        ; preds = %for.cond439  %inc12 = add nsw i32 %x.0, 140  br label %for.cond41 42for.end13:                                        ; preds = %for.cond43  %tmp14 = load i32, ptr @g_3, align 444  %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp14) nounwind45  ret i32 046}47 48declare i32 @printf(ptr nocapture, ...) nounwind49 50