[all-commits] [llvm/llvm-project] 76f49f: [DFAJumpThreading] Propagate DebugLocs to branches...

Stephen Tozer via All-commits all-commits at lists.llvm.org
Wed Jul 8 03:53:21 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76f49f834e057c028a9f42fddca7e3f522e1dda1
      https://github.com/llvm/llvm-project/commit/76f49f834e057c028a9f42fddca7e3f522e1dda1
  Author: Stephen Tozer <stephen.tozer at sony.com>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
    A llvm/test/Transforms/DFAJumpThreading/br-debuglocs.ll
    A llvm/test/Transforms/DFAJumpThreading/br-debuglocs2.ll

  Log Message:
  -----------
  [DFAJumpThreading] Propagate DebugLocs to branches in select unfolding (#205851)

When DFAJumpThreading replaces a select with control flow, it generates
new blocks, new branches in those blocks, and potentially replaces the
branch in an existing block. Prior to this patch, none of these branches
were assigned debug locations; this patch replaces them as follows:

For the case where we generate two new blocks between the select block
and use block, and use a PHI of those blocks to replace the select, we
use the select's debug location for the branch instructions, since they
are doing the work of the select.

For the case where we generate one new block and replace the
unconditional branch from the select block with a conditional branch to
the new block and the use block, we treat the new branches as replacing
both the select and the original branch, so each branch takes the merged
location of the original select+br.

This patch also ensures that when we create a new path which would end
with a switch statement, such that the switch statement can be safely
replaced with an unconditional branch, we propagate the switch's debug
location to the replacing unconditional branch.



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