-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[Clang][OpenMP] Clang adding the addrSpace according to DataLayout fix #65483
Conversation
@@ -3362,6 +3362,8 @@ Address CGOpenMPRuntimeGPU::getAddressOfLocalVariable(CodeGenFunction &CGF, | |||
break; | |||
case OMPAllocateDeclAttr::OMPLargeCapMemAlloc: | |||
case OMPAllocateDeclAttr::OMPCGroupMemAlloc: | |||
if (VD->hasGlobalStorage()) | |||
AS = getLangASFromTargetAS(CGF.CGM.getModule().getDataLayout().getDefaultGlobalsAddressSpace()); |
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.
This function is only for globals, so we don't need to check VD after all.
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 removed the global variable check
Tests? |
@alexey-bataev sorry for the delay - the test is up |
#pragma omp target uses_allocators(omp_large_cap_mem_alloc) allocate(omp_large_cap_mem_alloc: x) firstprivate(x) map(from: device_result) | ||
{ | ||
for (int i = 0; i < N; i++) { | ||
for (int j = 0; j < N; j++) { | ||
x += j + i; | ||
} | ||
} | ||
device_result = x; | ||
} |
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.
Could you simplify the test? We need just an empty target region, everything else can be dropped
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.
Take a look now. Is that reduced enough?
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.
LG
The title isn't a proper commit subject, the tense/mood doesn't make sense |
@@ -3362,6 +3362,7 @@ Address CGOpenMPRuntimeGPU::getAddressOfLocalVariable(CodeGenFunction &CGF, | |||
break; | |||
case OMPAllocateDeclAttr::OMPLargeCapMemAlloc: | |||
case OMPAllocateDeclAttr::OMPCGroupMemAlloc: | |||
AS = getLangASFromTargetAS(CGF.CGM.getModule().getDataLayout().getDefaultGlobalsAddressSpace()); |
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.
This line is way too long compared to the 80 char line limit
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.
ah I see, what would be the best way to update that line? Push a commit or create another PR?
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.
Running clang-format on your commit (but just your commit, and only accepting changes to the lines you've changed, i.e. just this line) to fix this doesn't need pre-commit review
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.
thanks I updated it
I believe this broke one of the AMDGPU OpenMP buildbots https://lab.llvm.org/staging/#/builders/247/builds/6351 |
This change seems to have broken quite a few build bots including: https://lab.llvm.org/buildbot/#/builders/216/builds/27184 Could you please take a look and revert if you need time to investigate? |
Yes I can |
We also started seeing a test failure after this commit:
|
@gulfemsavrun I reverted the commit and am currently trying to fix the issue. |
llvm#65483) Fix for an issue where clang was not adding the address space according to the data layout, instead was using the default which resulted in a crash at times. The fix includes changes to the cases of LargeCapMemAlloc and CGroupMemAlloc where we are setting the AddrSpace according to the DataLayout.
…ayout fix (llvm#65483)" This reverts commit e831a32.
Fix for an issue where clang was not adding the address space according to the data layout, instead was using the default which resulted in a crash at times. The fix includes changes to the cases of LargeCapMemAlloc and CGroupMemAlloc where we are setting the AddrSpace according to the DataLayout.