File: vector_of_pointers.ll

package info (click to toggle)
intel-graphics-compiler2 2.22.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 107,676 kB
  • sloc: cpp: 809,645; lisp: 288,070; ansic: 16,397; python: 4,010; yacc: 2,588; lex: 1,666; pascal: 314; sh: 186; makefile: 38
file content (49 lines) | stat: -rw-r--r-- 3,465 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
44
45
46
47
48
49
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2021-2025 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt_typed_ptrs %use_old_pass_manager% -CMABILegacy -march=genx64 -mcpu=XeHPG -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-TYPED-PTRS
; RUN: %opt_opaque_ptrs %use_old_pass_manager% -CMABILegacy -march=genx64 -mcpu=XeHPG -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-OPAQUE-PTRS

; RUN: %opt_new_pm_typed -passes=CMABI -march=genx64 -mcpu=XeHPG -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-TYPED-PTRS
; RUN: %opt_new_pm_opaque -passes=CMABI -march=genx64 -mcpu=XeHPG -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-OPAQUE-PTRS

target datalayout = "e-p:64:64-i64:64-n8:16:32"

@table = internal constant [210 x i32] zeroinitializer
; COM: @table should be mentioned only once. Global DCE will remove it.
; CHECK: @table
; CHECK-NOT: @table

declare <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*>, i32 immarg, <8 x i1>, <8 x float>)
declare void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float>, <8 x float*>, i32 immarg, <8 x i1>)

; Function Attrs: noinline nounwind
define dllexport void @simple_case(<8 x i64> %offsets) {
; CHECK: %[[SIMPLE_ALLOCA:[^ ]+]] = alloca [210 x i32]
; CHECK-TYPED-PTRS-NEXT: store [210 x i32] zeroinitializer, [210 x i32]* %[[SIMPLE_ALLOCA]]
; CHECK-OPAQUE-PTRS-NEXT: store [210 x i32] zeroinitializer, ptr %[[SIMPLE_ALLOCA]]
  %gep = getelementptr [210 x i32], [210 x i32]* @table, <8 x i64> zeroinitializer, <8 x i64> %offsets
; CHECK-TYPED-PTRS-NEXT: %gep = getelementptr [210 x i32], [210 x i32]* %[[SIMPLE_ALLOCA]], <8 x i64> zeroinitializer, <8 x i64> %offsets
; CHECK-OPAQUE-PTRS-NEXT: %gep = getelementptr [210 x i32], ptr %[[SIMPLE_ALLOCA]], <8 x i64> zeroinitializer, <8 x i64> %offsets
  %bc = bitcast <8 x i32*> %gep to <8 x float*>
; CHECK-TYPED-PTRS-NEXT: %bc = bitcast <8 x i32*> %gep to <8 x float*>
; CHECK-OPAQUE-PTRS-NEXT: %bc = bitcast <8 x ptr> %gep to <8 x ptr>
  %val = call <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x float> undef)
; CHECK-TYPED-PTRS-NEXT: %val = call <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x float> undef)
; CHECK-OPAQUE-PTRS-NEXT: %val = call <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x float> undef)
  call void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float> %val, <8 x float*> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>)
; CHECK-TYPED-PTRS-NEXT: call void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float> %val, <8 x float*> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>)
; CHECK-OPAQUE-PTRS-NEXT: call void @llvm.masked.scatter.v8f32.v8p0(<8 x float> %val, <8 x ptr> %bc, i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>)
  %user = fadd <8 x float> %val, zeroinitializer
; CHECK-NEXT: %user = fadd <8 x float> %val, zeroinitializer
; CHECK-NOT: @table
  ret void
}

!genx.kernels = !{!0}
!0 = !{void (<8 x i64>)* @simple_case}