-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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] Propagate debug location to OMPIRBuilder reduction codegen #100358
Conversation
…odegen This patch propagates the debug location from Clang to the OpenMPIRBuilder. Fixes llvm#97428
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Jan Leyonberg (jsjodin) ChangesThis patch propagates the debug location from Clang to the OpenMPIRBuilder. Fixes #97428 Full diff: https://github.com/llvm/llvm-project/pull/100358.diff 1 Files Affected:
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
index fb71b27de9cd0..835662e6cd0a3 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
@@ -1652,6 +1652,7 @@ static llvm::Value *castValueToType(CodeGenFunction &CGF, llvm::Value *Val,
/// Finally, a call is made to '__kmpc_nvptx_parallel_reduce_nowait_v2' to
/// reduce across workers and compute a globally reduced value.
///
+
void CGOpenMPRuntimeGPU::emitReduction(
CodeGenFunction &CGF, SourceLocation Loc, ArrayRef<const Expr *> Privates,
ArrayRef<const Expr *> LHSExprs, ArrayRef<const Expr *> RHSExprs,
@@ -1694,7 +1695,8 @@ void CGOpenMPRuntimeGPU::emitReduction(
CGF.AllocaInsertPt->getIterator());
InsertPointTy CodeGenIP(CGF.Builder.GetInsertBlock(),
CGF.Builder.GetInsertPoint());
- llvm::OpenMPIRBuilder::LocationDescription OmpLoc(CodeGenIP);
+ llvm::OpenMPIRBuilder::LocationDescription OmpLoc(
+ CodeGenIP, CGF.SourceLocToDebugLoc(Loc));
llvm::SmallVector<llvm::OpenMPIRBuilder::ReductionInfo> ReductionInfos;
CodeGenFunction::OMPPrivateScope Scope(CGF);
|
Is that the right issue? |
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.
Remove added line
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 for the fix. LGTM.
I've also added some changes in #100364 which should fix some other places where debug info was being incorrectly propagated.
…odegen (llvm#100358) This patch propagates the debug location from Clang to the OpenMPIRBuilder. Fixes llvm#97458 (cherry picked from commit 5b15d9c)
…odegen (#100358) Summary: This patch propagates the debug location from Clang to the OpenMPIRBuilder. Fixes #97458 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250701
This patch propagates the debug location from Clang to the OpenMPIRBuilder.
Fixes #97458