[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
bader added a comment. @echuraev, please, request commit access as described here: http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access Repository: rL LLVM https://reviews.llvm.org/D27403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
This revision was automatically updated to reflect the committed changes. Closed by commit rL288891: [OpenCL] Added a LIT test for ensuring address space mangling is done the sameā¦ (authored by bader). Changed prior to commit: https://reviews.llvm.org/D27403?vs=80401=80549#toc Repository: rL LLVM https://reviews.llvm.org/D27403 Files: cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl Index: cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl === --- cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl +++ cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,30 +1,44 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. __attribute__((overloadable)) void ff(int *arg) { } // ASMANG: @_Z2ffPi // NOASMANG: @_Z2ffPi +// OCL-20-DAG: @_Z2ffPU3AS4i +// OCL-12-DAG: @_Z2ffPi __attribute__((overloadable)) void f(private int *arg) { } // ASMANG: @_Z1fPi // NOASMANG: @_Z1fPi +// OCL-20-DAG: @_Z1fPi +// OCL-12-DAG: @_Z1fPi __attribute__((overloadable)) void f(global int *arg) { } // ASMANG: @_Z1fPU3AS1i // NOASMANG: @_Z1fPU8CLglobali +// OCL-20-DAG: @_Z1fPU3AS1i +// OCL-12-DAG: @_Z1fPU3AS1i __attribute__((overloadable)) void f(local int *arg) { } // ASMANG: @_Z1fPU3AS2i // NOASMANG: @_Z1fPU7CLlocali +// OCL-20-DAG: @_Z1fPU3AS2i +// OCL-12-DAG: @_Z1fPU3AS2i __attribute__((overloadable)) void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti +// OCL-20-DAG: @_Z1fPU3AS3i +// OCL-12-DAG: @_Z1fPU3AS3i Index: cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl === --- cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl +++ cfe/trunk/test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,30 +1,44 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. __attribute__((overloadable)) void ff(int *arg) { } // ASMANG: @_Z2ffPi // NOASMANG: @_Z2ffPi +// OCL-20-DAG: @_Z2ffPU3AS4i +// OCL-12-DAG: @_Z2ffPi __attribute__((overloadable)) void f(private int *arg) { } // ASMANG: @_Z1fPi // NOASMANG: @_Z1fPi +// OCL-20-DAG: @_Z1fPi +// OCL-12-DAG: @_Z1fPi __attribute__((overloadable)) void f(global int *arg) { } // ASMANG: @_Z1fPU3AS1i // NOASMANG: @_Z1fPU8CLglobali +// OCL-20-DAG: @_Z1fPU3AS1i +// OCL-12-DAG: @_Z1fPU3AS1i __attribute__((overloadable)) void f(local int *arg) { } // ASMANG: @_Z1fPU3AS2i // NOASMANG: @_Z1fPU7CLlocali +// OCL-20-DAG: @_Z1fPU3AS2i +// OCL-12-DAG: @_Z1fPU3AS2i __attribute__((overloadable)) void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti +// OCL-20-DAG: @_Z1fPU3AS3i +// OCL-12-DAG: @_Z1fPU3AS3i ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks! https://reviews.llvm.org/D27403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
echuraev updated this revision to Diff 80401. echuraev marked an inline comment as done. https://reviews.llvm.org/D27403 Files: test/CodeGenOpenCL/address-spaces-mangling.cl Index: test/CodeGenOpenCL/address-spaces-mangling.cl === --- test/CodeGenOpenCL/address-spaces-mangling.cl +++ test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,30 +1,44 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. __attribute__((overloadable)) void ff(int *arg) { } // ASMANG: @_Z2ffPi // NOASMANG: @_Z2ffPi +// OCL-20-DAG: @_Z2ffPU3AS4i +// OCL-12-DAG: @_Z2ffPi __attribute__((overloadable)) void f(private int *arg) { } // ASMANG: @_Z1fPi // NOASMANG: @_Z1fPi +// OCL-20-DAG: @_Z1fPi +// OCL-12-DAG: @_Z1fPi __attribute__((overloadable)) void f(global int *arg) { } // ASMANG: @_Z1fPU3AS1i // NOASMANG: @_Z1fPU8CLglobali +// OCL-20-DAG: @_Z1fPU3AS1i +// OCL-12-DAG: @_Z1fPU3AS1i __attribute__((overloadable)) void f(local int *arg) { } // ASMANG: @_Z1fPU3AS2i // NOASMANG: @_Z1fPU7CLlocali +// OCL-20-DAG: @_Z1fPU3AS2i +// OCL-12-DAG: @_Z1fPU3AS2i __attribute__((overloadable)) void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti +// OCL-20-DAG: @_Z1fPU3AS3i +// OCL-12-DAG: @_Z1fPU3AS3i Index: test/CodeGenOpenCL/address-spaces-mangling.cl === --- test/CodeGenOpenCL/address-spaces-mangling.cl +++ test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,30 +1,44 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL-20 %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL-12 %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. __attribute__((overloadable)) void ff(int *arg) { } // ASMANG: @_Z2ffPi // NOASMANG: @_Z2ffPi +// OCL-20-DAG: @_Z2ffPU3AS4i +// OCL-12-DAG: @_Z2ffPi __attribute__((overloadable)) void f(private int *arg) { } // ASMANG: @_Z1fPi // NOASMANG: @_Z1fPi +// OCL-20-DAG: @_Z1fPi +// OCL-12-DAG: @_Z1fPi __attribute__((overloadable)) void f(global int *arg) { } // ASMANG: @_Z1fPU3AS1i // NOASMANG: @_Z1fPU8CLglobali +// OCL-20-DAG: @_Z1fPU3AS1i +// OCL-12-DAG: @_Z1fPU3AS1i __attribute__((overloadable)) void f(local int *arg) { } // ASMANG: @_Z1fPU3AS2i // NOASMANG: @_Z1fPU7CLlocali +// OCL-20-DAG: @_Z1fPU3AS2i +// OCL-12-DAG: @_Z1fPU3AS2i __attribute__((overloadable)) void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti +// OCL-20-DAG: @_Z1fPU3AS3i +// OCL-12-DAG: @_Z1fPU3AS3i ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
Anastasia added inline comments. Comment at: test/CodeGenOpenCL/address-spaces-mangling.cl:36 + +__attribute__((overloadable)) void foo(private char *); +__attribute__((overloadable)) void foo(global char *); Just trying to understand what we are missing in the current testing. Does the additional code test something different from the previous one? Could we reuse the old test but just run it with the other OpenCL versions? Also do we have any different behavior in the mangler depending on OpenCL versions? https://reviews.llvm.org/D27403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D27403: [OpenCL] Added a LIT test for ensuring address space mangling is done the same both in OpenCL1.2 and OpenCL2.0.
echuraev created this revision. echuraev added a reviewer: Anastasia. echuraev added subscribers: bader, cfe-commits, yaxunl. https://reviews.llvm.org/D27403 Files: test/CodeGenOpenCL/address-spaces-mangling.cl Index: test/CodeGenOpenCL/address-spaces-mangling.cl === --- test/CodeGenOpenCL/address-spaces-mangling.cl +++ test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,6 +1,10 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. @@ -28,3 +32,20 @@ void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti + +__attribute__((overloadable)) void foo(private char *); +__attribute__((overloadable)) void foo(global char *); +__attribute__((overloadable)) void foo(constant char *); +__attribute__((overloadable)) void foo(local char *); + +void bar(global char *gp, constant char *cp, local char *lp) { + private char* pp; + // OCL: call spir_func void @_Z3fooPc + foo(pp); + // OCL: call spir_func void @_Z3fooPU3AS1c + foo(gp); + // OCL: call spir_func void @_Z3fooPU3AS2c + foo(cp); + // OCL: call spir_func void @_Z3fooPU3AS3c + foo(lp); +} Index: test/CodeGenOpenCL/address-spaces-mangling.cl === --- test/CodeGenOpenCL/address-spaces-mangling.cl +++ test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,6 +1,10 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s // RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// We check that the address spaces are mangled the same in both version of OpenCL +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL2.0 -emit-llvm -o - | FileCheck -check-prefix=OCL %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=CL1.2 -emit-llvm -o - | FileCheck -check-prefix=OCL %s + // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition // warnings, but we do want it for comparison purposes. @@ -28,3 +32,20 @@ void f(constant int *arg) { } // ASMANG: @_Z1fPU3AS3i // NOASMANG: @_Z1fPU10CLconstanti + +__attribute__((overloadable)) void foo(private char *); +__attribute__((overloadable)) void foo(global char *); +__attribute__((overloadable)) void foo(constant char *); +__attribute__((overloadable)) void foo(local char *); + +void bar(global char *gp, constant char *cp, local char *lp) { + private char* pp; + // OCL: call spir_func void @_Z3fooPc + foo(pp); + // OCL: call spir_func void @_Z3fooPU3AS1c + foo(gp); + // OCL: call spir_func void @_Z3fooPU3AS2c + foo(cp); + // OCL: call spir_func void @_Z3fooPU3AS3c + foo(lp); +} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits