|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2025 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; REQUIRES: regkeys |
| 10 | +; UNSUPPORTED: system-windows |
| 11 | +; Test that for platforms PVC (and newer) with abort on spill we correctly guess SIMD16 as SIMD size and based on it calculate correct register pressure. |
| 12 | +; For estimate of SIMD32 register pressure wiuld be 16 and rematerialization would be done. |
| 13 | + |
| 14 | +; RUN: igc_opt -platformlnl --typed-pointers %s -S -o - -igc-clone-address-arithmetic --regkey=RematChainLimit=10 --regkey=RematFlowThreshold=100 --regkey=RematRPELimit=10 --dce | FileCheck %s |
| 15 | + |
| 16 | +; CHECK-NOT: remat |
| 17 | +define spir_kernel void @main(double addrspace(1)* %base, i64 %offset, i64 %I, i64 %J) { |
| 18 | + |
| 19 | + %baseArith = ptrtoint double addrspace(1)* %base to i64 |
| 20 | + %basePtr = mul nuw nsw i64 %offset, 207368 |
| 21 | + %offsetI = mul nsw i64 %I, 1288 |
| 22 | + %offsetJ = shl nsw i64 %J, 3 |
| 23 | + |
| 24 | + %a0 = add i64 %baseArith, 100780848 |
| 25 | + %a1 = add i64 %a0, %basePtr |
| 26 | + %a2 = add i64 %a1, %offsetI |
| 27 | + %a3 = add i64 %a2, %offsetJ |
| 28 | + %a4 = inttoptr i64 %a3 to double addrspace(1)* |
| 29 | + %r0 = load double, double addrspace(1)* %a4, align 8 |
| 30 | + |
| 31 | + %rr0 = fmul double %r0, 2.0 |
| 32 | + |
| 33 | + store double %rr0, double addrspace(1)* %a4 |
| 34 | + ret void |
| 35 | +} |
| 36 | + |
| 37 | + |
| 38 | +define spir_func void @bar(double addrspace(1)* %base, i64 %offset, i64 %I, i64 %J) { |
| 39 | + %baseArith = ptrtoint double addrspace(1)* %base to i64 |
| 40 | + %basePtr = mul nuw nsw i64 %offset, 207368 |
| 41 | + %offsetI = mul nsw i64 %I, 1288 |
| 42 | + %offsetJ = shl nsw i64 %J, 3 |
| 43 | + |
| 44 | + %a0 = add i64 %baseArith, 100780848 |
| 45 | + %a1 = add i64 %a0, %basePtr |
| 46 | + %a2 = add i64 %a1, %offsetI |
| 47 | + %a3 = add i64 %a2, %offsetJ |
| 48 | + %a4 = inttoptr i64 %a3 to double addrspace(1)* |
| 49 | + %a5 = inttoptr i64 %a3 to i64 addrspace(1)* |
| 50 | + %r0 = load double, double addrspace(1)* %a4, align 8 |
| 51 | + |
| 52 | + %rr0 = fmul double %r0, 2.0 |
| 53 | + |
| 54 | + %cast_a5 = bitcast i64 addrspace(1)* %a5 to double addrspace(1)* |
| 55 | + store double %rr0, double addrspace(1)* %cast_a5 |
| 56 | + ret void |
| 57 | +} |
0 commit comments