[all-commits] [llvm/llvm-project] 22e902: [IR] Introduce captures attribute (#116990)
Nikita Popov via All-commits
all-commits at lists.llvm.org
Mon Jan 13 05:40:48 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 22e9024c9f374c0c740647829050c289673dbb11
https://github.com/llvm/llvm-project/commit/22e9024c9f374c0c740647829050c289673dbb11
Author: Nikita Popov <npopov at redhat.com>
Date: 2025-01-13 (Mon, 13 Jan 2025)
Changed paths:
M llvm/docs/LangRef.rst
M llvm/include/llvm/AsmParser/LLParser.h
M llvm/include/llvm/AsmParser/LLToken.h
M llvm/include/llvm/Bitcode/LLVMBitCodes.h
M llvm/include/llvm/IR/Attributes.h
M llvm/include/llvm/IR/Attributes.td
M llvm/include/llvm/Support/ModRef.h
M llvm/lib/AsmParser/LLLexer.cpp
M llvm/lib/AsmParser/LLParser.cpp
M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
M llvm/lib/IR/AttributeImpl.h
M llvm/lib/IR/Attributes.cpp
M llvm/lib/Support/ModRef.cpp
M llvm/lib/Transforms/Utils/CodeExtractor.cpp
A llvm/test/Assembler/captures-errors.ll
A llvm/test/Assembler/captures.ll
M llvm/test/Bitcode/attributes.ll
M llvm/unittests/IR/AttributesTest.cpp
Log Message:
-----------
[IR] Introduce captures attribute (#116990)
This introduces the `captures` attribute as described in:
https://discourse.llvm.org/t/rfc-improvements-to-capture-tracking/81420
This initial patch only introduces the IR/bitcode support for the
attribute and its in-memory representation as `CaptureInfo`. This will
be followed by a patch to upgrade and remove the `nocapture` attribute,
and then by actual inference/analysis support.
Based on the RFC feedback, I've used a syntax similar to the `memory`
attribute, though the only "location" that can be specified is `ret`.
I've added some pretty extensive documentation to LangRef on the
semantics. One non-obvious bit here is that using ptrtoint will not
result in a "return-only" capture, even if the ptrtoint result is only
used in the return value. Without this requirement we wouldn't be able
to continue ordinary capture analysis on the return value.
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