[all-commits] [llvm/llvm-project] 877c39: [OpenMPIRBuilder] Handle empty blocks in restoreIP...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Mon Aug 3 08:05:29 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 877c39aa8e15abe05c4c9562743d49b29689f2ce
      https://github.com/llvm/llvm-project/commit/877c39aa8e15abe05c4c9562743d49b29689f2ce
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    A mlir/test/Target/LLVMIR/openmp-target-in-reduction-debug.mlir

  Log Message:
  -----------
  [OpenMPIRBuilder] Handle empty blocks in restoreIPandDebugLoc (#212535)

`restoreIPandDebugLoc` previously only recovered a debug location when
the insertion block was non-empty, using its last instruction. For an
empty block it left the current debug location unchanged so instructions
emitted afterwards could have wrong debug location.

This PR enhance `restoreIPandDebugLoc` to also handle the empty-block
case: when the insertion point is at the end of an empty block,
synthesize a location scoped to the parent function's subprogram
provided the function has debug metadata.

This helps us get a valid debug location when we switch to `CodeGenIP`
in `emitOffloadingArrays` even when `CodeGenIP` is pointing to an empty
`BB`.

Fixes https://github.com/llvm/llvm-project/issues/212488

Co-authored-by: Cursor <cursoragent at cursor.com>



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