File: mem2reg.cl

package info (click to toggle)
spirv-llvm-translator-14 14.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,640 kB
  • sloc: cpp: 47,664; lisp: 3,704; sh: 153; python: 43; makefile: 33
file content (12 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
// RUN: %clang_cc1 -O0 -S -triple spir-unknown-unknown -cl-std=CL2.0 -x cl -disable-O0-optnone %s -emit-llvm-bc -o %t.bc
// RUN: llvm-spirv -s %t.bc
// RUN: llvm-dis < %t.bc | FileCheck %s --check-prefixes=CHECK-WO
// RUN: llvm-spirv -s -spirv-mem2reg %t.bc -o %t.opt.bc
// RUN: llvm-dis < %t.opt.bc | FileCheck %s --check-prefixes=CHECK-W
// CHECK-W-LABEL: spir_func void @foo
// CHECK-W-NOT: alloca i32
// CHECK-WO-LABEL: spir_kernel void @foo
// CHECK-WO: alloca i32
__kernel void foo(__global int *a) {
    *a = *a + 1;
}