119 lines · plain
1; RUN: llc -verify-machineinstrs -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s2 3%struct.anon = type { %struct.anon.0, %struct.anon.1 }4%struct.anon.0 = type { i32 }5%struct.anon.1 = type { i32 }6 7@i = common global i32 0, align 48@b = common global ptr null, align 89@c = common global i32 0, align 410@a = common global i32 0, align 411@h = common global i32 0, align 412@g = common global i32 0, align 413@j = common global i32 0, align 414@f = common global %struct.anon zeroinitializer, align 415@d = common global i32 0, align 416@e = common global i32 0, align 417 18; Function Attrs: norecurse nounwind19define signext i32 @fn1(ptr nocapture %p1, i32 signext %p2, ptr nocapture %p3) {20entry:21 %0 = load i32, ptr @i, align 4, !tbaa !122 %cond = icmp eq i32 %0, 823 br i1 %cond, label %if.end16, label %while.cond.preheader24 25while.cond.preheader: ; preds = %entry26 %1 = load ptr, ptr @b, align 8, !tbaa !527 %2 = load i32, ptr %1, align 4, !tbaa !128 %tobool18 = icmp eq i32 %2, 029 br i1 %tobool18, label %while.end, label %while.body.lr.ph30 31while.body.lr.ph: ; preds = %while.cond.preheader32 %.pre = load i32, ptr @c, align 4, !tbaa !133 br label %while.body34 35while.body: ; preds = %while.body.backedge, %while.body.lr.ph36 switch i32 %.pre, label %while.body.backedge [37 i32 0, label %sw.bb138 i32 80, label %sw.bb139 i32 60, label %sw.bb140 i32 240, label %while.cond.backedge41 ]42 43while.body.backedge: ; preds = %while.body, %while.cond.backedge44 br label %while.body45 46sw.bb1: ; preds = %while.body, %while.body, %while.body47 store i32 2, ptr @a, align 4, !tbaa !148 br label %while.cond.backedge49 50while.cond.backedge: ; preds = %while.body, %sw.bb151 store i32 4, ptr @a, align 4, !tbaa !152 %.pre19 = load i32, ptr %1, align 4, !tbaa !153 %tobool = icmp eq i32 %.pre19, 054 br i1 %tobool, label %while.end.loopexit, label %while.body.backedge55 56while.end.loopexit: ; preds = %while.cond.backedge57 br label %while.end58 59while.end: ; preds = %while.end.loopexit, %while.cond.preheader60 %3 = load i32, ptr @h, align 4, !tbaa !161 %mul = mul nsw i32 %0, %362 %4 = load i32, ptr @g, align 4, !tbaa !163 %mul4 = mul nsw i32 %mul, %464 store i32 %mul4, ptr @j, align 4, !tbaa !165 %5 = load i32, ptr @f, align 4, !tbaa !766 %tobool5 = icmp eq i32 %5, 067 br i1 %tobool5, label %if.end, label %if.then68 69if.then: ; preds = %while.end70 %div = sdiv i32 %5, %mul71 store i32 %div, ptr @g, align 4, !tbaa !172 br label %if.end73 74if.end: ; preds = %while.end, %if.then75 %6 = phi i32 [ %4, %while.end ], [ %div, %if.then ]76 %7 = load i32, ptr getelementptr inbounds (%struct.anon, ptr @f, i64 0, i32 1, i32 0), align 4, !tbaa !1077 %tobool7 = icmp ne i32 %7, 078 %tobool8 = icmp ne i32 %mul4, 079 %or.cond = and i1 %tobool7, %tobool880 %tobool10 = icmp ne i32 %0, 081 %or.cond17 = and i1 %or.cond, %tobool1082 br i1 %or.cond17, label %if.then11, label %if.end1383 84if.then11: ; preds = %if.end85 store i32 %3, ptr @d, align 4, !tbaa !186 %8 = load i32, ptr @e, align 4, !tbaa !187 store i32 %8, ptr %p3, align 4, !tbaa !188 %.pre20 = load i32, ptr @g, align 4, !tbaa !189 br label %if.end1390 91if.end13: ; preds = %if.then11, %if.end92 %9 = phi i32 [ %.pre20, %if.then11 ], [ %6, %if.end ]93 %tobool14 = icmp eq i32 %9, 094 br i1 %tobool14, label %if.end16, label %if.then1595 96if.then15: ; preds = %if.end1397 store i32 %p2, ptr %p1, align 4, !tbaa !198 br label %if.end1699 100if.end16: ; preds = %entry, %if.end13, %if.then15101 ret i32 2102}103 104; CHECK: mfocrf {{[0-9]+}}105 106!llvm.ident = !{!0}107 108!0 = !{!"clang version 3.9.0 (trunk 261520)"}109!1 = !{!2, !2, i64 0}110!2 = !{!"int", !3, i64 0}111!3 = !{!"omnipotent char", !4, i64 0}112!4 = !{!"Simple C/C++ TBAA"}113!5 = !{!6, !6, i64 0}114!6 = !{!"any pointer", !3, i64 0}115!7 = !{!8, !2, i64 0}116!8 = !{!"", !9, i64 0, !9, i64 4}117!9 = !{!"", !2, i64 0}118!10 = !{!8, !2, i64 4}119