File: aa-points-to-constant-memory.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (112 lines) | stat: -rw-r--r-- 3,276 bytes parent folder | download | duplicates (9)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -amdgpu-aa-wrapper -amdgpu-aa -instcombine -o - %s | FileCheck %s
;
; Test AA::pointsToConstantMemory implementation. These should mostly
; turn out to be stores to constant memory, and will therefore be
; deleted as UB.

define void @test_constant_addrspace(i8 addrspace(4)* %p) {
; CHECK-LABEL: @test_constant_addrspace(
; CHECK-NEXT:    ret void
;
  store i8 0, i8 addrspace(4)* %p
  ret void
}

define void @test_constant32bit_addrspace(i8 addrspace(6)* %p) {
; CHECK-LABEL: @test_constant32bit_addrspace(
; CHECK-NEXT:    ret void
;
  store i8 0, i8 addrspace(6)* %p
  ret void
}

define void @test_cast_generic_from_constant_addrspace(i8 addrspace(4)* %p) {
; CHECK-LABEL: @test_cast_generic_from_constant_addrspace(
; CHECK-NEXT:    ret void
;
  %cast = addrspacecast i8 addrspace(4)* %p to i8*
  store i8 0, i8* %cast
  ret void
}

define void @test_cast_generic_from_constant32bit_addrspace(i8 addrspace(6)* %p) {
; CHECK-LABEL: @test_cast_generic_from_constant32bit_addrspace(
; CHECK-NEXT:    ret void
;
  %cast = addrspacecast i8 addrspace(6)* %p to i8*
  store i8 0, i8* %cast
  ret void
}

define void @test_cast_generic_to_constant_addrspace(i8* %p) {
; CHECK-LABEL: @test_cast_generic_to_constant_addrspace(
; CHECK-NEXT:    ret void
;
  %cast = addrspacecast i8* %p to i8 addrspace(4)*
  store i8 0, i8 addrspace(4)* %cast
  ret void
}

define void @test_cast_generic_to_constant32bit_addrspace(i8* %p) {
; CHECK-LABEL: @test_cast_generic_to_constant32bit_addrspace(
; CHECK-NEXT:    ret void
;
  %cast = addrspacecast i8* %p to i8 addrspace(6)*
  store i8 0, i8 addrspace(6)* %cast
  ret void
}

define amdgpu_kernel void @noalias_readnone_global_kernarg(i32 addrspace(1)* noalias readnone %arg) {
; CHECK-LABEL: @noalias_readnone_global_kernarg(
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(1)* %arg
  ret void
}

define amdgpu_kernel void @noalias_readonly_global_kernarg(i32 addrspace(1)* noalias readonly %arg) {
; CHECK-LABEL: @noalias_readonly_global_kernarg(
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(1)* %arg
  ret void
}

define amdgpu_kernel void @readnone_global_kernarg(i32 addrspace(1)* readnone %arg) {
; CHECK-LABEL: @readnone_global_kernarg(
; CHECK-NEXT:    store i32 0, i32 addrspace(1)* [[ARG:%.*]], align 4
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(1)* %arg
  ret void
}

define amdgpu_kernel void @readonly_global_kernarg(i32 addrspace(1)* readonly %arg) {
; CHECK-LABEL: @readonly_global_kernarg(
; CHECK-NEXT:    store i32 0, i32 addrspace(1)* [[ARG:%.*]], align 4
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(1)* %arg
  ret void
}

@global_as_constant = external addrspace(1) constant i32, align 4

define amdgpu_kernel void @constant_gv_global_as() {
; CHECK-LABEL: @constant_gv_global_as(
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(1)* @global_as_constant
  ret void
}

@global_nonconstant_constant_as = external addrspace(4) global i32, align 4

define amdgpu_kernel void @nonconst_gv_constant_as() {
; CHECK-LABEL: @nonconst_gv_constant_as(
; CHECK-NEXT:    ret void
;
  store i32 0, i32 addrspace(4)* @global_nonconstant_constant_as
  ret void
}