108 lines · plain
1; RUN: llc -mtriple=hexagon -hexagon-small-data-threshold=0 -disable-hexagon-amodeopt < %s | FileCheck %s --check-prefix=CHECK-NO-AMODE2; RUN: llc -mtriple=hexagon -hexagon-small-data-threshold=0 -disable-hexagon-amodeopt=0 -hexagon-amode-growth-limit=4 < %s | FileCheck %s --check-prefix=CHECK-AMODE3 4; CHECK-NO-AMODE: [[REG0:(r[0-9]+)]] = ##global_25; CHECK-NO-AMODE: memw([[REG0]]+{{.*}}<<#2) =6 7; CHECK-AMODE: [[REG1:(r[0-9]+)]] = memw(##global_1)8; CHECK-AMODE: memw([[REG1]]<<#2+##global_2) =9 10@global_1 = external global i32, align 411@global_2 = external global [128 x i32], align 812 13declare i32 @foo(i32, i32) #014 15define i32 @fred(i32 %a0, i32 %a1, ptr %p) #0 {16entry:17 %call24 = tail call i32 @foo(i32 %a0, i32 1) #018 %tobool26 = icmp eq i32 %call24, 019 br i1 %tobool26, label %while.end, label %while.body.lr.ph20 21while.body.lr.ph: ; preds = %entry22 %cmp3 = icmp sgt i32 %a1, 1923 %sub = sub nsw i32 19, %a024 %xor = xor i32 %a0, 125 br i1 %cmp3, label %while.body.us.preheader, label %while.body.preheader26 27while.body.preheader: ; preds = %while.body.lr.ph28 br label %while.body29 30while.body.us.preheader: ; preds = %while.body.lr.ph31 br label %while.body.us32 33while.body.us: ; preds = %while.body.us.preheader, %while.cond.backedge.us34 %call27.us = phi i32 [ %call.us, %while.cond.backedge.us ], [ %call24, %while.body.us.preheader ]35 %x0 = load i32, ptr %p, align 4, !tbaa !436 %cmp.us = icmp sgt i32 %x0, 037 br i1 %cmp.us, label %if.then.us, label %if.end.us38 39if.then.us: ; preds = %while.body.us40 %sext.us = shl i32 %call27.us, 2441 %conv2.us = ashr i32 %sext.us, 2442 %x10 = tail call i32 @foo(i32 %conv2.us, i32 %sext.us) #043 br label %if.end.us44 45if.end.us: ; preds = %if.then.us, %while.body.us46 %x1 = load i32, ptr %p, align 4, !tbaa !447 %call8.us = tail call i32 @foo(i32 %sub, i32 %a1) #048 %tobool11.us = icmp eq i32 %call8.us, 049 br i1 %tobool11.us, label %while.cond.backedge.us, label %if.then12.us50 51if.then12.us: ; preds = %if.end.us52 %x3 = load i32, ptr %p, align 4, !tbaa !453 %sub13.us = sub i32 %x3, %x154 %x4 = load i32, ptr @global_1, align 4, !tbaa !455 %arrayidx.us = getelementptr inbounds [128 x i32], ptr @global_2, i32 0, i32 %x456 store i32 %sub13.us, ptr %arrayidx.us, align 4, !tbaa !457 br label %while.cond.backedge.us58 59while.cond.backedge.us: ; preds = %if.then12.us, %if.end.us60 %call.us = tail call i32 @foo(i32 %a0, i32 2) #061 %tobool.us = icmp eq i32 %call.us, 062 br i1 %tobool.us, label %while.end.loopexit, label %while.body.us63 64while.body: ; preds = %while.body.preheader, %while.cond.backedge65 %call27 = phi i32 [ %call, %while.cond.backedge ], [ %call24, %while.body.preheader ]66 %x5 = load i32, ptr %p, align 4, !tbaa !467 %cmp = icmp sgt i32 %x5, 068 br i1 %cmp, label %if.then, label %if.end69 70if.then: ; preds = %while.body71 %sext = shl i32 %call27, 2472 %conv2 = ashr i32 %sext, 2473 %x11 = tail call i32 @foo(i32 %conv2, i32 %sext) #074 br label %if.end75 76if.end: ; preds = %if.then, %while.body77 %tobool11 = icmp eq i32 %call27, 078 br i1 %tobool11, label %while.cond.backedge, label %if.then1279 80if.then12: ; preds = %if.end81 %x7 = load i32, ptr @global_1, align 4, !tbaa !482 %arrayidx = getelementptr inbounds [128 x i32], ptr @global_2, i32 0, i32 %x783 store i32 0, ptr %arrayidx, align 4, !tbaa !484 br label %while.cond.backedge85 86while.cond.backedge: ; preds = %if.then12, %if.end87 %call = tail call i32 @foo(i32 %a0, i32 3) #088 %tobool = icmp eq i32 %call, 089 br i1 %tobool, label %while.end.loopexit33, label %while.body90 91while.end.loopexit: ; preds = %while.cond.backedge.us92 br label %while.end93 94while.end.loopexit33: ; preds = %while.cond.backedge95 br label %while.end96 97while.end: ; preds = %while.end.loopexit33, %while.end.loopexit, %entry98 ret i32 099}100 101attributes #0 = { nounwind }102 103!1 = !{!2, !2, i64 0}104!2 = !{!"omnipotent char", !3, i64 0}105!3 = !{!"Simple C/C++ TBAA"}106!4 = !{!5, !5, i64 0}107!5 = !{!"int", !2, i64 0}108