|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2025 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | +; |
| 9 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXLiveRangesWrapper -GenXDepressurizerWrapper -march=genx64 -mtriple=spir64-unknown-unknown -mcpu=XeHPG -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-XeHPG |
| 10 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXLiveRangesWrapper -GenXDepressurizerWrapper -march=genx64 -mtriple=spir64-unknown-unknown -mcpu=XeHPC -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-XeHPC |
| 11 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXLiveRangesWrapper -GenXDepressurizerWrapper -march=genx64 -mtriple=spir64-unknown-unknown -mcpu=Xe2 -vc-grf-size=64 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-Xe2-64 |
| 12 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXLiveRangesWrapper -GenXDepressurizerWrapper -march=genx64 -mtriple=spir64-unknown-unknown -mcpu=Xe2 -vc-grf-size=128 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-Xe2-128 |
| 13 | +; RUN: %opt %use_old_pass_manager% -GenXModule -GenXLiveRangesWrapper -GenXDepressurizerWrapper -march=genx64 -mtriple=spir64-unknown-unknown -mcpu=Xe2 -vc-grf-size=256 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-Xe2-256 |
| 14 | + |
| 15 | +; CHECK-LABEL: @test1 |
| 16 | +define dllexport void @test1(<16 x half> %arg) #0 { |
| 17 | +entry: |
| 18 | + %fp = fpext <16 x half> %arg to <16 x float> |
| 19 | +; CHECK: br label %loop |
| 20 | + br label %loop |
| 21 | + |
| 22 | +loop: |
| 23 | + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] |
| 24 | + %res = phi <16 x float> [ zeroinitializer, %entry ], [ %res.next, %loop ] |
| 25 | + %i.next = add i32 %i, 1 |
| 26 | +; CHECK-XeHPG-NOT: fpext |
| 27 | +; CHECK-XeHPC-NOT: fpext |
| 28 | +; CHECK-Xe2-64-NOT: fpext |
| 29 | +; CHECK-Xe2-128-NOT: fpext |
| 30 | +; CHECK-Xe2-256-NOT: fpext |
| 31 | + %res.next = fadd <16 x float> %res, %fp |
| 32 | + %cmp = icmp ult i32 %i.next, 100 |
| 33 | + br i1 %cmp, label %loop, label %end |
| 34 | + |
| 35 | +end: |
| 36 | + ret void |
| 37 | +} |
| 38 | + |
| 39 | +; CHECK-LABEL: @test2 |
| 40 | +define dllexport <1024 x i32> @test2(<1024 x i32> %pressure, <16 x half> %arg) #0 { |
| 41 | +entry: |
| 42 | + %fp = fpext <16 x half> %arg to <16 x float> |
| 43 | +; CHECK: br label %loop |
| 44 | + br label %loop |
| 45 | + |
| 46 | +loop: |
| 47 | + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] |
| 48 | + %res = phi <16 x float> [ zeroinitializer, %entry ], [ %res.next, %loop ] |
| 49 | + %i.next = add i32 %i, 1 |
| 50 | +; CHECK-XeHPG: fpext |
| 51 | +; CHECK-XeHPC-NOT: fpext |
| 52 | +; CHECK-Xe2-64: fpext |
| 53 | +; CHECK-Xe2-128-NOT: fpext |
| 54 | +; CHECK-Xe2-256-NOT: fpext |
| 55 | + %res.next = fadd <16 x float> %res, %fp |
| 56 | + %cmp = icmp ult i32 %i.next, 100 |
| 57 | + br i1 %cmp, label %loop, label %end |
| 58 | + |
| 59 | +end: |
| 60 | + ret <1024 x i32> %pressure |
| 61 | +} |
| 62 | + |
| 63 | +; CHECK-LABEL: @test3 |
| 64 | +define dllexport <2048 x i32> @test3(<2048 x i32> %pressure, <16 x half> %arg) #0 { |
| 65 | +entry: |
| 66 | + %fp = fpext <16 x half> %arg to <16 x float> |
| 67 | +; CHECK: br label %loop |
| 68 | + br label %loop |
| 69 | + |
| 70 | +loop: |
| 71 | + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] |
| 72 | + %res = phi <16 x float> [ zeroinitializer, %entry ], [ %res.next, %loop ] |
| 73 | + %i.next = add i32 %i, 1 |
| 74 | +; CHECK-XeHPG: fpext |
| 75 | +; CHECK-XeHPC: fpext |
| 76 | +; CHECK-Xe2-64: fpext |
| 77 | +; CHECK-Xe2-128: fpext |
| 78 | +; CHECK-Xe2-256-NOT: fpext |
| 79 | + %res.next = fadd <16 x float> %res, %fp |
| 80 | + %cmp = icmp ult i32 %i.next, 100 |
| 81 | + br i1 %cmp, label %loop, label %end |
| 82 | + |
| 83 | +end: |
| 84 | + ret <2048 x i32> %pressure |
| 85 | +} |
| 86 | + |
| 87 | +; CHECK-LABEL: @test4 |
| 88 | +define dllexport <4096 x i32> @test4(<4096 x i32> %pressure, <16 x half> %arg) #0 { |
| 89 | +entry: |
| 90 | + %fp = fpext <16 x half> %arg to <16 x float> |
| 91 | +; CHECK: br label %loop |
| 92 | + br label %loop |
| 93 | + |
| 94 | +loop: |
| 95 | + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] |
| 96 | + %res = phi <16 x float> [ zeroinitializer, %entry ], [ %res.next, %loop ] |
| 97 | + %i.next = add i32 %i, 1 |
| 98 | +; CHECK-XeHPG: fpext |
| 99 | +; CHECK-XeHPC: fpext |
| 100 | +; CHECK-Xe2-64: fpext |
| 101 | +; CHECK-Xe2-128: fpext |
| 102 | +; CHECK-Xe2-256: fpext |
| 103 | + %res.next = fadd <16 x float> %res, %fp |
| 104 | + %cmp = icmp ult i32 %i.next, 100 |
| 105 | + br i1 %cmp, label %loop, label %end |
| 106 | + |
| 107 | +end: |
| 108 | + ret <4096 x i32> %pressure |
| 109 | +} |
| 110 | + |
| 111 | +; COM: Register pressure is beyond threshold for all platforms |
| 112 | +; COM: Check that instructions smaller than a one register are not moved into the loop |
| 113 | +; CHECK-LABEL: @test5 |
| 114 | +define dllexport <4096 x i32> @test5(<4096 x i32> %pressure, <4 x half> %arg.4, <8 x half> %arg.8) #0 { |
| 115 | +entry: |
| 116 | + %fp.4 = fpext <4 x half> %arg.4 to <4 x float> |
| 117 | + %fp.8 = fpext <8 x half> %arg.8 to <8 x float> |
| 118 | +; CHECK: br label %loop |
| 119 | + br label %loop |
| 120 | + |
| 121 | +loop: |
| 122 | + %i = phi i32 [ 0, %entry ], [ %i.next, %loop ] |
| 123 | + %res.4 = phi <4 x float> [ zeroinitializer, %entry ], [ %res.next.4, %loop ] |
| 124 | + %res.8 = phi <8 x float> [ zeroinitializer, %entry ], [ %res.next.8, %loop ] |
| 125 | +; CHECK-XeHPG-NOT: fpext <4 x half> |
| 126 | +; CHECK-XeHPG: fpext <8 x half> |
| 127 | +; CHECK-XeHPC-NOT: fpext |
| 128 | +; CHECK-Xe2-64-NOT: fpext |
| 129 | +; CHECK-Xe2-128-NOT: fpext |
| 130 | +; CHECK-Xe2-256-NOT: fpext |
| 131 | + %res.next.4 = fadd <4 x float> %res.4, %fp.4 |
| 132 | + %res.next.8 = fadd <8 x float> %res.8, %fp.8 |
| 133 | + %i.next = add i32 %i, 1 |
| 134 | + %cmp = icmp ult i32 %i.next, 100 |
| 135 | + br i1 %cmp, label %loop, label %end |
| 136 | + |
| 137 | +end: |
| 138 | + ret <4096 x i32> %pressure |
| 139 | +} |
| 140 | + |
| 141 | +attributes #0 = { "CMGenxMain" } |
| 142 | + |
0 commit comments