File: alloca_skip_unreachable.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 (66 lines) | stat: -rw-r--r-- 2,108 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2025 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; REQUIRES: regkeys
; RUN: igc_opt --typed-pointers --igc-private-mem-resolution -S %s | FileCheck %s
; ------------------------------------------------
; PrivateMemoryResolution
; ------------------------------------------------

; Checks if allocas uses that are in unreachable basic blocks are
; skipped, when looking for common dominator.

define spir_kernel void @test_skip( i32 %src, i32 %bufferOffset, i32 %bufferOffset1) #0 {
; CHECK-LABEL: @test_skip(
; CHECK:  entry:
; CHECK:    [[PRIVATEBUFFER:%.*]] = bitcast i8* {{%.*}} to i32*
; CHECK:    store i32 %src, i32* [[PRIVATEBUFFER]], align 4
; CHECK:    [[LOAD1:%.*]] = load i32, i32* [[PRIVATEBUFFER]], align 4
entry:
  %0 = alloca i32, align 4
  store i32 %src, i32* %0, align 4
  %1 = load i32, i32* %0, align 4
  br label %end

unused:                         ; No predecessors!
; CHECK:  unused:
; CHECK:    store i32 %src, i32* [[PRIVATEBUFFER]], align 4
; CHECK:    [[LOAD2:%.*]] = load i32, i32* [[PRIVATEBUFFER]], align 4
  store i32 %src, i32* %0, align 4
  %2 = load i32, i32* %0, align 4
  unreachable

end:
  ret void
}

attributes #0 = { convergent noinline nounwind optnone "less-precise-fpmad"="true" }

!IGCMetadata = !{!3}
!igc.functions = !{!17}

!3 = !{!"ModuleMD", !4, !7, !13, !10}
!4 = !{!"compOpt", !5, !6}
!5 = !{!"OptDisable", i1 true}
!6 = !{!"UseScratchSpacePrivateMemory", i1 true}
!7 = !{!"FuncMD", !11, !12}
!10 = !{!"privateMemoryPerWI", i32 0}
!11 = !{!"FuncMDMap[0]", void (i32, i32, i32)* @test_skip}
!12 = !{!"FuncMDValue[0]", !10}
!13 = !{!"MinNOSPushConstantSize", i32 0}
!17 = !{void (i32, i32, i32)* @test_skip, !18}
!18 = !{!19, !20}
!19 = !{!"function_type", i32 1}
!20 = !{!"implicit_arg_desc", !24, !26}
!21 = !{i32 0}
!22 = !{i32 1}
!23 = !{i32 12}
!24 = !{i32 14, !25}
!25 = !{!"explicit_arg_num", i32 0}
!26 = !{i32 14, !27}
!27 = !{!"explicit_arg_num", i32 1}