[llvm] [mlir] Reland [OMPIRBuilder] Don't use invalid debug loc in reduction fn. (PR #211566)

Spencer Bryngelson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 07:51:20 PDT 2026


sbryngelson wrote:

Verified this on `d1d3891077f6`. It covers the barrier case that my narrower PR missed, and it applies cleanly.

| suite | result |
|---|---|
| check-flang | 4608 passed, 11 expected failures, 0 failures |
| clang/test/OpenMP | 1573 passed |
| mlir/test/Target/LLVMIR | 407 passed |
| LLVMFrontendTests | 1281 passed |

One thing worth knowing: the end-to-end symptom no longer reproduces at tip. Unpatched, the reproducer from #211385 now builds clean at `-O2 -g` and `-O3 -g`. The bad IR is still there, though; `_omp_reduction_shuffle_and_reduce_func` and `_omp_reduction_inter_warp_copy_func` carry 61 and 48 `!dbg` scoped to the kernel's subprogram. So the failure is latent rather than fixed, and a test at the IR level like yours is the right guard.

I have a flang integration test that checks the same thing through the Fortran driver (`flang/test/Integration/OpenMP/target-reduction-debug-loc.f90`). Your MLIR test covers the bug, so take it only if you want driver-level coverage as well; otherwise ignore this.

I will close #211395 in favor of this.

https://github.com/llvm/llvm-project/pull/211566


More information about the llvm-commits mailing list