brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.4 KiB · 358a2c3 Raw
191 lines · plain
1; RUN: llc < %s -mcpu=cyclone -verify-machineinstrs -aarch64-enable-ccmp | FileCheck %s2target triple = "arm64-apple-ios7.0.0"3 4@channelColumns = external global i645@channelTracks = external global i646@mazeRoute = external hidden unnamed_addr global ptr, align 87@TOP = external global ptr8@BOT = external global ptr9@netsAssign = external global ptr10 11; Function from yacr2/maze.c12; The branch at the end of %if.then is driven by %cmp5 and %cmp6.13; Isel converts the and i1 into two branches, and arm64-ccmp should not convert14; it back again. %cmp6 has much higher latency than %cmp5.15; CHECK: Maze116; CHECK: %if.then17; CHECK: cmp x{{[0-9]+}}, #218; CHECK-NEXT: b.lo19; CHECK: %if.then20; CHECK: cmp x{{[0-9]+}}, #221; CHECK-NEXT: b.lo22define i32 @Maze1() nounwind ssp {23entry:24  %0 = load i64, ptr @channelColumns, align 8, !tbaa !025  %cmp90 = icmp eq i64 %0, 026  br i1 %cmp90, label %for.end, label %for.body27 28for.body:                                         ; preds = %for.inc, %entry29  %1 = phi i64 [ %0, %entry ], [ %37, %for.inc ]30  %i.092 = phi i64 [ 1, %entry ], [ %inc53, %for.inc ]31  %numLeft.091 = phi i32 [ 0, %entry ], [ %numLeft.1, %for.inc ]32  %2 = load ptr, ptr @mazeRoute, align 8, !tbaa !333  %arrayidx = getelementptr inbounds i8, ptr %2, i64 %i.09234  %3 = load i8, ptr %arrayidx, align 1, !tbaa !135  %tobool = icmp eq i8 %3, 036  br i1 %tobool, label %for.inc, label %if.then37 38if.then:                                          ; preds = %for.body39  %4 = load ptr, ptr @TOP, align 8, !tbaa !340  %arrayidx1 = getelementptr inbounds i64, ptr %4, i64 %i.09241  %5 = load i64, ptr %arrayidx1, align 8, !tbaa !042  %6 = load ptr, ptr @netsAssign, align 8, !tbaa !343  %arrayidx2 = getelementptr inbounds i64, ptr %6, i64 %544  %7 = load i64, ptr %arrayidx2, align 8, !tbaa !045  %8 = load ptr, ptr @BOT, align 8, !tbaa !346  %arrayidx3 = getelementptr inbounds i64, ptr %8, i64 %i.09247  %9 = load i64, ptr %arrayidx3, align 8, !tbaa !048  %arrayidx4 = getelementptr inbounds i64, ptr %6, i64 %949  %10 = load i64, ptr %arrayidx4, align 8, !tbaa !050  %cmp5 = icmp ugt i64 %i.092, 151  %cmp6 = icmp ugt i64 %10, 152  %or.cond = and i1 %cmp5, %cmp653  br i1 %or.cond, label %land.lhs.true7, label %if.else54 55land.lhs.true7:                                   ; preds = %if.then56  %11 = load i64, ptr @channelTracks, align 8, !tbaa !057  %add = add i64 %11, 158  %call = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 %add, i64 %10, i64 0, i64 %7, i32 -1, i32 -1)59  %tobool8 = icmp eq i32 %call, 060  br i1 %tobool8, label %land.lhs.true7.if.else_crit_edge, label %if.then961 62land.lhs.true7.if.else_crit_edge:                 ; preds = %land.lhs.true763  %.pre = load i64, ptr @channelColumns, align 8, !tbaa !064  br label %if.else65 66if.then9:                                         ; preds = %land.lhs.true767  %12 = load ptr, ptr @mazeRoute, align 8, !tbaa !368  %arrayidx10 = getelementptr inbounds i8, ptr %12, i64 %i.09269  store i8 0, ptr %arrayidx10, align 1, !tbaa !170  %13 = load ptr, ptr @TOP, align 8, !tbaa !371  %arrayidx11 = getelementptr inbounds i64, ptr %13, i64 %i.09272  %14 = load i64, ptr %arrayidx11, align 8, !tbaa !073  tail call fastcc void @CleanNet(i64 %14)74  %15 = load ptr, ptr @BOT, align 8, !tbaa !375  %arrayidx12 = getelementptr inbounds i64, ptr %15, i64 %i.09276  %16 = load i64, ptr %arrayidx12, align 8, !tbaa !077  tail call fastcc void @CleanNet(i64 %16)78  br label %for.inc79 80if.else:                                          ; preds = %land.lhs.true7.if.else_crit_edge, %if.then81  %17 = phi i64 [ %.pre, %land.lhs.true7.if.else_crit_edge ], [ %1, %if.then ]82  %cmp13 = icmp ult i64 %i.092, %1783  %or.cond89 = and i1 %cmp13, %cmp684  br i1 %or.cond89, label %land.lhs.true16, label %if.else2485 86land.lhs.true16:                                  ; preds = %if.else87  %18 = load i64, ptr @channelTracks, align 8, !tbaa !088  %add17 = add i64 %18, 189  %call18 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 %add17, i64 %10, i64 0, i64 %7, i32 1, i32 -1)90  %tobool19 = icmp eq i32 %call18, 091  br i1 %tobool19, label %if.else24, label %if.then2092 93if.then20:                                        ; preds = %land.lhs.true1694  %19 = load ptr, ptr @mazeRoute, align 8, !tbaa !395  %arrayidx21 = getelementptr inbounds i8, ptr %19, i64 %i.09296  store i8 0, ptr %arrayidx21, align 1, !tbaa !197  %20 = load ptr, ptr @TOP, align 8, !tbaa !398  %arrayidx22 = getelementptr inbounds i64, ptr %20, i64 %i.09299  %21 = load i64, ptr %arrayidx22, align 8, !tbaa !0100  tail call fastcc void @CleanNet(i64 %21)101  %22 = load ptr, ptr @BOT, align 8, !tbaa !3102  %arrayidx23 = getelementptr inbounds i64, ptr %22, i64 %i.092103  %23 = load i64, ptr %arrayidx23, align 8, !tbaa !0104  tail call fastcc void @CleanNet(i64 %23)105  br label %for.inc106 107if.else24:                                        ; preds = %land.lhs.true16, %if.else108  br i1 %cmp5, label %land.lhs.true26, label %if.else36109 110land.lhs.true26:                                  ; preds = %if.else24111  %24 = load i64, ptr @channelTracks, align 8, !tbaa !0112  %cmp27 = icmp ult i64 %7, %24113  br i1 %cmp27, label %land.lhs.true28, label %if.else36114 115land.lhs.true28:                                  ; preds = %land.lhs.true26116  %add29 = add i64 %24, 1117  %call30 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 0, i64 %7, i64 %add29, i64 %10, i32 -1, i32 1)118  %tobool31 = icmp eq i32 %call30, 0119  br i1 %tobool31, label %if.else36, label %if.then32120 121if.then32:                                        ; preds = %land.lhs.true28122  %25 = load ptr, ptr @mazeRoute, align 8, !tbaa !3123  %arrayidx33 = getelementptr inbounds i8, ptr %25, i64 %i.092124  store i8 0, ptr %arrayidx33, align 1, !tbaa !1125  %26 = load ptr, ptr @TOP, align 8, !tbaa !3126  %arrayidx34 = getelementptr inbounds i64, ptr %26, i64 %i.092127  %27 = load i64, ptr %arrayidx34, align 8, !tbaa !0128  tail call fastcc void @CleanNet(i64 %27)129  %28 = load ptr, ptr @BOT, align 8, !tbaa !3130  %arrayidx35 = getelementptr inbounds i64, ptr %28, i64 %i.092131  %29 = load i64, ptr %arrayidx35, align 8, !tbaa !0132  tail call fastcc void @CleanNet(i64 %29)133  br label %for.inc134 135if.else36:                                        ; preds = %land.lhs.true28, %land.lhs.true26, %if.else24136  %30 = load i64, ptr @channelColumns, align 8, !tbaa !0137  %cmp37 = icmp ult i64 %i.092, %30138  br i1 %cmp37, label %land.lhs.true38, label %if.else48139 140land.lhs.true38:                                  ; preds = %if.else36141  %31 = load i64, ptr @channelTracks, align 8, !tbaa !0142  %cmp39 = icmp ult i64 %7, %31143  br i1 %cmp39, label %land.lhs.true40, label %if.else48144 145land.lhs.true40:                                  ; preds = %land.lhs.true38146  %add41 = add i64 %31, 1147  %call42 = tail call fastcc i32 @Maze1Mech(i64 %i.092, i64 0, i64 %7, i64 %add41, i64 %10, i32 1, i32 1)148  %tobool43 = icmp eq i32 %call42, 0149  br i1 %tobool43, label %if.else48, label %if.then44150 151if.then44:                                        ; preds = %land.lhs.true40152  %32 = load ptr, ptr @mazeRoute, align 8, !tbaa !3153  %arrayidx45 = getelementptr inbounds i8, ptr %32, i64 %i.092154  store i8 0, ptr %arrayidx45, align 1, !tbaa !1155  %33 = load ptr, ptr @TOP, align 8, !tbaa !3156  %arrayidx46 = getelementptr inbounds i64, ptr %33, i64 %i.092157  %34 = load i64, ptr %arrayidx46, align 8, !tbaa !0158  tail call fastcc void @CleanNet(i64 %34)159  %35 = load ptr, ptr @BOT, align 8, !tbaa !3160  %arrayidx47 = getelementptr inbounds i64, ptr %35, i64 %i.092161  %36 = load i64, ptr %arrayidx47, align 8, !tbaa !0162  tail call fastcc void @CleanNet(i64 %36)163  br label %for.inc164 165if.else48:                                        ; preds = %land.lhs.true40, %land.lhs.true38, %if.else36166  %inc = add nsw i32 %numLeft.091, 1167  br label %for.inc168 169for.inc:                                          ; preds = %if.else48, %if.then44, %if.then32, %if.then20, %if.then9, %for.body170  %numLeft.1 = phi i32 [ %numLeft.091, %if.then9 ], [ %numLeft.091, %if.then20 ], [ %numLeft.091, %if.then32 ], [ %numLeft.091, %if.then44 ], [ %inc, %if.else48 ], [ %numLeft.091, %for.body ]171  %inc53 = add i64 %i.092, 1172  %37 = load i64, ptr @channelColumns, align 8, !tbaa !0173  %cmp = icmp ugt i64 %inc53, %37174  br i1 %cmp, label %for.end, label %for.body175 176for.end:                                          ; preds = %for.inc, %entry177  %numLeft.0.lcssa = phi i32 [ 0, %entry ], [ %numLeft.1, %for.inc ]178  ret i32 %numLeft.0.lcssa179}180 181; Materializable182declare hidden fastcc i32 @Maze1Mech(i64, i64, i64, i64, i64, i32, i32) nounwind ssp183 184; Materializable185declare hidden fastcc void @CleanNet(i64) nounwind ssp186 187!0 = !{!"long", !1}188!1 = !{!"omnipotent char", !2}189!2 = !{!"Simple C/C++ TBAA"}190!3 = !{!"any pointer", !1}191