File: issue87856.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (61 lines) | stat: -rw-r--r-- 2,406 bytes parent folder | download | duplicates (3)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 4
; RUN: opt -S -passes=attributor < %s | FileCheck %s

define void @null_ptr_is_valid_call_with_null() #0 {
; CHECK-LABEL: define void @null_ptr_is_valid_call_with_null(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:    call void @store_as0(ptr noalias nofree noundef writeonly null) #[[ATTR4:[0-9]+]]
; CHECK-NEXT:    ret void
;
  call void @store_as0(ptr null)
  ret void
}

define void @null_ptr_is_valid_call_with_undef() #0 {
; CHECK-LABEL: define void @null_ptr_is_valid_call_with_undef(
; CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT:    call void @store_as0(ptr undef) #[[ATTR4]]
; CHECK-NEXT:    ret void
;
  call void @store_as0(ptr undef)
  ret void
}

define void @store_as0(ptr %0) {
; CHECK-LABEL: define void @store_as0(
; CHECK-SAME: ptr nofree noundef nonnull writeonly align 2 captures(none) dereferenceable(2) [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] {
; CHECK-NEXT:    store i16 0, ptr [[TMP0]], align 2
; CHECK-NEXT:    ret void
;
  store i16 0, ptr %0, align 2
  ret void
}

define void @call_store_as1() {
; CHECK-LABEL: define void @call_store_as1(
; CHECK-SAME: ) #[[ATTR3:[0-9]+]] {
; CHECK-NEXT:    call void @store_as1(ptr addrspace(1) nofree noundef writeonly captures(none) null) #[[ATTR4]]
; CHECK-NEXT:    ret void
;
  call void @store_as1(ptr addrspace(1) null)
  ret void
}

define void @store_as1(ptr addrspace(1) %arg) {
; CHECK-LABEL: define void @store_as1(
; CHECK-SAME: ptr addrspace(1) nofree noundef writeonly align 2 captures(none) dereferenceable_or_null(2) [[ARG:%.*]]) #[[ATTR2]] {
; CHECK-NEXT:    store i16 0, ptr addrspace(1) [[ARG]], align 2
; CHECK-NEXT:    ret void
;
  store i16 0, ptr addrspace(1) %arg, align 2
  ret void
}

attributes #0 = { null_pointer_is_valid }
;.
; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(write) }
; CHECK: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind null_pointer_is_valid willreturn memory(none) }
; CHECK: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CHECK: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CHECK: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn memory(write) }
;.