mirror-llvm-project/mlir
1sgtpepper 8518c74b5e
[mlir][llvm] Preserve function entry count metadata (#204707)
Fixes #202374.

Preserve LLVM function `!prof` metadata for:
- `synthetic_function_entry_count`
- `function_entry_count` with import GUID operands

The importer represents the entry count, count kind, and trailing import
GUID operands in a single `#llvm.function_entry_count` attribute,
validates malformed operands before mutating the operation, and exports
the metadata through `llvm::Function::setEntryCount`.

Tests cover import, export, malformed metadata operands, synthetic
counts, synthetic counts with trailing operands, import GUID
round-tripping, and raw i64 bit-pattern preservation.

Checks:
- `git diff --check`
- `git clang-format --diff origin/main -- ...`
- `llvm-as -disable-output` smoke check

Codex was used in making this PR.
2026-07-14 15:12:33 +02:00
..
benchmark/python
cmake/modules [MLIR] Normalize path separator in MLIRConfig.cmake (#208659) 2026-07-13 12:52:37 +00:00
docs [NFC][mlir][nvvm] move OptimizeForNVVM to its own directory (#206520) 2026-06-29 22:17:29 +00:00
examples [mlir][python] Set a static version in the standalone example pyproject.toml (#207860) 2026-07-06 16:26:54 -07:00
include [mlir][llvm] Preserve function entry count metadata (#204707) 2026-07-14 15:12:33 +02:00
lib [mlir][llvm] Preserve function entry count metadata (#204707) 2026-07-14 15:12:33 +02:00
python [MLIR][Python] Add ConditionallySpeculatable interface and Pure specifier (#195505) 2026-05-05 11:22:33 +08:00
test [mlir][llvm] Preserve function entry count metadata (#204707) 2026-07-14 15:12:33 +02:00
tools [MLIR] Install missing standalone helper tools (#205066) 2026-07-13 09:33:38 +01:00
unittests [mlir][acc] Fix leaks in cg unit tests (#209339) 2026-07-14 00:02:05 +00:00
utils [docs] Register MLIR lexer for Sphinx docs (#206194) 2026-06-30 11:46:53 -07:00
.clang-format Enforce Unix line endings for Clang/LLVM/MLIR projects (#161460) 2025-10-02 06:09:12 -07:00
.clang-tidy [MLIR][NFC] Ignore clang-tidy modernize-use-using check in C code (#180326) 2026-02-09 13:24:08 +08:00
CMakeLists.txt [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
LICENSE.TXT
Maintainers.md [mlir][x86] Move AMX dialect into X86 dialect (#183717) 2026-03-02 11:47:30 +01:00
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.