[all-commits] [llvm/llvm-project] 54d544: [KeyInstr][Clang] Ret atom (#134652)

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Wed Jun 4 07:44:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54d544b83141dc0b20727673f68793728ed54793
      https://github.com/llvm/llvm-project/commit/54d544b83141dc0b20727673f68793728ed54793
  Author: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
  Date:   2025-06-04 (Wed, 04 Jun 2025)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGStmt.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/test/DebugInfo/KeyInstructions/agg.c
    M clang/test/DebugInfo/KeyInstructions/assign-scalar.c
    M clang/test/DebugInfo/KeyInstructions/bitfield.cpp
    M clang/test/DebugInfo/KeyInstructions/builtin.c
    M clang/test/DebugInfo/KeyInstructions/cast.c
    M clang/test/DebugInfo/KeyInstructions/coerced-packed.c
    M clang/test/DebugInfo/KeyInstructions/coerced-ptr.c
    M clang/test/DebugInfo/KeyInstructions/coerced-through-memory.c
    M clang/test/DebugInfo/KeyInstructions/coerced.c
    M clang/test/DebugInfo/KeyInstructions/complex.c
    M clang/test/DebugInfo/KeyInstructions/do.c
    M clang/test/DebugInfo/KeyInstructions/for.c
    M clang/test/DebugInfo/KeyInstructions/if.c
    M clang/test/DebugInfo/KeyInstructions/init-agg.c
    M clang/test/DebugInfo/KeyInstructions/init-member.cpp
    M clang/test/DebugInfo/KeyInstructions/init-scalar.c
    M clang/test/DebugInfo/KeyInstructions/init-static.cpp
    M clang/test/DebugInfo/KeyInstructions/multi-func.c
    M clang/test/DebugInfo/KeyInstructions/new.cpp
    A clang/test/DebugInfo/KeyInstructions/return-va-arg.c
    A clang/test/DebugInfo/KeyInstructions/return.c
    M clang/test/DebugInfo/KeyInstructions/switch.c
    M clang/test/DebugInfo/KeyInstructions/try-catch.cpp
    M clang/test/DebugInfo/KeyInstructions/while.c

  Log Message:
  -----------
  [KeyInstr][Clang] Ret atom (#134652)

This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

When returning a value, stores to the `retval` allocas and branches to `return`
block are put in the same atom group. They are both rank 1, which could in
theory introduce an extra step in some optimized code. This low risk currently
feels an acceptable for keeping the code a bit simpler (as opposed to adding
scaffolding to make the store rank 2).

In the case of a single return (no control flow) the return instruction inherits
the atom group of the branch to the return block when the blocks get folded
togather.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.



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