[all-commits] [llvm/llvm-project] f1cc0b: [IR] Introduce `dead_on_return` attribute
Antonio Frighetto via All-commits
all-commits at lists.llvm.org
Wed Jul 2 00:33:14 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f1cc0b607b03548028db3ca57bb057b2599b1711
https://github.com/llvm/llvm-project/commit/f1cc0b607b03548028db3ca57bb057b2599b1711
Author: Antonio Frighetto <me at antoniofrighetto.com>
Date: 2025-07-02 (Wed, 02 Jul 2025)
Changed paths:
M llvm/docs/LangRef.rst
M llvm/include/llvm/Bitcode/LLVMBitCodes.h
M llvm/include/llvm/IR/Argument.h
M llvm/include/llvm/IR/Attributes.td
M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm/lib/IR/Attributes.cpp
M llvm/lib/IR/Function.cpp
M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
M llvm/lib/Transforms/Utils/CodeExtractor.cpp
M llvm/test/Bitcode/attributes.ll
M llvm/test/Transforms/DeadStoreElimination/simple.ll
A llvm/test/Verifier/dead-on-return.ll
Log Message:
-----------
[IR] Introduce `dead_on_return` attribute
Add `dead_on_return` attribute, which is meant to be taken advantage
by the frontend, and states that the memory pointed to by the argument
is dead upon function return. As with `byval`, it is supposed to be
used for passing aggregates by value. The difference lies in the ABI:
`byval` implies that the pointer is explicitly passed as argument to
the callee (during codegen the copy is emitted as per byval contract),
whereas a `dead_on_return`-marked argument implies that the copy
already exists in the IR, is located at a specific stack offset within
the caller, and this memory will not be read further by the caller upon
callee return – or otherwise poison, if read before being written.
RFC: https://discourse.llvm.org/t/rfc-add-dead-on-return-attribute/86871.
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