File: memory-attr.ispc

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (19 lines) | stat: -rw-r--r-- 955 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %{ispc} --target=host %s -o - --emit-llvm-text | FileCheck %s
// RUN: %{ispc} --target=host --debug-phase=2:2 %s -o t.o | FileCheck %s --check-prefix=CHECK-DECL

// Before LLVM 16.0, the memory attribute was displayed as readonly, readnone
// not as memory(read), memory(none).

// CHECK: ; Function Attrs: {{.*}} memory(none)
// CHECK-LABEL: define {{.*}} @foo___univyi{{.*}}
// CHECK: ; Function Attrs: {{.*}} memory(argmem: read)
// CHECK-LABEL: define i32 @bar___un_3C_uni_3E_{{.*}}
__attribute__((memory("none"))) int foo(uniform int x, int y) { return y; }
__attribute__((memory("read"))) uniform int bar(uniform int *uniform p) { return *p; }

// CHECK-DECL: ; Function Attrs: nounwind memory(read)
// CHECK-DECL-LABEL: declare void @func1{{.*}}
// CHECK-DECL: ; Function Attrs: nounwind memory(none)
// CHECK-DECL-LABEL: declare void @func2{{.*}}
__attribute__((memory("read"))) void func1();
__attribute__((memory("none"))) void func2();