File: ptr_size_crash.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 (41 lines) | stat: -rw-r--r-- 1,970 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
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2021-2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; COM: the test is actually a reduced example from dpcpp. the issue was
; COM: that we had a division by zero during an attempt to collapse a region
; COM: that have a pointers as an element type. This test is essentially checks
; COM: that we don't crash/trigger an assert
; RUN: %opt_typed_ptrs %use_old_pass_manager% -GenXRegionCollapsing -march=genx64 -mcpu=Gen9 -mtriple=spir64 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-TYPED-PTRS
; RUN: %opt_opaque_ptrs %use_old_pass_manager% -GenXRegionCollapsing -march=genx64 -mcpu=Gen9 -mtriple=spir64 -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-OPAQUE-PTRS

; CHECK: pluto
; CHECK-TYPED-PTRS-NEXT: call spir_func void @foo(%0 addrspace(4)* null, i64 undef)
; CHECK-OPAQUE-PTRS-NEXT: call spir_func void @foo(ptr addrspace(4) null, i64 undef)
; CHECK-NEXT: ret void

source_filename = "/test.ll"
target datalayout = "e-p:64:64-i64:64-n8:16:32:64"
target triple = "spir64"

%0 = type { [1 x i64] }
%1 = type { %0 }

declare dso_local spir_func void @foo(%0 addrspace(4)*, i64) unnamed_addr #0
declare %1 addrspace(4)* @"llvm.genx.rdregioni.if-you-going-to-san-francisco::id.i16"(<1 x %1 addrspace(4)*>, i32, i32, i32, i16, i32) #0

define internal spir_func void @pluto(%1 addrspace(4)* %arg) unnamed_addr #0 {
  %tmp = inttoptr <1 x i64> zeroinitializer to <1 x %1 addrspace(4)*>
  %tmp1 = call %1 addrspace(4)* @"llvm.genx.rdregioni.if-you-going-to-san-francisco::id.i16"(<1 x %1 addrspace(4)*> %tmp, i32 0, i32 1, i32 1, i16 0, i32 0)
  %tmp2 = bitcast %1 addrspace(4)* %tmp1 to %0 addrspace(4)*
  call spir_func void @foo(%0 addrspace(4)* %tmp2, i64 undef) #1
  ret void
}

attributes #0 = { "target-cpu"="Gen9" }
attributes #1 = { noinline nounwind optnone }