File: basic.ll

package info (click to toggle)
intel-graphics-compiler2 2.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,644 kB
  • sloc: cpp: 805,640; lisp: 287,672; ansic: 16,414; python: 3,952; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (43 lines) | stat: -rw-r--r-- 1,495 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2022-2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; REQUIRES: llvm-14-plus
; RUN: igc_opt --opaque-pointers -ClampICBOOBAccess  -S < %s 2>&1 | FileCheck %s

; Test checks that ICB index is clamped

define void @test_clamp(i32 %src) {
; CHECK-LABEL: @test_clamp(
; CHECK:    [[TMP1:%.*]] = call float @llvm.genx.GenISA.RuntimeValue.f32(i32 16)
; CHECK:    [[TMP2:%.*]] = bitcast float [[TMP1]] to i32
; CHECK:    [[TMP3:%.*]] = inttoptr i32 [[TMP2]] to ptr
; CHECK:    [[TMP4:%.*]] = icmp uge i32 [[SRC:%.*]], 3
; CHECK:    [[TMP5:%.*]] = select i1 [[TMP4]], i32 0, i32 [[SRC]]
; CHECK:    [[TMP6:%.*]] = getelementptr [3 x i32], ptr [[TMP3]], i32 0, i32 [[TMP5]]
; CHECK:    [[TMP7:%.*]] = load i32, ptr [[TMP6]]
; CHECK:    [[TMP8:%.*]] = add i32 [[TMP7]], [[SRC]]
; CHECK:    call void @use.i32(i32 [[TMP8]])
; CHECK:    ret void
;
  %1 = call float @llvm.genx.GenISA.RuntimeValue.f32(i32 16)
  %2 = bitcast float %1 to i32
  %3 = inttoptr i32 %2 to ptr
  %4 = getelementptr [3 x i32], ptr %3, i32 0, i32 %src
  %5 = load i32, ptr %4
  %6 = add i32 %5, %src
  call void @use.i32(i32 %6)
  ret void
}

declare void @use.i32(i32)
declare float @llvm.genx.GenISA.RuntimeValue.f32(i32)

!IGCMetadata = !{!0}
!0 = !{!"ModuleMD", !1}
!1 = !{!"pushInfo", !2}
!2 = !{!"inlineConstantBufferOffset", i32 16}