[all-commits] [llvm/llvm-project] f58155: [RemoveDIs] Simplify spliceDebugInfo, fixing splic...

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Wed Aug 28 06:20:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5815534d180c544bffd46f09c28b6fc334260fb
      https://github.com/llvm/llvm-project/commit/f5815534d180c544bffd46f09c28b6fc334260fb
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2024-08-28 (Wed, 28 Aug 2024)

  Changed paths:
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/unittests/IR/BasicBlockDbgInfoTest.cpp

  Log Message:
  -----------
  [RemoveDIs] Simplify spliceDebugInfo, fixing splice-to-end edge case (#105670)

Not quite NFC, fixes splitBasicBlockBefore case when we split before an
instruction with debug records (but without the headBit set, i.e., we are
splitting before the instruction but after the debug records that come before
it). splitBasicBlockBefore splices the instructions before the split point into
a new block. Prior to this patch, the debug records would get shifted up to the
front of the spliced instructions (as seen in the modified unittest - I believe
the unittest was checking erroneous behaviour). We instead want to leave those
debug records at the end of the spliced instructions.

The functionality of the deleted `else if` branch is covered by the remaining
`if` now that `DestMarker` is set to the trailing marker if `Dest` is `end()`.
Previously the "===" markers were sometimes detached, now we always detach
them and always reattach them.

Note: `deleteTrailingDbgRecords` only "unlinks" the tailing marker from the
block, it doesn't delete anything. The trailing marker is still cleaned up
properly inside the final `if` body with `DestMarker->eraseFromParent();`.

Part 1 of 2 needed for #105571



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