|
| 1 | +; RUN: igc_opt --igc-vectorizer -S -dce < %s 2>&1 | FileCheck %s |
| 2 | + |
| 3 | +define spir_kernel void @quux() { |
| 4 | +; CHECK-LABEL: @quux( |
| 5 | +; CHECK-NEXT: bb43: |
| 6 | +; CHECK-NEXT: br label [[BB123:%.*]] |
| 7 | +; CHECK: bb60: |
| 8 | +; CHECK-NEXT: br label [[BB88:%.*]] |
| 9 | +; CHECK: bb88: |
| 10 | +; CHECK-NEXT: [[VECTORIZED_PHI:%.*]] = phi <8 x i32> [ zeroinitializer, [[BB60:%.*]] ], [ [[TMP113:%.*]], [[BB88]] ] |
| 11 | +; CHECK-NEXT: [[TMP112:%.*]] = call <8 x i32> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v8i16.v8i32(<8 x i32> [[VECTORIZED_PHI]], <8 x i16> zeroinitializer, <8 x i32> zeroinitializer, i32 0, i32 0, i32 0, i32 0, i1 false) |
| 12 | +; CHECK-NEXT: [[TMP113]] = call <8 x i32> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v8i16.v8i32(<8 x i32> zeroinitializer, <8 x i16> zeroinitializer, <8 x i32> zeroinitializer, i32 0, i32 0, i32 0, i32 0, i1 false) |
| 13 | +; CHECK-NEXT: br i1 false, label [[BB88]], label [[BB123]] |
| 14 | +; CHECK: bb123: |
| 15 | +; CHECK-NEXT: [[VECTORIZED_PHI1:%.*]] = phi <8 x i32> [ zeroinitializer, [[BB43:%.*]] ], [ [[TMP113]], [[BB88]] ] |
| 16 | +; CHECK-NEXT: [[TMP151:%.*]] = bitcast <8 x i32> [[VECTORIZED_PHI1]] to <8 x i32> |
| 17 | +; CHECK-NEXT: call void @llvm.genx.GenISA.LSC2DBlockWrite.v8i32(i64 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i1 false, i1 false, i32 0, <8 x i32> [[TMP151]]) |
| 18 | +; CHECK-NEXT: ret void |
| 19 | +; |
| 20 | +bb43: |
| 21 | + br label %bb123 |
| 22 | + |
| 23 | +bb60: ; No predecessors! |
| 24 | + br label %bb88 |
| 25 | + |
| 26 | +bb88: ; preds = %bb88, %bb60 |
| 27 | + %tmp90 = phi i32 [ 0, %bb60 ], [ %tmp114, %bb88 ] |
| 28 | + %tmp91 = phi i32 [ 0, %bb60 ], [ %tmp115, %bb88 ] |
| 29 | + %tmp92 = phi i32 [ 0, %bb60 ], [ %tmp116, %bb88 ] |
| 30 | + %tmp93 = phi i32 [ 0, %bb60 ], [ %tmp117, %bb88 ] |
| 31 | + %tmp94 = phi i32 [ 0, %bb60 ], [ %tmp118, %bb88 ] |
| 32 | + %tmp95 = phi i32 [ 0, %bb60 ], [ %tmp119, %bb88 ] |
| 33 | + %tmp96 = phi i32 [ 0, %bb60 ], [ %tmp120, %bb88 ] |
| 34 | + %tmp97 = phi i32 [ 0, %bb60 ], [ %tmp121, %bb88 ] |
| 35 | + %tmp104 = insertelement <8 x i32> zeroinitializer, i32 %tmp90, i64 0 |
| 36 | + %tmp105 = insertelement <8 x i32> %tmp104, i32 %tmp91, i64 1 |
| 37 | + %tmp106 = insertelement <8 x i32> %tmp105, i32 %tmp92, i64 2 |
| 38 | + %tmp107 = insertelement <8 x i32> %tmp106, i32 %tmp93, i64 3 |
| 39 | + %tmp108 = insertelement <8 x i32> %tmp107, i32 %tmp94, i64 4 |
| 40 | + %tmp109 = insertelement <8 x i32> %tmp108, i32 %tmp95, i64 5 |
| 41 | + %tmp110 = insertelement <8 x i32> %tmp109, i32 %tmp96, i64 6 |
| 42 | + %tmp111 = insertelement <8 x i32> %tmp110, i32 %tmp97, i64 7 |
| 43 | + %tmp112 = call <8 x i32> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v8i16.v8i32(<8 x i32> %tmp111, <8 x i16> zeroinitializer, <8 x i32> zeroinitializer, i32 0, i32 0, i32 0, i32 0, i1 false) |
| 44 | + %tmp113 = call <8 x i32> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v8i16.v8i32(<8 x i32> zeroinitializer, <8 x i16> zeroinitializer, <8 x i32> zeroinitializer, i32 0, i32 0, i32 0, i32 0, i1 false) |
| 45 | + %tmp114 = extractelement <8 x i32> %tmp113, i64 0 |
| 46 | + %tmp115 = extractelement <8 x i32> %tmp113, i64 1 |
| 47 | + %tmp116 = extractelement <8 x i32> %tmp113, i64 2 |
| 48 | + %tmp117 = extractelement <8 x i32> %tmp113, i64 3 |
| 49 | + %tmp118 = extractelement <8 x i32> %tmp113, i64 4 |
| 50 | + %tmp119 = extractelement <8 x i32> %tmp113, i64 5 |
| 51 | + %tmp120 = extractelement <8 x i32> %tmp113, i64 6 |
| 52 | + %tmp121 = extractelement <8 x i32> %tmp113, i64 7 |
| 53 | + br i1 false, label %bb88, label %bb123 |
| 54 | + |
| 55 | +bb123: ; preds = %bb88, %bb43 |
| 56 | + %tmp133 = phi i32 [ 0, %bb43 ], [ %tmp114, %bb88 ] |
| 57 | + %tmp134 = phi i32 [ 0, %bb43 ], [ %tmp115, %bb88 ] |
| 58 | + %tmp135 = phi i32 [ 0, %bb43 ], [ %tmp116, %bb88 ] |
| 59 | + %tmp136 = phi i32 [ 0, %bb43 ], [ %tmp117, %bb88 ] |
| 60 | + %tmp137 = phi i32 [ 0, %bb43 ], [ %tmp118, %bb88 ] |
| 61 | + %tmp138 = phi i32 [ 0, %bb43 ], [ %tmp119, %bb88 ] |
| 62 | + %tmp139 = phi i32 [ 0, %bb43 ], [ %tmp120, %bb88 ] |
| 63 | + %tmp140 = phi i32 [ 0, %bb43 ], [ %tmp121, %bb88 ] |
| 64 | + %tmp143 = insertelement <8 x i32> zeroinitializer, i32 %tmp133, i64 0 |
| 65 | + %tmp144 = insertelement <8 x i32> %tmp143, i32 %tmp134, i64 1 |
| 66 | + %tmp145 = insertelement <8 x i32> %tmp144, i32 %tmp135, i64 2 |
| 67 | + %tmp146 = insertelement <8 x i32> %tmp145, i32 %tmp136, i64 3 |
| 68 | + %tmp147 = insertelement <8 x i32> %tmp146, i32 %tmp137, i64 4 |
| 69 | + %tmp148 = insertelement <8 x i32> %tmp147, i32 %tmp138, i64 5 |
| 70 | + %tmp149 = insertelement <8 x i32> %tmp148, i32 %tmp139, i64 6 |
| 71 | + %tmp150 = insertelement <8 x i32> %tmp149, i32 %tmp140, i64 7 |
| 72 | + %tmp151 = bitcast <8 x i32> %tmp150 to <8 x i32> |
| 73 | + call void @llvm.genx.GenISA.LSC2DBlockWrite.v8i32(i64 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i1 false, i1 false, i32 0, <8 x i32> %tmp151) |
| 74 | + ret void |
| 75 | +} |
| 76 | + |
| 77 | +declare <8 x i32> @llvm.genx.GenISA.sub.group.dpas.v8f32.v8f32.v8i16.v8i32(<8 x i32>, <8 x i16>, <8 x i32>, i32, i32, i32, i32, i1) |
| 78 | + |
| 79 | +declare <8 x i16> @llvm.genx.GenISA.LSC2DBlockRead.v8i16(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32) |
| 80 | + |
| 81 | +declare <8 x i32> @llvm.genx.GenISA.LSC2DBlockRead.v8i32(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32) |
| 82 | + |
| 83 | +declare void @llvm.genx.GenISA.LSC2DBlockWrite.v8i32(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32, <8 x i32>) |
| 84 | + |
| 85 | +!igc.functions = !{!0} |
| 86 | +!0 = !{void ()* @quux, !1} |
| 87 | +!1 = !{!2, !3} |
| 88 | +!2 = !{!"function_type", i32 0} |
| 89 | +!3 = !{!"sub_group_size", i32 16} |
| 90 | + |
0 commit comments