-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Fix Lambda Mangling in Namespace-Scope Variable Initializers. #159115
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
Draft
zahiraam
wants to merge
10
commits into
llvm:main
Choose a base branch
from
zahiraam:FixLambdaMangling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b197e92
Fix Lambda Mangling in Namespace-Scope Variable Initializers.
zahiraam a5292c2
Addressed review comments.
zahiraam b70972c
Fix LIT tests again
zahiraam ea29248
Added new line
zahiraam 1b279d8
Added new line
zahiraam 80ca41f
Fix CodeGenSYCL LIT tests.
zahiraam b9a581a
Added a new line for clarity
zahiraam 8fb0464
Fix format
zahiraam c96de5a
Fix LIT tests (after Tom's solution)
zahiraam 7de57f2
Add C++ LIT test
zahiraam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,40 @@ | ||
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \ | ||
// RUN: -aux-triple nvptx64-nvidia-cuda -fcuda-is-device \ | ||
// RUN: -x cuda -emit-llvm %s -o - | FileCheck %s --check-prefix=DEVICE | ||
|
||
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu \ | ||
// RUN: -aux-triple nvptx64-nvidia-cuda \ | ||
// RUN: -x cuda -emit-llvm %s -o - | FileCheck %s --check-prefix=HOST | ||
|
||
int cudaConfigureCall(int, int, decltype(sizeof(int)) = 0, void* = nullptr); | ||
zahiraam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
namespace QL { | ||
auto dg1 = [] { return 1; }; | ||
} | ||
namespace QL { | ||
auto dg2 = [] { return 2; }; | ||
} | ||
using namespace QL; | ||
template<typename T> | ||
__attribute__((global)) void f(T t) { | ||
zahiraam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
t(); | ||
} | ||
void g() { | ||
f<<<1,1>>>(dg1); | ||
f<<<1,1>>>(dg2); | ||
} | ||
|
||
// HOST: @_ZN2QL3dg1E = internal global %class.anon undef, align 1 | ||
// HOST: @_ZN2QL3dg2E = internal global %class.anon.0 undef, align 1 | ||
|
||
// DEVICE: define void @_Z1fIN2QL3dg1MUlvE_EEvT_ | ||
// DEVICE: call noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// DEVICE: define internal noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// DEVICE: define void @_Z1fIN2QL3dg2MUlvE_EEvT_ | ||
// DEVICE: call noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
// DEVICE: define internal noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
|
||
// HOST: define dso_local void @_Z1gv | ||
// HOST: call void @_Z16__device_stub__fIN2QL3dg1MUlvE_EEvT_ | ||
// HOST: call void @_Z16__device_stub__fIN2QL3dg2MUlvE_EEvT_ | ||
// HOST: define internal void @_Z16__device_stub__fIN2QL3dg1MUlvE_EEvT_ | ||
// HOST: define internal void @_Z16__device_stub__fIN2QL3dg2MUlvE_EEvT_ | ||
zahiraam marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,49 @@ | ||
// RUN: %clang_cc1 -fsycl-is-device -O0 -triple spirv64-unknown-unknown \ | ||
// RUN: -emit-llvm %s -o - | FileCheck %s --check-prefix=DEVICE | ||
|
||
// RUN: %clang_cc1 -fsycl-is-host -O0 -triple spirv64-unknown-unknown \ | ||
// RUN: -emit-llvm %s -o - | FileCheck %s --check-prefix=HOST | ||
|
||
// RUN: %clang_cc1 -fsycl-is-device -emit-llvm \ | ||
// RUN: -aux-triple x86_64-pc-windows-msvc -triple spir-unknown--unknown \ | ||
// RUN: %s -o - | FileCheck %s --check-prefix=MSVC | ||
|
||
namespace QL { | ||
auto dg1 = [] { return 1; }; | ||
} | ||
namespace QL { | ||
auto dg2 = [] { return 2; }; | ||
} | ||
using namespace QL; | ||
template<typename T> | ||
[[clang::sycl_kernel_entry_point(T)]] void f(T t) { | ||
t(); | ||
} | ||
void g() { | ||
f(dg1); | ||
f(dg2); | ||
} | ||
zahiraam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// HOST: @_ZN2QL3dg1E = internal global %class.anon undef, align 1 | ||
// HOST: @_ZN2QL3dg2E = internal global %class.anon.0 undef, align 1 | ||
|
||
// DEVICE: define spir_kernel void @_ZTSN2QL3dg1MUlvE_E | ||
// DEVICE: call spir_func noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// DEVICE: define internal spir_func noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// DEVICE: define spir_kernel void @_ZTSN2QL3dg2MUlvE_E | ||
// DEVICE: call spir_func noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
// DEVICE: define internal spir_func noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
|
||
// HOST: define spir_func void @_Z1gv | ||
// HOST: call spir_func void @_Z1fIN2QL3dg1MUlvE_EEvT_ | ||
// HOST: call spir_func void @_Z1fIN2QL3dg2MUlvE_EEvT_ | ||
// HOST: define internal spir_func void @_Z1fIN2QL3dg1MUlvE_EEvT | ||
zahiraam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// HOST: define internal spir_func void @_Z1fIN2QL3dg2MUlvE_EEvT_ | ||
|
||
// MSVC: define dso_local spir_kernel void @_ZTSN2QL3dg1MUlvE_E | ||
// MSVC: call spir_func noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// MSVC: define internal spir_func noundef i32 @_ZNK2QL3dg1MUlvE_clEv | ||
// MSVC: define dso_local spir_kernel void @_ZTSN2QL3dg2MUlvE_E | ||
// MSVC: call spir_func noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
// MSVC: define internal spir_func noundef i32 @_ZNK2QL3dg2MUlvE_clEv | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.