[all-commits] [llvm/llvm-project] 32ef4c: [InstrRef] Skip clobbered EntryValue register reco...

Shubham Sandeep Rastogi via All-commits all-commits at lists.llvm.org
Fri Jun 27 10:30:51 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 32ef4ceec03d6510ba19a098a2894a1caeb2704e
      https://github.com/llvm/llvm-project/commit/32ef4ceec03d6510ba19a098a2894a1caeb2704e
  Author: Shubham Sandeep Rastogi <srastogi22 at apple.com>
  Date:   2025-06-27 (Fri, 27 Jun 2025)

  Changed paths:
    M llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
    A llvm/test/DebugInfo/MIR/AArch64/entry_value_gets_propagated_aarch64.mir
    A llvm/test/DebugInfo/MIR/X86/entry_value_clobbered_stack_copy.mir
    A llvm/test/DebugInfo/MIR/X86/entry_value_gets_propagated_X86.mir

  Log Message:
  -----------
  [InstrRef] Skip clobbered EntryValue register recovery (#142478)

This changes the final stage of InstrRef, i.e. the TransferTracker
(which combines the values locations with the variable values), so that
it treats a DEBUG_VALUE of an EntryValue just like a DEBUG_VALUE of a
constant: a location that is never clobbered and can be propagated to
subsequent BBs as long as no other DEBUG_VALUE intrinsics updated the
variable.

We add two tests here:

1. `entry_value_clobbered_stack_copy` that saves a register on the
stack, uses this register as an entry value DBG_VALUE location, and then
clobbers it. Prior to this patch, this test would crash because we would
try to describe a new location for the variable in terms of what was
saved on the stack, and use an invalid expression to do so. This is not
needed as an EntryValue can never be clobbered.

2. `entry_value_gets_propagated`, that tests that an EntryValue
DBG_VALUE is propagated in a diamond-shaped CFG.

This patch is trying to reland
https://github.com/llvm/llvm-project/pull/77938 but also fixes the bug
with InstrRef based LiveDebugValues, where entry values were not being
propagated in a diamond-shaped CFG.



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