-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][NewPM] Add SYCLLowerWGLocalMemory pass into optimization (#5301)
Add `SYCLLowerWGLocalMemory` pass into clang optimizations pipeline when using new Pass Manager. Signed-off-by: Mikhail Lychkov <mikhail.lychkov@intel.com>
- Loading branch information
Showing
4 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Check that SYCLLowerWGLocalMemory pass is added to the SYCL device | ||
// compilation pipeline with the inliner pass. | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm \ | ||
// RUN: -flegacy-pass-manager -mllvm -debug-pass=Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefixes=CHECK-INL,CHECK | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -O0 \ | ||
// RUN: -flegacy-pass-manager -mllvm -debug-pass=Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
|
||
// Check that AlwaysInliner pass is always run for compilation of SYCL device | ||
// target code, even if all optimizations are disabled. | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -disable-llvm-passes \ | ||
// RUN: -flegacy-pass-manager -mllvm -debug-pass=Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -fno-sycl-early-optimizations \ | ||
// RUN: -flegacy-pass-manager -mllvm -debug-pass=Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
|
||
// CHECK-INL: Function Integration/Inlining | ||
// CHECK-ALWINL: Inliner for always_inline functions | ||
// CHECK: Replace __sycl_allocateLocalMemory with allocation of memory in local address space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
// Check that SYCLLowerWGLocalMemory pass is added to the SYCL device | ||
// compilation pipeline with the inliner pass. | ||
// compilation pipeline with the inliner pass (new Pass Manager). | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm \ | ||
// RUN: -mllvm -debug-pass=Structure %s -o - 2>&1 \ | ||
// RUN: | FileCheck %s | ||
// CHECK: Function Integration/Inlining | ||
// CHECK: Replace __sycl_allocateLocalMemory with allocation of memory in local address space | ||
// RUN: -fno-legacy-pass-manager -mdebug-pass Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s -check-prefixes=CHECK-INL,CHECK | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -O0 \ | ||
// RUN: -fno-legacy-pass-manager -mdebug-pass Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
|
||
// Check that AlwaysInliner pass is always run for compilation of SYCL device | ||
// target code, even if all optimizations are disabled. | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm \ | ||
// RUN: -mllvm -debug-pass=Structure %s -o - -disable-llvm-passes 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CHECK-NOPASSES | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm \ | ||
// RUN: -mllvm -debug-pass=Structure %s -o - -fno-sycl-early-optimizations 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CHECK-NOPASSES | ||
// CHECK-NOPASSES: Inliner for always_inline functions | ||
// CHECK-NOPASSES: Replace __sycl_allocateLocalMemory with allocation of memory in local address space | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -disable-llvm-passes \ | ||
// RUN: -fno-legacy-pass-manager -mdebug-pass Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm -fno-sycl-early-optimizations \ | ||
// RUN: -fno-legacy-pass-manager -mdebug-pass Structure %s -o /dev/null 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefixes=CHECK-ALWINL,CHECK | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -triple spir64-unknown-unknown -emit-llvm \ | ||
// RUN: -mllvm -debug-pass=Structure %s -o - -O0 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CHECK-O0opt | ||
// CHECK-O0opt: Inliner for always_inline functions | ||
// CHECK-O0opt: Replace __sycl_allocateLocalMemory with allocation of memory in local address space | ||
// CHECK-INL: Running pass: ModuleInlinerWrapperPass on [module] | ||
// CHECK-ALWINL: Running pass: AlwaysInlinerPass on [module] | ||
// CHECK: Running pass: SYCLLowerWGLocalMemoryPass on [module] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters