File: volatile.ll

package info (click to toggle)
intel-graphics-compiler 1.0.17791.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 102,312 kB
  • sloc: cpp: 935,343; lisp: 286,143; ansic: 16,196; python: 3,279; yacc: 2,487; lex: 1,642; pascal: 300; sh: 174; makefile: 27
file content (45 lines) | stat: -rw-r--r-- 2,405 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt %use_old_pass_manager% -GenXVerify -genx-verify-terminate=no \
; RUN: -genx-verify-all-fatal=1 -march=genx64 -mtriple=spir64-unknown-unknown \
; RUN: -mcpu=Gen9 -genx-verify-stage=post-ir-adaptors -S < %s 2>&1 | FileCheck \
; RUN: --check-prefixes=CHECK %s

target datalayout = "e-p:64:64-p6:32:32-i64:64-n8:16:32:64"
target triple = "genx64-unknown-unknown"

; CHECK: warning: {{.+}} <@SLMGV = addrspace(3) {{.+}}>: a volatile variable must reside in private address space
@SLMGV = addrspace(3) global <2 x i8> undef #0

; CHECK: warning: {{.+}} @GV {{.+}} a volatile variable may only be used in genx.vload/genx.vstore intrinsics and volatile loads/stores instructions
@GV = global <16 x i32> zeroinitializer, align 64 #1
@ALIAS = global <16 x i32> addrspace(1)* addrspacecast (<16 x i32>* @GV to <16 x i32> addrspace(1)*)

@INVALID = global <16 x float> zeroinitializer, align 64 #2
@VALID = global <16 x float> zeroinitializer, align 64 #3

define internal spir_func void @foo() {
  ; CHECK: warning: {{.+}} %cst = {{.+}} a volatile variable may only be used in genx.vload/genx.vstore intrinsics and volatile loads/stores instructions
  %cst = addrspacecast <16 x float>* @INVALID to <16 x float> addrspace(4)*

  ; CHECK-NOT: warning
  %ld.ic = tail call <16 x float> @llvm.genx.vload.v16f32.p0v16f32(<16 x float>* @VALID)
  call void @llvm.genx.vstore.v16f32.p0v16f32(<16 x float> %ld.ic, <16 x float>* @VALID)
  %ld.inst = load volatile <16 x float>, <16 x float>* @VALID
  store volatile <16 x float> %ld.inst, <16 x float>* @VALID
  ret void
}

declare <16 x float> @llvm.genx.vload.v16f32.p0v16f32(<16 x float>*)
declare void @llvm.genx.vstore.v16f32.p0v16f32(<16 x float>, <16 x float>*)

attributes #0 = { "VCByteOffset"="0" "VCGlobalVariable" "VCVolatile" "genx_byte_offset"="0" "genx_volatile" }
attributes #1 = { "VCByteOffset"="256" "VCGlobalVariable" "VCVolatile" "genx_byte_offset"="256" "genx_volatile" }
attributes #2 = { "VCByteOffset"="512" "VCGlobalVariable" "VCVolatile" "genx_byte_offset"="512" "genx_volatile" }
attributes #3 = { "VCByteOffset"="1024" "VCGlobalVariable" "VCVolatile" "genx_byte_offset"="1024" "genx_volatile" }