diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 77ba81c58c5d63f7e5e054d9503e882afd3ae468..c4727a0c267d3ecb5a3a5495945ce417d5adc38a 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -115,6 +115,10 @@ clang/test/AST/Interp/ @tbaederr
/mlir/**/LLVMIR/**/BasicPtxBuilderInterface* @grypp
/mlir/**/NVVM*/ @grypp
+# MLIR Python Bindings
+/mlir/test/python/ @makslevental @stellaraccident
+/mlir/python/ @makslevental @stellaraccident
+
# BOLT
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
@@ -125,3 +129,6 @@ clang/test/AST/Interp/ @tbaederr
/llvm/**/TextAPI/ @cyndyishida
/clang/**/InstallAPI/ @cyndyishida
/clang/tools/clang-installapi/ @cyndyishida
+
+# ExtractAPI
+/clang/**/ExtractAPI @daniel-grumberg
diff --git a/.github/workflows/email-check.yaml b/.github/workflows/email-check.yaml
index ac53b5e527b0949020e0e73d90def5d2b6295cd0..8f32d020975f5d70e7eead9c34a0ea86fb836e81 100644
--- a/.github/workflows/email-check.yaml
+++ b/.github/workflows/email-check.yaml
@@ -1,7 +1,7 @@
name: "Check for private emails used in PRs"
on:
- pull_request_target:
+ pull_request:
types:
- opened
@@ -10,8 +10,6 @@ permissions:
jobs:
validate_email:
- permissions:
- pull-requests: write
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:
@@ -25,20 +23,24 @@ jobs:
run: |
git log -1
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
+ # Create empty comment file
+ echo "[]" > comments
- name: Validate author email
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
- uses: actions/github-script@v6
env:
- EMAIL: ${{ steps.author.outputs.EMAIL }}
+ COMMENT: >-
+ ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
+ Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
+ See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
+ run: |
+ cat << EOF > comments
+ [{"body" : "$COMMENT"}]
+ EOF
+
+ - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
+ if: always()
with:
- script: |
- const { EMAIL } = process.env
- await github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: `⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
- Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
- See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
- `})
+ name: workflow-args
+ path: |
+ comments
diff --git a/.github/workflows/issue-write.yml b/.github/workflows/issue-write.yml
index 02a5f7c213e898d32d5e5f4d3d42db11df7359c7..e003be006c4e15405bd977e277b0f9a64e69d2af 100644
--- a/.github/workflows/issue-write.yml
+++ b/.github/workflows/issue-write.yml
@@ -2,7 +2,9 @@ name: Comment on an issue
on:
workflow_run:
- workflows: ["Check code formatting"]
+ workflows:
+ - "Check code formatting"
+ - "Check for private emails used in PRs"
types:
- completed
@@ -31,7 +33,7 @@ jobs:
script: |
var fs = require('fs');
const comments = JSON.parse(fs.readFileSync('./comments'));
- if (!comments) {
+ if (!comments || comments.length == 0) {
return;
}
@@ -77,6 +79,15 @@ jobs:
}
const gql_result = await github.graphql(gql_query, gql_variables);
console.log(gql_result);
+ // If the branch for the PR was deleted before this job has a chance
+ // to run, then the ref will be null. This can happen if someone:
+ // 1. Rebase the PR, which triggers some workflow.
+ // 2. Immediately merges the PR and deletes the branch.
+ // 3. The workflow finishes and triggers this job.
+ if (!gql_result.repository.ref) {
+ console.log("Ref has been deleted");
+ return;
+ }
console.log(gql_result.repository.ref.associatedPullRequests.nodes);
var pr_number = 0;
diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index 4a881ef5ff56af432500413950890ee8d6563dbc..1e9367732e591118445fef2c69acf3339c2cbf5d 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -38,11 +38,11 @@ env:
# LLVM POST-BRANCH bump version
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
- LLVM_HEAD_VERSION: "18" # Used compiler, update POST-BRANCH.
- LLVM_PREVIOUS_VERSION: "17"
- LLVM_OLDEST_VERSION: "16"
+ LLVM_HEAD_VERSION: "19" # Used compiler, update POST-BRANCH.
+ LLVM_PREVIOUS_VERSION: "18"
+ LLVM_OLDEST_VERSION: "17"
GCC_STABLE_VERSION: "13"
- LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-18"
+ LLVM_SYMBOLIZER_PATH: "/usr/bin/llvm-symbolizer-19"
CLANG_CRASH_DIAGNOSTICS_DIR: "crash_diagnostics"
@@ -59,8 +59,8 @@ jobs:
'generic-cxx26',
'generic-modules'
]
- cc: [ 'clang-18' ]
- cxx: [ 'clang++-18' ]
+ cc: [ 'clang-19' ]
+ cxx: [ 'clang++-19' ]
clang_tidy: [ 'ON' ]
include:
- config: 'generic-gcc'
@@ -100,22 +100,22 @@ jobs:
'generic-cxx20',
'generic-cxx23'
]
- cc: [ 'clang-18' ]
- cxx: [ 'clang++-18' ]
+ cc: [ 'clang-19' ]
+ cxx: [ 'clang++-19' ]
clang_tidy: [ 'ON' ]
include:
- config: 'generic-gcc-cxx11'
cc: 'gcc-13'
cxx: 'g++-13'
clang_tidy: 'OFF'
- - config: 'generic-cxx23'
- cc: 'clang-16'
- cxx: 'clang++-16'
- clang_tidy: 'OFF'
- config: 'generic-cxx23'
cc: 'clang-17'
cxx: 'clang++-17'
clang_tidy: 'OFF'
+ - config: 'generic-cxx26'
+ cc: 'clang-18'
+ cxx: 'clang++-18'
+ clang_tidy: 'ON'
steps:
- uses: actions/checkout@v4
- name: ${{ matrix.config }}
@@ -186,8 +186,8 @@ jobs:
- name: ${{ matrix.config }}
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
env:
- CC: clang-18
- CXX: clang++-18
+ CC: clang-19
+ CXX: clang++-19
ENABLE_CLANG_TIDY: "OFF"
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: always()
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 54dfe3aadbb423d98b106ea02d9f4f09e25574c3..983838858ba43ed90cca953b6b00668d6746f5df 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -1,4 +1,8 @@
name: "Check code formatting"
+
+permissions:
+ contents: read
+
on:
pull_request:
branches:
@@ -33,7 +37,7 @@ jobs:
- name: Fetch code formatting utils
uses: actions/checkout@v4
with:
- reository: ${{ github.repository }}
+ repository: ${{ github.repository }}
ref: ${{ github.base_ref }}
sparse-checkout: |
llvm/utils/git/requirements_formatting.txt
diff --git a/.github/workflows/release-lit.yml b/.github/workflows/release-lit.yml
index 36b0b6edd518fc74fecf397c8947ff706066a52e..0316ba406041d6fc63c812da994ea662276bee6e 100644
--- a/.github/workflows/release-lit.yml
+++ b/.github/workflows/release-lit.yml
@@ -58,7 +58,7 @@ jobs:
cd llvm/utils/lit
# Remove 'dev' suffix from lit version.
sed -i 's/ + "dev"//g' lit/__init__.py
- python3 setup.py sdist
+ python3 setup.py sdist bdist_wheel
- name: Upload lit to test.pypi.org
uses: pypa/gh-action-pypi-publish@release/v1
diff --git a/bolt/docs/BAT.md b/bolt/docs/BAT.md
index f23ef1abf8761cc58fc2249ef0da43ae0034e114..7ffb5d7c00816e11df469e3de6372e462d1eb616 100644
--- a/bolt/docs/BAT.md
+++ b/bolt/docs/BAT.md
@@ -81,9 +81,10 @@ Hot indices are delta encoded, implicitly starting at zero.
| `FuncHash` | 8b | Function hash for input function | Hot |
| `NumBlocks` | ULEB128 | Number of basic blocks in the original function | Hot |
| `NumSecEntryPoints` | ULEB128 | Number of secondary entry points in the original function | Hot |
+| `ColdInputSkew` | ULEB128 | Skew to apply to all input offsets | Cold |
| `NumEntries` | ULEB128 | Number of address translation entries for a function | Both |
-| `EqualElems` | ULEB128 | Number of equal offsets in the beginning of a function | Hot |
-| `BranchEntries` | Bitmask, `alignTo(EqualElems, 8)` bits | If `EqualElems` is non-zero, bitmask denoting entries with `BRANCHENTRY` bit | Hot |
+| `EqualElems` | ULEB128 | Number of equal offsets in the beginning of a function | Both |
+| `BranchEntries` | Bitmask, `alignTo(EqualElems, 8)` bits | If `EqualElems` is non-zero, bitmask denoting entries with `BRANCHENTRY` bit | Both |
Function header is followed by *Address Translation Table* with `NumEntries`
total entries, and *Secondary Entry Points* table with `NumSecEntryPoints`
@@ -99,8 +100,8 @@ entry is encoded. Input offsets implicitly start at zero.
| `BBHash` | Optional, 8b | Basic block hash in input binary | BB |
| `BBIdx` | Optional, Delta, ULEB128 | Basic block index in input binary | BB |
-For hot fragments, the table omits the first `EqualElems` input offsets
-where the input offset equals output offset.
+The table omits the first `EqualElems` input offsets where the input offset
+equals output offset.
`BRANCHENTRY` bit denotes whether a given offset pair is a control flow source
(branch or call instruction). If not set, it signifies a control flow target
diff --git a/bolt/include/bolt/Core/AddressMap.h b/bolt/include/bolt/Core/AddressMap.h
index 85a9ab4473aafedd192145acaa334208e22ac6e6..31ed7d40ee7f215586e53a6b285f492c898ab765 100644
--- a/bolt/include/bolt/Core/AddressMap.h
+++ b/bolt/include/bolt/Core/AddressMap.h
@@ -14,7 +14,6 @@
#ifndef BOLT_CORE_ADDRESS_MAP_H
#define BOLT_CORE_ADDRESS_MAP_H
-#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCSymbol.h"
#include
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 741b1a36af86f871bb51430686ff229ce2e1d1b8..8b1af9e8153925760985efcb954e87a046b2c1f2 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -265,7 +265,8 @@ class BinaryContext {
public:
static Expected>
- createBinaryContext(const ObjectFile *File, bool IsPIC,
+ createBinaryContext(Triple TheTriple, StringRef InputFileName,
+ SubtargetFeatures *Features, bool IsPIC,
std::unique_ptr DwCtx,
JournalingStreams Logger);
diff --git a/bolt/include/bolt/Core/BinaryData.h b/bolt/include/bolt/Core/BinaryData.h
index 5f1efda781905db66ec18e16a3263a88c5f0816f..8a67b3e73b802d2a2a620f13bb59b58c7689aa9f 100644
--- a/bolt/include/bolt/Core/BinaryData.h
+++ b/bolt/include/bolt/Core/BinaryData.h
@@ -18,7 +18,6 @@
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/raw_ostream.h"
-#include
#include
#include
@@ -108,7 +107,6 @@ public:
std::vector &getSymbols() { return Symbols; }
bool hasName(StringRef Name) const;
- bool hasNameRegex(StringRef Name) const;
bool nameStartsWith(StringRef Prefix) const;
bool hasSymbol(const MCSymbol *Symbol) const {
diff --git a/bolt/include/bolt/Core/BinaryDomTree.h b/bolt/include/bolt/Core/BinaryDomTree.h
index a9565795f94631b25c6674eb699b78e9f9d5bffd..de27aa78769d23398eaf97177ad316abf3e09798 100644
--- a/bolt/include/bolt/Core/BinaryDomTree.h
+++ b/bolt/include/bolt/Core/BinaryDomTree.h
@@ -16,7 +16,6 @@
#include "bolt/Core/BinaryBasicBlock.h"
#include "llvm/IR/Dominators.h"
-#include "llvm/Support/GenericDomTreeConstruction.h"
namespace llvm {
namespace bolt {
diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h
index c170fa6397cc927293f539391ea5a29b7389a7be..26d2d01f86267127f4c4bea9daa5862b4b412738 100644
--- a/bolt/include/bolt/Core/BinaryFunction.h
+++ b/bolt/include/bolt/Core/BinaryFunction.h
@@ -27,6 +27,7 @@
#include "bolt/Core/BinaryBasicBlock.h"
#include "bolt/Core/BinaryContext.h"
+#include "bolt/Core/BinaryDomTree.h"
#include "bolt/Core/BinaryLoop.h"
#include "bolt/Core/BinarySection.h"
#include "bolt/Core/DebugData.h"
@@ -51,7 +52,6 @@
#include
#include
#include
-#include
#include
#include
@@ -266,6 +266,7 @@ private:
BinaryContext &BC;
std::unique_ptr BLI;
+ std::unique_ptr BDT;
/// All labels in the function that are referenced via relocations from
/// data objects. Typically these are jump table destinations and computed
@@ -838,6 +839,14 @@ public:
/// stats.
void calculateMacroOpFusionStats();
+ /// Returns if BinaryDominatorTree has been constructed for this function.
+ bool hasDomTree() const { return BDT != nullptr; }
+
+ BinaryDominatorTree &getDomTree() { return *BDT.get(); }
+
+ /// Constructs DomTree for this function.
+ void constructDomTree();
+
/// Returns if loop detection has been run for this function.
bool hasLoopInfo() const { return BLI != nullptr; }
@@ -1159,7 +1168,7 @@ public:
/// Pass an offset of the entry point in the input binary and a corresponding
/// global symbol to the callback function.
///
- /// Return true of all callbacks returned true, false otherwise.
+ /// Return true if all callbacks returned true, false otherwise.
bool forEachEntryPoint(EntryPointCallbackTy Callback) const;
/// Return MC symbol associated with the end of the function.
@@ -1393,7 +1402,8 @@ public:
/// Return true if the function has CFI instructions
bool hasCFI() const {
- return !FrameInstructions.empty() || !CIEFrameInstructions.empty();
+ return !FrameInstructions.empty() || !CIEFrameInstructions.empty() ||
+ IsInjected;
}
/// Return unique number associated with the function.
diff --git a/bolt/include/bolt/Core/BinaryLoop.h b/bolt/include/bolt/Core/BinaryLoop.h
index 72dce77df8c14b970023a59b82180f6bc2bb1633..b425c75715d8b1d02e66655d8ff7e4d9115fffdd 100644
--- a/bolt/include/bolt/Core/BinaryLoop.h
+++ b/bolt/include/bolt/Core/BinaryLoop.h
@@ -15,7 +15,7 @@
#ifndef BOLT_CORE_BINARY_LOOP_H
#define BOLT_CORE_BINARY_LOOP_H
-#include "llvm/Support/GenericLoopInfoImpl.h"
+#include "llvm/Support/GenericLoopInfo.h"
namespace llvm {
namespace bolt {
diff --git a/bolt/include/bolt/Core/BinarySection.h b/bolt/include/bolt/Core/BinarySection.h
index 0f179877bd3df3b4bf7e736d1fc00e4806c9f7d2..5b7a5b08820e6e5190559ce2ad59992c7a998e2a 100644
--- a/bolt/include/bolt/Core/BinarySection.h
+++ b/bolt/include/bolt/Core/BinarySection.h
@@ -18,7 +18,6 @@
#include "bolt/Core/DebugData.h"
#include "bolt/Core/Relocation.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/MachO.h"
diff --git a/bolt/include/bolt/Core/DebugData.h b/bolt/include/bolt/Core/DebugData.h
index 7d10b208dc83a22c9eee5d0f5acd538258401e42..166bb3617e57f68448eb662348e2e414ed885b32 100644
--- a/bolt/include/bolt/Core/DebugData.h
+++ b/bolt/include/bolt/Core/DebugData.h
@@ -27,7 +27,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/bolt/include/bolt/Core/DebugNames.h b/bolt/include/bolt/Core/DebugNames.h
index fbaa7f4e68aac9281989f8432346b1eb9546c3cb..a4fdde7c396ad886e3d8c96bb92d25a657a4a0e1 100644
--- a/bolt/include/bolt/Core/DebugNames.h
+++ b/bolt/include/bolt/Core/DebugNames.h
@@ -14,7 +14,7 @@
#ifndef BOLT_CORE_DEBUG_NAMES_H
#define BOLT_CORE_DEBUG_NAMES_H
-#include "DebugData.h"
+#include "bolt/Core/DebugData.h"
#include "llvm/CodeGen/AccelTable.h"
namespace llvm {
diff --git a/bolt/include/bolt/Core/FunctionLayout.h b/bolt/include/bolt/Core/FunctionLayout.h
index 2e4c184ba4511ca6836ca9d031014c1f784385f0..b685a99c79c14cccd0e7661ed8a48991c9a53b98 100644
--- a/bolt/include/bolt/Core/FunctionLayout.h
+++ b/bolt/include/bolt/Core/FunctionLayout.h
@@ -25,7 +25,6 @@
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/iterator_range.h"
#include
-#include
namespace llvm {
namespace bolt {
diff --git a/bolt/include/bolt/Core/MCPlus.h b/bolt/include/bolt/Core/MCPlus.h
index 1d2360c180335f9f2b1d243153dc1c6f5f92b6fd..601d709712864ebefce1a4156378b023f564be96 100644
--- a/bolt/include/bolt/Core/MCPlus.h
+++ b/bolt/include/bolt/Core/MCPlus.h
@@ -14,10 +14,8 @@
#ifndef BOLT_CORE_MCPLUS_H
#define BOLT_CORE_MCPLUS_H
-#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
-#include "llvm/Support/Casting.h"
#include
namespace llvm {
diff --git a/bolt/include/bolt/Core/MCPlusBuilder.h b/bolt/include/bolt/Core/MCPlusBuilder.h
index 198a8d8bf48f8222cf4863d7d6d928f5ff160c6e..f7614cf9ac9777be6812e228190cc20c810b4c3d 100644
--- a/bolt/include/bolt/Core/MCPlusBuilder.h
+++ b/bolt/include/bolt/Core/MCPlusBuilder.h
@@ -19,6 +19,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCDisassembler/MCSymbolizer.h"
#include "llvm/MC/MCExpr.h"
@@ -27,6 +28,7 @@
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/RWMutex.h"
@@ -533,9 +535,7 @@ public:
return Analysis->isReturn(Inst);
}
- virtual bool isTerminator(const MCInst &Inst) const {
- return Analysis->isTerminator(Inst);
- }
+ virtual bool isTerminator(const MCInst &Inst) const;
virtual bool isNoop(const MCInst &Inst) const {
llvm_unreachable("not implemented");
diff --git a/bolt/include/bolt/Passes/BinaryPasses.h b/bolt/include/bolt/Passes/BinaryPasses.h
index 046765b16f19d21b8562440f51c1b0c3c666995e..8d89ef8b5484f8e18d7ea034c3d38df57746760a 100644
--- a/bolt/include/bolt/Passes/BinaryPasses.h
+++ b/bolt/include/bolt/Passes/BinaryPasses.h
@@ -18,7 +18,6 @@
#include "bolt/Core/DynoStats.h"
#include "llvm/Support/CommandLine.h"
#include
-#include