-
Notifications
You must be signed in to change notification settings - Fork 791
[SYCL] Don't run SYCLOptimizeBarriersPass with O0 #20037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
b78605b
96a7a7a
1aeedf7
68a84f0
73266d4
71bdb3f
6347c9c
3496abb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,6 +12,7 @@ | |||||||||||||||||||||||
// CHECK: InferFunctionAttrsPass | ||||||||||||||||||||||||
// CHECK: AlwaysInlinerPass | ||||||||||||||||||||||||
// CHECK: ModuleInlinerWrapperPass | ||||||||||||||||||||||||
// CHECK: SYCLOptimizeBarriersPass | ||||||||||||||||||||||||
// CHECK: ConstantMergePass | ||||||||||||||||||||||||
// CHECK: SYCLMutatePrintfAddrspacePass | ||||||||||||||||||||||||
// CHECK: SYCLPropagateAspectsUsagePass | ||||||||||||||||||||||||
|
@@ -22,4 +23,17 @@ | |||||||||||||||||||||||
// | ||||||||||||||||||||||||
// RUN: %clang_cc1 -O2 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -fno-sycl-early-optimizations -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-NOEARLYOPT | ||||||||||||||||||||||||
// CHECK-NOEARLYOPT-NOT: ConstantMergePass1 | ||||||||||||||||||||||||
// CHECK-NOEARLYOPT-NOT: SYCLOptimizeBarriersPass | ||||||||||||||||||||||||
// CHECK-NOEARLYOPT: SYCLMutatePrintfAddrspacePass | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
// RUN: %clang_cc1 -O0 -fsycl-is-device -triple spir64-unknown-unknown %s -mdebug-pass Structure -emit-llvm -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-O0 | ||||||||||||||||||||||||
// CHECK-O0-NOT: SYCLOptimizeBarriersPass | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
template <typename name, typename Func> | ||||||||||||||||||||||||
void kernel(const Func &f) __attribute__((sycl_kernel)) { | ||||||||||||||||||||||||
f(); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
void bar() { | ||||||||||||||||||||||||
kernel<class MyKernel>([=]() {}); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
template <typename name, typename Func> | |
void kernel(const Func &f) __attribute__((sycl_kernel)) { | |
f(); | |
} | |
void bar() { | |
kernel<class MyKernel>([=]() {}); | |
} | |
// Some passes don't run on empty code | |
__attribute__((sycl_device)) void bar() { | |
} |
If a kernel is required please use https://github.com/intel/llvm/blob/sycl/sycl/doc/developer/ContributeToDPCPP.md#dpc-clang-fe-tests .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied. So passes registered via registerOptimizerLastEPCallback
are not being run fir the empty test. Passes registered like this are being run at the end of a normal pipeline via invokeOptimizerLastEPCallbacks
and ... I haven't yet finished with the debugging, but it seems like it's module-size sensitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently non-empty source code is required to make the pass run. @Fznamznon please comment if you are okay with this change or if I should separate the barrier case from this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is fine in this file, I don't really get why it happens.