-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] Recover necessary AddrSpaceCast #119246
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 all commits
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -target-cpu gfx906 -fopenmp -nogpulib -fopenmp-is-target-device -emit-llvm %s -o - | FileCheck %s | ||
|
||
// Don't crash with assertions build. | ||
|
||
// CHECK: @MyGlobVar = external thread_local addrspace(1) global i32, align 4 | ||
// CHECK: define weak_odr hidden noundef ptr @_ZTW9MyGlobVar() #0 comdat { | ||
// CHECK-NEXT: %1 = call align 4 ptr addrspace(1) @llvm.threadlocal.address.p1(ptr addrspace(1) align 4 @MyGlobVar) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we support this intrinsic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (For AMDGPU codegen) Doesn't seem so to me. The intrinsic was added in 9701053 |
||
// CHECK-NEXT: %2 = addrspacecast ptr addrspace(1) %1 to ptr | ||
// CHECK-NEXT: ret ptr %2 | ||
// CHECK-NEXT: } | ||
int MyGlobVar; | ||
#pragma omp threadprivate(MyGlobVar) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not crash for sure, but I wonder is this a valid use of OpenMP? I don't know what I should expect from this semantics. |
||
int main() { | ||
MyGlobVar = 1; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.