[all-commits] [llvm/llvm-project] fbf627: Reapply (2) [BranchFolding] Kill common hoisted de...
Orlando Cazalet-Hyams via All-commits
all-commits at lists.llvm.org
Mon Jul 28 08:14:17 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fbf6271c7da20356d7b34583b3711b4126ca1dbb
https://github.com/llvm/llvm-project/commit/fbf6271c7da20356d7b34583b3711b4126ca1dbb
Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: 2025-07-28 (Mon, 28 Jul 2025)
Changed paths:
M llvm/lib/CodeGen/BranchFolding.cpp
A llvm/test/DebugInfo/X86/branch-folder-dbg-after-end.mir
M llvm/test/DebugInfo/X86/branch-folder-dbg.mir
Log Message:
-----------
Reapply (2) [BranchFolding] Kill common hoisted debug instructions (#149999)
Reapply #140091.
branch-folder hoists common instructions from TBB and FBB into their
pred. Without this patch it achieves this by splicing the instructions from TBB
and deleting the common ones in FBB. That moves the debug locations and debug
instructions from TBB into the pred without modification, which is not
ideal. Debug locations are handled in #140063.
This patch handles debug instructions - in the simplest way possible, which is
to just kill (undef) them. We kill and hoist the ones in FBB as well as TBB
because otherwise the fact there's an assignment on the code path is deleted
(which might lead to a prior location extending further than it should).
There's possibly something we could do to preserve some variable locations in
some cases, but this is the easiest not-incorrect thing to do.
Note I had to replace the constant DBG_VALUEs to use registers in the test- it
turns out setDebugValueUndef doesn't undef constant DBG_VALUEs... which feels
wrong to me, but isn't something I want to touch right now.
---
Fix end-iterator-dereference and add test.
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