File: negative-index.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 (39 lines) | stat: -rw-r--r-- 1,285 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; REQUIRES: llvm-14-plus
; RUN: igc_opt --opaque-pointers -igc-priv-mem-to-reg -S < %s 2>&1 | FileCheck %s
; ------------------------------------------------
; LowerGEPForPrivMem
; ------------------------------------------------

define float @test(i64 %b) {
; CHECK-LABEL: @test(
; CHECK:    [[TMP1:%.*]] = alloca <12 x float>
; CHECK:    [[TMP2:%.*]] = trunc i64 %b to i32
; CHECK:    [[TMP3:%.*]] = add i32 0, [[TMP2]]
; CHECK:    [[TMP4:%.*]] = mul i32 [[TMP3]], 1
; CHECK:    [[TMP5:%.*]] = add i32 [[TMP4]], 0
; CHECK:    [[TMP6:%.*]] = add i32 -1, [[TMP5]]
; CHECK:    [[TMP7:%.*]] = load <12 x float>, ptr [[TMP1]]
; CHECK:    [[TMP8:%.*]] = extractelement <12 x float> [[TMP7]], i32 [[TMP6]]
; CHECK:    ret float [[TMP8]]

  %a = alloca [12 x float], align 4
  %1 = getelementptr [12 x float], ptr %a, i64 0, i64 %b
  %2 = getelementptr float, ptr %1, i64 -1
  %3 = load float, ptr %2, align 4
  ret float %3
}

!igc.functions = !{!0}

!0 = !{ptr @test, !1}
!1 = !{!2, !3}
!2 = !{!"function_type", i32 0}
!3 = !{!"implicit_arg_desc"}