77 lines · plain
1; RUN: llc -O2 -mtriple=hexagon < %s | FileCheck %s2; Rely on the comments generated by llc. Make sure there are no add/addasl3; instructions in while.body13 (before the loads).4; CHECK: while.body135; CHECK-NOT: add6; CHECK: memw7 8%struct.1 = type { i32, i32 }9%struct.2 = type { [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [24 x i32], [3 x i32], [24 x i32], [8 x %struct.1], [5 x i32] }10 11@A1 = global i64 zeroinitializer12@A2 = global i64 zeroinitializer13@B1 = global i32 zeroinitializer14@B2 = global i32 zeroinitializer15@C1 = global i8 zeroinitializer16 17declare i32 @llvm.hexagon.S2.cl0(i32) nounwind readnone18declare i32 @llvm.hexagon.S2.setbit.r(i32, i32) nounwind readnone19declare i64 @llvm.hexagon.M2.vmpy2s.s0(i32, i32) nounwind readnone20declare i64 @llvm.hexagon.M2.vmac2s.s0(i64, i32, i32) nounwind readnone21declare i64 @llvm.hexagon.A2.vaddws(i64, i64) nounwind readnone22declare i64 @llvm.hexagon.A2.vsubws(i64, i64) nounwind readnone23declare i32 @llvm.hexagon.A4.modwrapu(i32, i32) nounwind readnone24 25define void @foo(i32 %n) nounwind {26entry:27 br label %while.body28 29while.body:30 %count = phi i32 [ 0, %entry ], [ %next, %while.end ]31 %idx = phi i32 [ 0, %entry ], [ %15, %while.end ]32 %0 = load i32, ptr @B1, align 433 %1 = load i32, ptr @B2, align 834 %2 = and i32 %1, %035 br label %while.body1336 37while.body13: ; preds = %while.body, %if.end38 %3 = phi i64 [ %13, %if.end ], [ 0, %while.body ]39 %4 = phi i64 [ %14, %if.end ], [ 0, %while.body ]40 %m = phi i32 [ %6, %if.end ], [ %2, %while.body ]41 %5 = tail call i32 @llvm.hexagon.S2.cl0(i32 %m)42 %6 = tail call i32 @llvm.hexagon.S2.setbit.r(i32 %m, i32 %5)43 %cgep85 = getelementptr [10 x %struct.2], ptr inttoptr (i32 -121502345 to ptr), i32 0, i32 %idx44 %cgep90 = getelementptr %struct.2, ptr %cgep85, i32 0, i32 12, i32 %545 %7 = load i32, ptr %cgep90, align 446 %8 = tail call i64 @llvm.hexagon.M2.vmpy2s.s0(i32 %7, i32 %7)47 %cgep91 = getelementptr %struct.2, ptr %cgep85, i32 0, i32 13, i32 %548 %9 = load i32, ptr %cgep91, align 449 %10 = tail call i64 @llvm.hexagon.M2.vmac2s.s0(i64 %8, i32 %9, i32 %9)50 %11 = load i8, ptr @C1, align 151 %and24 = and i8 %11, 152 %cmp = icmp eq i8 %and24, 053 br i1 %cmp, label %if.then, label %if.end54 55if.then: ; preds = %while.body1356 %12 = tail call i64 @llvm.hexagon.A2.vaddws(i64 %3, i64 %10)57 store i64 %12, ptr @A1, align 858 br label %if.end59 60if.end: ; preds = %if.then, %while.body1361 %13 = phi i64 [ %12, %if.then ], [ %3, %while.body13 ]62 %14 = tail call i64 @llvm.hexagon.A2.vsubws(i64 %4, i64 %10)63 %tobool12 = icmp eq i32 %6, 064 br i1 %tobool12, label %while.end, label %while.body1365 66while.end:67 %add40 = add i32 %idx, 168 %15 = tail call i32 @llvm.hexagon.A4.modwrapu(i32 %add40, i32 10) nounwind69 %next = add i32 %count, 170 %cc = icmp eq i32 %next, %n71 br i1 %cc, label %end, label %while.body72 73end:74 store i64 %10, ptr @A2, align 875 ret void76}77