[all-commits] [llvm/llvm-project] 7b91df: [OMPIRBuilder] Don't use invalid debug loc in redu...
Abid Qadeer via All-commits
all-commits at lists.llvm.org
Fri Jul 11 01:50:32 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7b91df386820aaf84b30c09d48fba110a42bdc56
https://github.com/llvm/llvm-project/commit/7b91df386820aaf84b30c09d48fba110a42bdc56
Author: Abid Qadeer <haqadeer at amd.com>
Date: 2025-07-11 (Fri, 11 Jul 2025)
Changed paths:
M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
A mlir/test/Target/LLVMIR/omptarget-debug-reduc-fn-loc.mlir
Log Message:
-----------
[OMPIRBuilder] Don't use invalid debug loc in reduction functions. (#147950)
We have this pattern of code in OMPIRBuilder for many functions that are
used in reduction operations.
```
Function *LtGRFunc = Function::Create
BasicBlock *EntryBlock = BasicBlock::Create(Ctx, "entry", LtGRFunc);
Builder.SetInsertPoint(EntryBlock);
```
The insertion point is moved to the new function but the debug location is not updated. This means that reduction function will use the debug location that points to another function. This problem gets hidden because these functions gets inlined but the potential for failure exists.
This patch resets the debug location when insertion point is moved to new function. Some `InsertPointGuard` have been added to make sure why restore the debug location correctly when we are done with the reduction function.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list