Skip to content
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d162afa
[AMDGPU][GlobalISel] Add RegBankLegalize support for G_FPEXT (#171483)
vangthao95 Dec 10, 2025
5c98163
[lldb] Log when we use fallback register information
DavidSpickett Dec 10, 2025
16fbbac
[X86] shift-i512.ll - add load test coverage (#171642)
RKSimon Dec 10, 2025
05ef57f
[libc++][Github] Bump Runners to Next Group (#168122)
boomanaiden154 Dec 10, 2025
0ab6a63
[LLVM][IR] Add support for address space names in DataLayout (#170559)
jurahul Dec 10, 2025
6cacbdb
[CIR][NFC] Rename AtomicFence to AtomicFenceOp (#171248)
Luhaocong Dec 10, 2025
1267488
[flang][OpenMP] Frontend support for DIMS modifier (#171454)
kparzysz Dec 10, 2025
4c6aa8f
[clang][ssaf] Introduce entity abstraction for SSAF (#169131)
jkorous-apple Dec 10, 2025
deac791
[Flang][Pass]Disable memory intrinsics expansions
alexey-bataev Dec 10, 2025
000279d
[NFC][TTI] Introduce getInstructionUniformity API for uniformity anal…
PankajDwivedi-25 Dec 10, 2025
36a95a5
[libc++][Github] Bump Runner Version to v2.330.0 (#168753)
boomanaiden154 Dec 10, 2025
f5c28bd
[MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in ViewOp…
joker-eph Aug 21, 2025
097ac33
[lldb] Stop emitting pointless newline (NFC) (#171531)
JDevlieghere Dec 10, 2025
3ece662
[mlir][xegpu] Add support for `vector.extract_strided_slice` XeGPU SI…
charithaintc Dec 10, 2025
28ff941
[BOLT][AArch64] Always cover veneers in lite mode (#171534)
maksfb Dec 10, 2025
49324cd
[lldb] Make TestJitBreakPoint.py use LLVM_TOOLS_DIR (#171656)
boomanaiden154 Dec 10, 2025
c5995e2
[sanitizer_common][test-only] Specify full path for sort executable i…
DanBlackwell Dec 10, 2025
c1fd5ac
[MLIR] Apply clang-tidy fixes for readability-simplify-boolean-expr i…
joker-eph Aug 21, 2025
6470d1b
[BOLT] Exclude BOLT injected functions from AssignSections. NFCI (#17…
maksfb Dec 10, 2025
dde1990
[clang-tidy][NFC] Refactor `readability-redundant-control-flow` (#171…
localspook Dec 10, 2025
aca48a4
Add the support for recognizing WTF::move like std::move (#170820)
rniwa Dec 10, 2025
4427e34
[Flang][Pass]Remove dependence on CodeGen pass
alexey-bataev Dec 10, 2025
ec4aba3
[CIR] Add support for ExpressionTraitExpr (#171634)
AmrDeveloper Dec 10, 2025
48d942c
Revert "[Hexagon] Passes for widening vector operations and shuffle o…
androm3da Dec 10, 2025
07b8aa8
[NFC][M68k] Refactor away MOV8dc and MOV8cd (#169426)
mysterymath Dec 10, 2025
62e00a0
[clang][unittest] Fix build break with BUILD_SHARED_LIBS=ON
kparzysz Dec 10, 2025
04dcb1b
[lldb-dap] Fix running dap_server.py directly for debugging tests. (#…
ashgti Dec 10, 2025
bc0d0bb
[compiler-rt] Add baremetal version of profile library. (#167998)
efriedma-quic Dec 10, 2025
c5ac7d6
[RISCV] Add OperandType for XSfmm TWiden. (#171572)
topperc Dec 10, 2025
ccc3835
[LoopPeel] Ignore assume intrinsics for the mayWriteToMemory check in…
topperc Dec 10, 2025
b13aace
[RISCV] Use vec_rm for VPseudoSF_MatMul_FRM. (#171573)
topperc Dec 10, 2025
e61c2d4
[NFC][LLVM] Document variadic `isa` (#136869)
jurahul Dec 10, 2025
ece3925
[flang-rt][device] Enable MapException on the device with error messa…
clementval Dec 10, 2025
16ee5c7
Revert "[sanitizer_common][test-only] Specify full path for sort exec…
DanBlackwell Dec 10, 2025
182c61d
AArch64: Correctly emit large addends into PAuth ifunc.
pcc Dec 10, 2025
f672f32
[TableGen] Improve error message for bad VTByHwMode in RegisterByHwMode
arichardson Dec 10, 2025
625d535
[TableGen] Handle RegClassByHwMode in AsmWriter
arichardson Dec 10, 2025
d34c717
[FlowSensitive] [StatusOr] [13/N] Add support for gtest ASSERTs
fmayer Dec 10, 2025
5a1299b
[VPlan] Strip stray whitespace when printing VPWidenSelectRecipe. (NFCI)
fhahn Dec 10, 2025
575d689
[mlir][acc] Introduce acc loop tiling pass (#171692)
razvanlupusoru Dec 10, 2025
6ae0b9f
[AMDGPU] Implement codegen for GFX11+ V_CVT_PK_[IU]16_F32 (#168719)
jayfoad Dec 10, 2025
ddc638c
[FlowSensitive] [StatusOr] [14/N] Support nested StatusOrs
fmayer Dec 10, 2025
6b75eae
[clang][ssaf] Speculative fix of unittest build (#171720)
jkorous-apple Dec 10, 2025
e603fac
[FlowSensitive] [StatusOr] [15/15] Support references to Status(Or) ptrs
fmayer Dec 10, 2025
2b958b9
[SelectionDAG] Salvage debuginfo when combining load and sext instrs.…
rastogishubham Dec 10, 2025
56fb92a
[NFC] [FlowSensitive] [StatusOr] expose statusType in header (#171719)
fmayer Dec 10, 2025
e305cf2
[bazel] Port 575d6892bcc5cef926cfc1b95225148262c96a15 (#171722)
boomanaiden154 Dec 10, 2025
871dabc
[lldb] fix failing tests due to CI diagnostics rendering (#171685)
charles-zablit Dec 10, 2025
069d3aa
[Clang][counted_by] Correct signed counted_by values (#171260)
bwendling Dec 10, 2025
3e99778
merge main into amd-staging
z1-cciauto Dec 10, 2025
e23f2c9
merge conflict TTI.getInstructionUniformity
ronlieb Dec 11, 2025
0297af0
Revert "[SelectionDAG] Salvage debuginfo when combining load and sext…
rastogishubham Dec 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/libcxx-build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ concurrency:
jobs:
stage1:
if: github.repository_owner == 'llvm'
runs-on: llvm-premerge-libcxx-runners
runs-on: llvm-premerge-libcxx-next-runners
continue-on-error: false
strategy:
fail-fast: false
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
**/crash_diagnostics/*
stage2:
if: github.repository_owner == 'llvm'
runs-on: llvm-premerge-libcxx-runners
runs-on: llvm-premerge-libcxx-next-runners
needs: [ stage1 ]
continue-on-error: false
strategy:
Expand Down Expand Up @@ -148,19 +148,19 @@ jobs:
'generic-static',
'bootstrapping-build'
]
machine: [ 'llvm-premerge-libcxx-runners' ]
machine: [ 'llvm-premerge-libcxx-next-runners' ]
include:
- config: 'generic-cxx26'
machine: llvm-premerge-libcxx-runners
machine: llvm-premerge-libcxx-next-runners
- config: 'generic-asan'
machine: llvm-premerge-libcxx-runners
machine: llvm-premerge-libcxx-next-runners
- config: 'generic-tsan'
machine: llvm-premerge-libcxx-runners
machine: llvm-premerge-libcxx-next-runners
- config: 'generic-ubsan'
machine: llvm-premerge-libcxx-runners
machine: llvm-premerge-libcxx-next-runners
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
- config: 'generic-msan'
machine: llvm-premerge-libcxx-runners
machine: llvm-premerge-libcxx-next-runners
runs-on: ${{ matrix.machine }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
Expand Down
11 changes: 8 additions & 3 deletions bolt/include/bolt/Core/BinaryFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,12 @@ class BinaryFunction {
Symbols.push_back(BC.Ctx->getOrCreateSymbol(Name));
}

/// This constructor is used to create an injected function
/// This constructor is used to create an injected function, i.e. a function
/// that didn't originate in the input file.
BinaryFunction(const std::string &Name, BinaryContext &BC, bool IsSimple)
: Address(0), Size(0), BC(BC), IsSimple(IsSimple),
CodeSectionName(buildCodeSectionName(Name, BC)),
ColdCodeSectionName(buildColdCodeSectionName(Name, BC)),
CodeSectionName(BC.getInjectedCodeSectionName()),
ColdCodeSectionName(BC.getInjectedColdCodeSectionName()),
FunctionNumber(++Count) {
Symbols.push_back(BC.Ctx->getOrCreateSymbol(Name));
IsInjected = true;
Expand Down Expand Up @@ -2582,6 +2583,10 @@ class BinaryFunction {
/// Return true if the function is an AArch64 linker inserted veneer
bool isAArch64Veneer() const;

/// Return true if the function signature matches veneer or it was established
/// to be a veneer.
bool isPossibleVeneer() const;

virtual ~BinaryFunction();
};

Expand Down
4 changes: 4 additions & 0 deletions bolt/lib/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,10 @@ BinaryContext::createInstructionPatch(uint64_t Address,
PBF->addBasicBlock()->addInstructions(Instructions);
PBF->setIsPatch(true);

// Patch functions have to be emitted each into their unique section.
PBF->setCodeSectionName(
BinaryFunction::buildCodeSectionName(PBF->getOneName(), *this));

// Don't create symbol table entry if the name wasn't specified.
if (Name.str().empty())
PBF->setAnonymous(true);
Expand Down
5 changes: 5 additions & 0 deletions bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4829,6 +4829,11 @@ bool BinaryFunction::isAArch64Veneer() const {
return true;
}

bool BinaryFunction::isPossibleVeneer() const {
return BC.isAArch64() &&
(isAArch64Veneer() || getOneName().starts_with("__AArch64"));
}

void BinaryFunction::addRelocation(uint64_t Address, MCSymbol *Symbol,
uint32_t RelType, uint64_t Addend,
uint64_t Value) {
Expand Down
7 changes: 0 additions & 7 deletions bolt/lib/Passes/BinaryPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,13 +1276,6 @@ Error SimplifyRODataLoads::runOnFunctions(BinaryContext &BC) {
}

Error AssignSections::runOnFunctions(BinaryContext &BC) {
for (BinaryFunction *Function : BC.getInjectedBinaryFunctions()) {
if (!Function->isPatch()) {
Function->setCodeSectionName(BC.getInjectedCodeSectionName());
Function->setColdCodeSectionName(BC.getInjectedColdCodeSectionName());
}
}

// In non-relocation mode functions have pre-assigned section names.
if (!BC.HasRelocations)
return Error::success();
Expand Down
6 changes: 1 addition & 5 deletions bolt/lib/Passes/VeneerElimination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ static llvm::cl::opt<bool>
namespace llvm {
namespace bolt {

static bool isPossibleVeneer(const BinaryFunction &BF) {
return BF.isAArch64Veneer() || BF.getOneName().starts_with("__AArch64");
}

Error VeneerElimination::runOnFunctions(BinaryContext &BC) {
if (!opts::EliminateVeneers || !BC.isAArch64())
return Error::success();

std::unordered_map<const MCSymbol *, const MCSymbol *> VeneerDestinations;
uint64_t NumEliminatedVeneers = 0;
for (BinaryFunction &BF : llvm::make_second_range(BC.getBinaryFunctions())) {
if (!isPossibleVeneer(BF))
if (!BF.isPossibleVeneer())
continue;

if (BF.isIgnored())
Expand Down
5 changes: 5 additions & 0 deletions bolt/lib/Rewrite/RewriteInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3374,6 +3374,11 @@ void RewriteInstance::selectFunctionsToProcess() {
if (mustSkip(Function))
return false;

// Include veneer functions as we want to replace veneer calls with direct
// ones.
if (Function.isPossibleVeneer())
return true;

// If the list is not empty, only process functions from the list.
if (!opts::ForceFunctionNames.empty() || !ForceFunctionsNR.empty()) {
// Regex check (-funcs and -funcs-file options).
Expand Down
56 changes: 56 additions & 0 deletions bolt/test/AArch64/veneer-bolt.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Check that llvm-bolt correctly handles veneers in lite mode.

# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
# RUN: link_fdata %s %t.o %t.fdata
# RUN: llvm-strip --strip-unneeded %t.o
# RUN: %clang %cflags %t.o -o %t.exe -nostdlib -Wl,-q
# RUN: llvm-bolt %t.exe -o %t.bolt --lite=1 --data %t.fdata \
# RUN: --print-normalized 2>&1 | FileCheck %s --check-prefix=CHECK-VENEER

## Constant islands at the end of functions foo(), bar(), and _start() make each
## one of them ~112MB in size. Thus the total code size exceeds 300MB.

.text
.global foo
.type foo, %function
foo:
bl _start
bl bar
ret
.space 0x7000000
.size foo, .-foo

.global bar
.type bar, %function
bar:
bl foo
bl _start
ret
.space 0x7000000
.size bar, .-bar

.global hot
.type hot, %function
hot:
# FDATA: 0 [unknown] 0 1 hot 0 0 100
bl foo
bl bar
bl _start
ret
.size hot, .-hot

## Check that BOLT sees the call to foo, not to its veneer.
# CHECK-VENEER-LABEL: Binary Function "hot"
# CHECK-VENEER: bl
# CHECK-VENEER-SAME: {{[[:space:]]foo[[:space:]]}}

.global _start
.type _start, %function
_start:
bl foo
bl bar
bl hot
ret
.space 0x7000000
.size _start, .-_start

Original file line number Diff line number Diff line change
Expand Up @@ -8,76 +8,58 @@

#include "RedundantControlFlowCheck.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchersMacros.h"
#include "clang/Lex/Lexer.h"

using namespace clang::ast_matchers;

namespace clang::tidy::readability {

static const char *const RedundantReturnDiag =
namespace {

AST_MATCHER_P(CompoundStmt, hasFinalStmt, StatementMatcher, InnerMatcher) {
return !Node.body_empty() &&
InnerMatcher.matches(*Node.body_back(), Finder, Builder);
}

} // namespace

static constexpr StringRef RedundantReturnDiag =
"redundant return statement at the end "
"of a function with a void return type";
static const char *const RedundantContinueDiag =
static constexpr StringRef RedundantContinueDiag =
"redundant continue statement at the "
"end of loop statement";

static bool isLocationInMacroExpansion(const SourceManager &SM,
SourceLocation Loc) {
return SM.isMacroBodyExpansion(Loc) || SM.isMacroArgExpansion(Loc);
}

void RedundantControlFlowCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
functionDecl(isDefinition(), returns(voidType()),
hasBody(compoundStmt(hasAnySubstatement(
returnStmt(unless(has(expr())))))
.bind("return"))),
this);
Finder->addMatcher(
mapAnyOf(forStmt, cxxForRangeStmt, whileStmt, doStmt)
.with(hasBody(compoundStmt(hasAnySubstatement(continueStmt()))
.bind("continue"))),
functionDecl(returns(voidType()),
hasBody(compoundStmt(hasFinalStmt(
returnStmt(unless(has(expr()))).bind("stmt"))))),
this);
Finder->addMatcher(mapAnyOf(forStmt, cxxForRangeStmt, whileStmt, doStmt)
.with(hasBody(compoundStmt(
hasFinalStmt(continueStmt().bind("stmt"))))),
this);
}

void RedundantControlFlowCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Return = Result.Nodes.getNodeAs<CompoundStmt>("return"))
checkRedundantReturn(Result, Return);
else if (const auto *Continue =
Result.Nodes.getNodeAs<CompoundStmt>("continue"))
checkRedundantContinue(Result, Continue);
}

void RedundantControlFlowCheck::checkRedundantReturn(
const MatchFinder::MatchResult &Result, const CompoundStmt *Block) {
const CompoundStmt::const_reverse_body_iterator Last = Block->body_rbegin();
if (const auto *Return = dyn_cast<ReturnStmt>(*Last))
issueDiagnostic(Result, Block, Return->getSourceRange(),
RedundantReturnDiag);
}

void RedundantControlFlowCheck::checkRedundantContinue(
const MatchFinder::MatchResult &Result, const CompoundStmt *Block) {
const CompoundStmt::const_reverse_body_iterator Last = Block->body_rbegin();
if (const auto *Continue = dyn_cast<ContinueStmt>(*Last))
issueDiagnostic(Result, Block, Continue->getSourceRange(),
RedundantContinueDiag);
}
const auto &RedundantStmt = *Result.Nodes.getNodeAs<Stmt>("stmt");
const SourceRange StmtRange = RedundantStmt.getSourceRange();

void RedundantControlFlowCheck::issueDiagnostic(
const MatchFinder::MatchResult &Result, const CompoundStmt *const Block,
const SourceRange &StmtRange, const char *const Diag) {
const SourceManager &SM = *Result.SourceManager;
if (isLocationInMacroExpansion(SM, StmtRange.getBegin()))
if (StmtRange.getBegin().isMacroID())
return;

const auto RemovedRange = CharSourceRange::getCharRange(
StmtRange.getBegin(),
Lexer::findLocationAfterToken(StmtRange.getEnd(), tok::semi, SM,
getLangOpts(),
Lexer::findLocationAfterToken(StmtRange.getEnd(), tok::semi,
*Result.SourceManager, getLangOpts(),
/*SkipTrailingWhitespaceAndNewLine=*/true));

diag(StmtRange.getBegin(), Diag) << FixItHint::CreateRemoval(RemovedRange);
diag(StmtRange.getBegin(), isa<ReturnStmt>(RedundantStmt)
? RedundantReturnDiag
: RedundantContinueDiag)
<< FixItHint::CreateRemoval(RemovedRange);
}

} // namespace clang::tidy::readability
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ class RedundantControlFlowCheck : public ClangTidyCheck {
std::optional<TraversalKind> getCheckTraversalKind() const override {
return TK_IgnoreUnlessSpelledInSource;
}

private:
void
checkRedundantReturn(const ast_matchers::MatchFinder::MatchResult &Result,
const CompoundStmt *Block);

void
checkRedundantContinue(const ast_matchers::MatchFinder::MatchResult &Result,
const CompoundStmt *Block);

void issueDiagnostic(const ast_matchers::MatchFinder::MatchResult &Result,
const CompoundStmt *Block, const SourceRange &StmtRange,
const char *Diag);
};

} // namespace clang::tidy::readability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ clang::ast_matchers::DeclarationMatcher statusClass();
// Match declaration of `absl::internal_statusor::OperatorBase`.
clang::ast_matchers::DeclarationMatcher statusOrOperatorBaseClass();
clang::ast_matchers::TypeMatcher statusOrType();
clang::ast_matchers::TypeMatcher statusType();

// Get RecordStorageLocation for the `Status` contained in the `StatusOr`
RecordStorageLocation &locForStatus(RecordStorageLocation &StatusOrLoc);
Expand Down
47 changes: 47 additions & 0 deletions clang/include/clang/Analysis/Scalable/ASTEntityMapping.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//===- ASTEntityMapping.h - AST to SSAF Entity mapping ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_ASTENTITYMAPPING_H
#define LLVM_CLANG_ANALYSIS_SCALABLE_ASTENTITYMAPPING_H

#include "clang/AST/Decl.h"
#include "clang/Analysis/Scalable/Model/EntityName.h"
#include "llvm/ADT/StringRef.h"
#include <optional>

namespace clang::ssaf {

/// Maps a declaration to an EntityName.
///
/// Supported declaration types for entity mapping:
/// - Functions and methods
/// - Global Variables
/// - Function parameters
/// - Struct/class/union type definitions
/// - Struct/class/union fields
///
/// Implicit declarations and compiler builtins are not mapped.
///
/// \param D The declaration to map. Must not be null.
///
/// \return An EntityName if the declaration can be mapped, std::nullopt
/// otherwise.
std::optional<EntityName> getEntityName(const Decl *D);

/// Maps return entity of a function to an EntityName.
/// The returned name uniquely identifies the return value of function \param
/// FD.
///
/// \param FD The function declaration. Must not be null.
///
/// \return An EntityName for the function's return entity.
std::optional<EntityName> getEntityNameForReturn(const FunctionDecl *FD);

} // namespace clang::ssaf

#endif // LLVM_CLANG_ANALYSIS_SCALABLE_ASTENTITYMAPPING_H
Loading