|
| 1 | +; |
| 2 | +; Copyright (C) 2025 Intel Corporation |
| 3 | +; |
| 4 | +; This software and the related documents are Intel copyrighted materials, |
| 5 | +; and your use of them is governed by the express license under which they were |
| 6 | +; provided to you ("License"). Unless the License provides otherwise, |
| 7 | +; you may not use, modify, copy, publish, distribute, disclose or transmit this |
| 8 | +; software or the related documents without Intel's prior written permission. |
| 9 | +; |
| 10 | +; This software and the related documents are provided as is, with no express or |
| 11 | +; implied warranties, other than those that are expressly stated in the License. |
| 12 | +; |
| 13 | +;============================ end_copyright_notice ============================= |
| 14 | +; REQUIRES: llvm-14-plus, regkeys |
| 15 | +; RUN: igc_opt --opaque-pointers --igc-code-sinking --regkey CodeSinkingMinSize=1 -S %s | FileCheck %s |
| 16 | + |
| 17 | +;CHECK-LABEL: entry: |
| 18 | +;CHECK-NOT: @llvm.genx.GenISA.DCL.inputVec.f32 |
| 19 | +;CHECK-LABEL: loop: |
| 20 | +;CHECK-NEXT: [[IN1:%.*]] = phi float [ 0.000000e+00, %preheader ], [ [[IN0:%.*]], %loop ] |
| 21 | +;CHECK: [[IN0]] = call float @llvm.genx.GenISA.DCL.inputVec.f32(i32 0, i32 2) |
| 22 | +;CHECK: br i1 [[CMP:%.*]], label %loop, label %afterloop |
| 23 | + |
| 24 | +define float @foo(i32 %count) { |
| 25 | + |
| 26 | +entry: |
| 27 | + %input = call float @llvm.genx.GenISA.DCL.inputVec.f32(i32 0, i32 2) |
| 28 | + br label %preheader |
| 29 | + |
| 30 | +preheader: |
| 31 | + br label %loop |
| 32 | + |
| 33 | +loop: |
| 34 | + %input1 = phi float [ 0.000000e+00, %preheader ], [ %input, %loop ] |
| 35 | + %index = phi i32 [ 0, %preheader ], [ %inc, %loop ] |
| 36 | + %cmptmp = icmp ult i32 %index, %count |
| 37 | + %inc = add i32 %index, 1 |
| 38 | + br i1 %cmptmp, label %loop, label %afterloop |
| 39 | + |
| 40 | +afterloop: |
| 41 | + %res = fadd float %input1, %input |
| 42 | + ret float %res |
| 43 | +} |
| 44 | + |
| 45 | +declare float @llvm.genx.GenISA.DCL.inputVec.f32(i32, i32) #1 |
| 46 | + |
| 47 | +attributes #1 = { nounwind readnone willreturn } |
| 48 | + |
| 49 | +!igc.functions = !{} |
| 50 | + |
0 commit comments