Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1274bca
[X86][APX] Support APX + MOVRS (#123264)
phoebewang Jan 17, 2025
c3ba6f3
[Modules] Delay deserialization of preferred_name attribute at r… (#1…
VitaNuo Jan 17, 2025
90a05f3
[openmp] Support CET in z_Linux_asm.S (#123213)
nikic Jan 17, 2025
3c42a77
[BOLT] Fix handling of LLVM_LIBDIR_SUFFIX (#122874)
nikic Jan 17, 2025
c8ba551
[AArch64] Return early rather than asserting when Size of value passe…
WillFroom Jan 17, 2025
9720be9
[LV][EVL] Disable fixed-order recurrence idiom with EVL tail folding.…
Mel-Chen Jan 17, 2025
0e13ce7
[InstCombine] Handle mul in `maintainNoSignedWrap` (#123299)
dtcxzyw Jan 17, 2025
320c2ee
[BOLT] Pass -Wl,--build-id=none to linker in tests (#122886)
nikic Jan 17, 2025
58903c9
[LLVM] Update AArch64 maintainers (#120440)
nikic Jan 17, 2025
7347870
[diagtool] Make the BuiltinDiagnosticsByID table sorted (#120321)
karka228 Jan 17, 2025
89e3a64
[LoongArch] Emit R_LARCH_RELAX when expanding some macros (#120067)
zhaoqi5 Jan 17, 2025
31b62e2
[LoongArch] Add relax relocations for tls_le code sequence (#121329)
zhaoqi5 Jan 17, 2025
30e276d
[clang][PCH] Don't try to create standalone debug-info for types mark…
Michael137 Jan 17, 2025
d7e48fb
[llvm][OpenMP] Add implicit cast to omp.atomic.read (#114659)
NimishMishra Jan 17, 2025
fbb9d49
[X86][APX] Support APX + AMX-MOVRS/AMX-TRANSPOSE (#123267)
phoebewang Jan 17, 2025
ee42822
[BOLT][AArch64]support `inline-small-functions` for AArch64 (#120187)
liusy58 Jan 17, 2025
3b3590a
Revert "Revert "[InstCombine] Transform high latency, dependent FSQRT…
sushgokh Jan 17, 2025
2c9dc08
[AArch64] Use spill size when calculating callee saves size (NFC) (#1…
MacDue Jan 17, 2025
32a4650
[AArch64] Avoid hardcoding spill size/align in FrameLowering (NFC) (#…
MacDue Jan 17, 2025
e79bb87
[InstCombine] Fixup commit 7253c6f (#123315)
sushgokh Jan 17, 2025
9491f75
Reland: [LV]: Teach LV to recursively (de)interleave. (#122989)
hassnaaHamdi Jan 17, 2025
b068f2f
[LLD][COFF] Process bitcode files separately for each symbol table on…
cjacek Jan 17, 2025
101109f
[MLIR] Add missing include (NFC)
nikic Jan 17, 2025
831527a
[FMV][GlobalOpt] Statically resolve calls to versioned functions. (#8…
labrinea Jan 17, 2025
ad282f4
[X86] Rename combineScalarToVector to combineSCALAR_TO_VECTOR. NFC.
RKSimon Jan 17, 2025
0ab368c
SCEV/test: cover implied-via-addition (#123082)
artagnon Jan 17, 2025
437834e
[Flang] Use a module directory to avoid race condition (#123215)
kiranchandramohan Jan 17, 2025
21704a6
[AMDGPU] Fix printing hasInitWholeWave in mir (#123232)
rampitec Jan 17, 2025
0d7c8c0
[bazel] Add new file added in 437834e16be6d04e7b198dad8a42d507770251a1
d0k Jan 17, 2025
f66a5e2
[lldb] Fix SBThread::StepOverUntil for discontinuous functions (#123046)
labath Jan 17, 2025
a864906
[X86] Fix logical operator warnings. NFC.
RKSimon Jan 17, 2025
7075eee
[clang][bytecode] Add InitLinkScope for toplevel Expr temporary (#123…
tbaederr Jan 17, 2025
61f94eb
[NFC][Offload] Structure/Readability of CMake cache (#123328)
jplehr Jan 17, 2025
58fc802
[lldb] Skip TestStepUntilAPI on !x86_64, !aarch64
labath Jan 17, 2025
a90b5b1
[libclc] Move degrees/radians to CLC library & optimize (#123222)
frasercrmck Jan 17, 2025
8c63648
Revert "Revert "[Flang][Driver] Add a flag to control zero initializa…
kiranchandramohan Jan 17, 2025
bacfdcd
[DAG] Add SDPatternMatch::m_BitCast matcher (#123327)
RKSimon Jan 17, 2025
ce3280a
Fix for buildbot errors on non-aarch64 targets. (#123322)
labrinea Jan 17, 2025
8a229f5
Revert "Revert "Revert "[Flang][Driver] Add a flag to control zero in…
kiranchandramohan Jan 17, 2025
22637a8
[Loads] Respect UseDerefAtPointSemantics in isDerefAndAlignedPointer.…
fhahn Jan 17, 2025
fb2c9d9
[C++20] [Modules] Makes sure internal declaration won't be found by o…
ChuanqiXu9 Jan 17, 2025
41f430a
[X86] Don't fold very large offsets into addr displacements during IS…
wesleywiser Jan 17, 2025
5153a90
[lldb][DWARF] Change GetAttributes to always visit current DIE before…
Michael137 Jan 17, 2025
eff6b64
[AArch64][GlobalISel] Update and regenerate some vecreduce and other …
davemgreen Jan 17, 2025
ca75a9f
[AutoBump] Merge with eff6b642 (Jan 17)
jorickert Mar 20, 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
4 changes: 2 additions & 2 deletions bolt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ if (BOLT_ENABLE_RUNTIME)
add_llvm_install_targets(install-bolt_rt
DEPENDS bolt_rt bolt
COMPONENT bolt)
set(LIBBOLT_RT_INSTR "${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/lib/libbolt_rt_instr.a")
set(LIBBOLT_RT_HUGIFY "${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/lib/libbolt_rt_hugify.a")
set(LIBBOLT_RT_INSTR "${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/lib${LLVM_LIBDIR_SUFFIX}/libbolt_rt_instr.a")
set(LIBBOLT_RT_HUGIFY "${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/lib${LLVM_LIBDIR_SUFFIX}/libbolt_rt_hugify.a")
endif()

find_program(GNU_LD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.bfd ld.bfd DOC "GNU ld")
Expand Down
4 changes: 2 additions & 2 deletions bolt/lib/Passes/Inliner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,13 @@ Inliner::inlineCall(BinaryBasicBlock &CallerBB,
if (MIB.isPseudo(Inst))
continue;

MIB.stripAnnotations(Inst, /*KeepTC=*/BC.isX86());
MIB.stripAnnotations(Inst, /*KeepTC=*/BC.isX86() || BC.isAArch64());

// Fix branch target. Strictly speaking, we don't have to do this as
// targets of direct branches will be fixed later and don't matter
// in the CFG state. However, disassembly may look misleading, and
// hence we do the fixing.
if (MIB.isBranch(Inst)) {
if (MIB.isBranch(Inst) && !MIB.isTailCall(Inst)) {
assert(!MIB.isIndirectBranch(Inst) &&
"unexpected indirect branch in callee");
const BinaryBasicBlock *TargetBB =
Expand Down
30 changes: 30 additions & 0 deletions bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,36 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
public:
using MCPlusBuilder::MCPlusBuilder;

MCPhysReg getStackPointer() const override { return AArch64::SP; }

bool isPush(const MCInst &Inst) const override { return false; }

bool isPop(const MCInst &Inst) const override { return false; }

void createCall(MCInst &Inst, const MCSymbol *Target,
MCContext *Ctx) override {
createDirectCall(Inst, Target, Ctx, false);
}

bool convertTailCallToCall(MCInst &Inst) override {
int NewOpcode;
switch (Inst.getOpcode()) {
default:
return false;
case AArch64::B:
NewOpcode = AArch64::BL;
break;
case AArch64::BR:
NewOpcode = AArch64::BLR;
break;
}

Inst.setOpcode(NewOpcode);
removeAnnotation(Inst, MCPlus::MCAnnotation::kTailCall);
clearOffset(Inst);
return true;
}

bool equals(const MCTargetExpr &A, const MCTargetExpr &B,
CompFuncTy Comp) const override {
const auto &AArch64ExprA = cast<AArch64MCExpr>(A);
Expand Down
18 changes: 9 additions & 9 deletions bolt/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ add_library(bolt_rt_instr STATIC
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_instr PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_instr PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
add_library(bolt_rt_hugify STATIC
hugify.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_hugify PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_hugify PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")

if(NOT BOLT_BUILT_STANDALONE)
add_custom_command(TARGET bolt_rt_instr POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib/libbolt_rt_instr.a" "${LLVM_LIBRARY_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libbolt_rt_instr.a" "${LLVM_LIBRARY_DIR}")
add_custom_command(TARGET bolt_rt_hugify POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib/libbolt_rt_hugify.a" "${LLVM_LIBRARY_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libbolt_rt_hugify.a" "${LLVM_LIBRARY_DIR}")
endif()

set(BOLT_RT_FLAGS
Expand All @@ -53,23 +53,23 @@ target_include_directories(bolt_rt_instr PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_options(bolt_rt_hugify PRIVATE ${BOLT_RT_FLAGS})
target_include_directories(bolt_rt_hugify PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

install(TARGETS bolt_rt_instr DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
install(TARGETS bolt_rt_hugify DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
install(TARGETS bolt_rt_instr DESTINATION "lib${LLVM_LIBDIR_SUFFIX}")
install(TARGETS bolt_rt_hugify DESTINATION "lib${LLVM_LIBDIR_SUFFIX}")

if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*" AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_library(bolt_rt_instr_osx STATIC
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_instr_osx PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_instr_osx PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
target_include_directories(bolt_rt_instr_osx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_options(bolt_rt_instr_osx PRIVATE
-target x86_64-apple-darwin19.6.0
${BOLT_RT_FLAGS})
install(TARGETS bolt_rt_instr_osx DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}")
install(TARGETS bolt_rt_instr_osx DESTINATION "lib${LLVM_LIBDIR_SUFFIX}")

if(NOT BOLT_BUILT_STANDALONE)
add_custom_command(TARGET bolt_rt_instr_osx POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib/libbolt_rt_instr_osx.a" "${LLVM_LIBRARY_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libbolt_rt_instr_osx.a" "${LLVM_LIBRARY_DIR}")
endif()
endif()
42 changes: 42 additions & 0 deletions bolt/test/AArch64/inline-small-function-1.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## This test checks that inline is properly handled by BOLT on aarch64.

# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-small-functions --print-inline --print-only=_Z3barP1A \
# RUN: %t.exe -o %t.bolt | FileCheck %s

# CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 4 bytes.
# CHECK: Binary Function "_Z3barP1A" after inlining {
# CHECK-NOT: bl _Z3fooP1A
# CHECK: ldr x8, [x0]
# CHECK-NEXT: ldr w0, [x8]

.text
.globl _Z3fooP1A
.type _Z3fooP1A,@function
_Z3fooP1A:
ldr x8, [x0]
ldr w0, [x8]
ret
.size _Z3fooP1A, .-_Z3fooP1A

.globl _Z3barP1A
.type _Z3barP1A,@function
_Z3barP1A:
stp x29, x30, [sp, #-16]!
mov x29, sp
bl _Z3fooP1A
mul w0, w0, w0
ldp x29, x30, [sp], #16
ret
.size _Z3barP1A, .-_Z3barP1A

.globl main
.p2align 2
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main
48 changes: 48 additions & 0 deletions bolt/test/AArch64/inline-small-function-2.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## This test checks that inline is properly handled by BOLT on aarch64.

# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-small-functions --print-inline --print-only=test \
# RUN: %t.exe -o %t.bolt | FileCheck %s

#CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 4 bytes.
#CHECK: Binary Function "test" after inlining {
#CHECK-NOT: bl indirect
#CHECK: add w0, w1, w0
#CHECK-NEXT: blr x2

.text
.globl indirect
.type indirect,@function
indirect:
add w0, w1, w0
br x2
.size indirect, .-indirect

.globl test
.type test,@function
test:
stp x29, x30, [sp, #-32]!
stp x20, x19, [sp, #16]
mov x29, sp
mov w19, w1
mov w20, w0
bl indirect
add w8, w19, w20
cmp w0, #0
csinc w0, w8, wzr, eq
ldp x20, x19, [sp, #16]
ldp x29, x30, [sp], #32
ret
.size test, .-test

.globl main
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main


2 changes: 1 addition & 1 deletion bolt/test/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
host_linux_triple = config.target_triple.split("-")[0] + "-unknown-linux-gnu"
common_linker_flags = "-fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -pie"
common_linker_flags = "-fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -Wl,--build-id=none -pie"
flags = f"--target={host_linux_triple} -fPIE {common_linker_flags}"

config.substitutions.insert(0, ("%cflags", f"%cflags {flags}"))
Expand Down
14 changes: 10 additions & 4 deletions clang/include/clang/AST/Attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class Attr : public AttributeCommonInfo {
unsigned IsLateParsed : 1;
LLVM_PREFERRED_TYPE(bool)
unsigned InheritEvenIfAlreadyPresent : 1;
LLVM_PREFERRED_TYPE(bool)
unsigned DeferDeserialization : 1;

void *operator new(size_t bytes) noexcept {
llvm_unreachable("Attrs cannot be allocated with regular 'new'.");
Expand All @@ -80,10 +82,11 @@ class Attr : public AttributeCommonInfo {

protected:
Attr(ASTContext &Context, const AttributeCommonInfo &CommonInfo,
attr::Kind AK, bool IsLateParsed)
attr::Kind AK, bool IsLateParsed, bool DeferDeserialization = false)
: AttributeCommonInfo(CommonInfo), AttrKind(AK), Inherited(false),
IsPackExpansion(false), Implicit(false), IsLateParsed(IsLateParsed),
InheritEvenIfAlreadyPresent(false) {}
InheritEvenIfAlreadyPresent(false),
DeferDeserialization(DeferDeserialization) {}

public:
attr::Kind getKind() const { return static_cast<attr::Kind>(AttrKind); }
Expand All @@ -105,6 +108,8 @@ class Attr : public AttributeCommonInfo {
void setPackExpansion(bool PE) { IsPackExpansion = PE; }
bool isPackExpansion() const { return IsPackExpansion; }

bool shouldDeferDeserialization() const { return DeferDeserialization; }

// Clone this attribute.
Attr *clone(ASTContext &C) const;

Expand Down Expand Up @@ -146,8 +151,9 @@ class InheritableAttr : public Attr {
protected:
InheritableAttr(ASTContext &Context, const AttributeCommonInfo &CommonInfo,
attr::Kind AK, bool IsLateParsed,
bool InheritEvenIfAlreadyPresent)
: Attr(Context, CommonInfo, AK, IsLateParsed) {
bool InheritEvenIfAlreadyPresent,
bool DeferDeserialization = false)
: Attr(Context, CommonInfo, AK, IsLateParsed, DeferDeserialization) {
this->InheritEvenIfAlreadyPresent = InheritEvenIfAlreadyPresent;
}

Expand Down
33 changes: 33 additions & 0 deletions clang/include/clang/Basic/AllDiagnosticKinds.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//===--- AllDiagnosticKinds.inc----------------------------------*- 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
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Defines the Diagnostic IDs in ID sorted order. The order is dictated by
/// the enum in DiagnosticIDs.h#L49-L65.
///
//===----------------------------------------------------------------------===//

// Turn off clang-format, as the order of the includes are important to make
// sure tables based on Diagnostic IDs are partitioned/sorted based on
// DiagID.

// clang-format off
#include "clang/Basic/DiagnosticCommonKinds.inc"
#include "clang/Basic/DiagnosticDriverKinds.inc"
#include "clang/Basic/DiagnosticFrontendKinds.inc"
#include "clang/Basic/DiagnosticSerializationKinds.inc"
#include "clang/Basic/DiagnosticLexKinds.inc"
#include "clang/Basic/DiagnosticParseKinds.inc"
#include "clang/Basic/DiagnosticASTKinds.inc"
#include "clang/Basic/DiagnosticCommentKinds.inc"
#include "clang/Basic/DiagnosticCrossTUKinds.inc"
#include "clang/Basic/DiagnosticSemaKinds.inc"
#include "clang/Basic/DiagnosticAnalysisKinds.inc"
#include "clang/Basic/DiagnosticRefactoringKinds.inc"
#include "clang/Basic/DiagnosticInstallAPIKinds.inc"
// clang-format on
11 changes: 11 additions & 0 deletions clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,12 @@ class Attr {
// attribute may be documented under multiple categories, more than one
// Documentation entry may be listed.
list<Documentation> Documentation;
// Set to true if deserialization of this attribute must be deferred until
// the parent Decl is fully deserialized (during header module file
// deserialization). E.g., this is the case for the preferred_name attribute,
// since its type deserialization depends on its target Decl type.
// (See https://github.com/llvm/llvm-project/issues/56490 for details).
bit DeferDeserialization = 0;
}

/// Used to define a set of mutually exclusive attributes.
Expand Down Expand Up @@ -3254,6 +3260,11 @@ def PreferredName : InheritableAttr {
let InheritEvenIfAlreadyPresent = 1;
let MeaningfulToClassTemplateDefinition = 1;
let TemplateDependent = 1;
// Type of this attribute depends on the target Decl type.
// Therefore, its deserialization must be deferred until
// deserialization of the target Decl is complete
// (for header modules).
let DeferDeserialization = 1;
}

def PreserveMost : DeclOrTypeAttr {
Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Serialization/ASTBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ enum ASTRecordTypes {
CXX_ADDED_TEMPLATE_PARTIAL_SPECIALIZATION = 75,

UPDATE_MODULE_LOCAL_VISIBLE = 76,

UPDATE_TU_LOCAL_VISIBLE = 77,
};

/// Record types used within a source manager block.
Expand Down Expand Up @@ -1340,6 +1342,10 @@ enum DeclCode {
/// only visible from DeclContext in the same module.
DECL_CONTEXT_MODULE_LOCAL_VISIBLE,

/// A record that stores the set of declarations that are only visible
/// to the TU.
DECL_CONTEXT_TU_LOCAL_VISIBLE,

/// A LabelDecl record.
DECL_LABEL,

Expand Down
Loading
Loading