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

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Sun Sep 1 01:20:39 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: e1be8cf8723e8577abaeef586ec4c39f30053913
      https://github.com/llvm/llvm-project/commit/e1be8cf8723e8577abaeef586ec4c39f30053913
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2024-09-01 (Sun, 01 Sep 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

(cherry picked from commit f5815534d180c544bffd46f09c28b6fc334260fb)



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