Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon < %s | FileCheck %s
      2 
      3 ; Test that we generate a single packet for the vectorized dot product loop.
      4 
      5 ; CHECK: loop0(.LBB0_[[LOOP:.]],
      6 ; CHECK: .LBB0_[[LOOP]]:
      7 ; CHECK: {
      8 ; CHECK: mpyi
      9 ; CHECK: mpyi
     10 ; CHECK: memd
     11 ; CHECK: memd
     12 ; CHECK-NOT: {
     13 ; CHECK: }{{[ \t]*}}:endloop
     14 
     15 ; Function Attrs: nounwind readonly
     16 define i32 @f0(i32* nocapture readonly %a0, i32* nocapture readonly %a1) #0 {
     17 b0:
     18   %v0 = bitcast i32* %a0 to i64*
     19   %v1 = bitcast i32* %a1 to i64*
     20   br label %b1
     21 
     22 b1:                                               ; preds = %b1, %b0
     23   %v2 = phi i64* [ %v0, %b0 ], [ %v21, %b1 ]
     24   %v3 = phi i64* [ %v1, %b0 ], [ %v22, %b1 ]
     25   %v4 = phi i32 [ 0, %b0 ], [ %v19, %b1 ]
     26   %v5 = phi i32 [ 0, %b0 ], [ %v14, %b1 ]
     27   %v6 = phi i32 [ 0, %b0 ], [ %v18, %b1 ]
     28   %v7 = load i64, i64* %v2, align 8
     29   %v8 = trunc i64 %v7 to i32
     30   %v9 = lshr i64 %v7, 32
     31   %v10 = load i64, i64* %v3, align 8
     32   %v11 = trunc i64 %v10 to i32
     33   %v12 = lshr i64 %v10, 32
     34   %v13 = mul nsw i32 %v11, %v8
     35   %v14 = add nsw i32 %v13, %v5
     36   %v15 = trunc i64 %v9 to i32
     37   %v16 = trunc i64 %v12 to i32
     38   %v17 = mul nsw i32 %v16, %v15
     39   %v18 = add nsw i32 %v17, %v6
     40   %v19 = add nsw i32 %v4, 1
     41   %v20 = icmp eq i32 %v19, 199
     42   %v21 = getelementptr i64, i64* %v2, i32 1
     43   %v22 = getelementptr i64, i64* %v3, i32 1
     44   br i1 %v20, label %b2, label %b1
     45 
     46 b2:                                               ; preds = %b1
     47   %v23 = add nsw i32 %v14, %v18
     48   ret i32 %v23
     49 }
     50 
     51 attributes #0 = { nounwind readonly }
     52