Skip to content

Commit 89bccad

Browse files
committed
Merge branch 'main' of github.com:llvm/llvm-project into vector-combine/scalarizeBinOpOfSplats-insertelement-cost
2 parents 269892a + 80913b4 commit 89bccad

File tree

6,599 files changed

+1022927
-325751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,599 files changed

+1022927
-325751
lines changed

.ci/generate_test_report_lib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def plural(num_tests):
9292
]
9393
)
9494
elif failures:
95-
report.extend(["", "## Failed Tests", "(click on a test name to see its output)"])
95+
report.extend(
96+
["", "## Failed Tests", "(click on a test name to see its output)"]
97+
)
9698

9799
for testsuite_name, failures in failures.items():
98100
report.extend(["", f"### {testsuite_name}"])

.ci/metrics/metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
# remain small.
6868
BUILDKITE_GRAPHQL_BUILDS_PER_PAGE = 50
6969

70+
7071
@dataclass
7172
class JobMetrics:
7273
job_name: str
@@ -77,6 +78,7 @@ class JobMetrics:
7778
workflow_id: int
7879
workflow_name: str
7980

81+
8082
@dataclass
8183
class GaugeMetric:
8284
name: str
@@ -258,6 +260,7 @@ def buildkite_get_metrics(
258260

259261
return output, incomplete_now
260262

263+
261264
def github_get_metrics(
262265
github_repo: github.Repository, last_workflows_seen_as_completed: set[int]
263266
) -> tuple[list[JobMetrics], int]:

.github/new-prs-labeler.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ mlgo:
702702
- llvm/unittests/CodeGen/ML*
703703
- llvm/test/CodeGen/MLRegAlloc/**
704704
- llvm/utils/mlgo-utils/**
705+
- llvm/docs/MLGO.rst
705706

706707
tools:llvm-exegesis:
707708
- llvm/tools/llvm-exegesis/**
@@ -791,6 +792,12 @@ lld:wasm:
791792
- lld/**/wasm/**
792793
- lld/Common/**
793794

795+
backend:ARC:
796+
- llvm/lib/Target/ARC/**
797+
- clang/lib/Basic/Targets/ARC.h
798+
- clang/lib/Basic/Targets/ARC.cpp
799+
- clang/lib/CodeGen/Targets/ARC.cpp
800+
794801
backend:ARM:
795802
- llvm/include/llvm/IR/IntrinsicsARM.td
796803
- llvm/test/MC/ARM/**
@@ -817,6 +824,19 @@ backend:AArch64:
817824
- clang/include/clang/Sema/SemaARM.h
818825
- clang/lib/Sema/SemaARM.cpp
819826

827+
backend:CSKY:
828+
- llvm/lib/Target/CSKY/**
829+
- llvm/include/llvm/TargetParser/CSKYTargetParser.def
830+
- llvm/include/llvm/TargetParser/CSKYTargetParser.h
831+
- llvm/include/llvm/BinaryFormat/ELFRelocs/CSKY.def
832+
- llvm/lib/TargetParser/CSKYTargetParser.cpp
833+
- llvm/lib/Support/CSKYAttributes.cpp
834+
- llvm/lib/Support/CSKYAttributeParser.cpp
835+
- clang/lib/Basic/Targets/CSKY.h
836+
- clang/lib/Basic/Targets/CSKY.cpp
837+
- clang/lib/CodeGen/Targets/CSKY.cpp
838+
- clang/lib/Driver/ToolChains/CSKY*
839+
820840
backend:Hexagon:
821841
- clang/include/clang/Basic/BuiltinsHexagon*.def
822842
- clang/include/clang/Sema/SemaHexagon.h
@@ -840,6 +860,13 @@ backend:Hexagon:
840860
- llvm/test/MC/Hexagon/**
841861
- llvm/test/tools/llvm-objdump/ELF/Hexagon/**
842862

863+
backend:Lanai:
864+
- llvm/lib/Target/Lanai/**
865+
- clang/lib/Basic/Targets/Lanai.h
866+
- clang/lib/Basic/Targets/Lanai.cpp
867+
- clang/lib/CodeGen/Targets/Lanai.cpp
868+
- clang/lib/Driver/ToolChains/Lanai*
869+
843870
backend:loongarch:
844871
- llvm/include/llvm/IR/IntrinsicsLoongArch.td
845872
- llvm/test/MC/LoongArch/**

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ RUN choco install -y handle
108108
109109
RUN pip3 install pywin32 buildbot-worker==2.8.4
110110
111-
ARG RUNNER_VERSION=2.323.0
111+
ARG RUNNER_VERSION=2.324.0
112112
ENV RUNNER_VERSION=$RUNNER_VERSION
113113
114114
RUN powershell -Command \

.github/workflows/containers/github-action-ci/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM docker.io/library/ubuntu:24.04 as base
22
ENV LLVM_SYSROOT=/opt/llvm
33

44
FROM base as stage1-toolchain
5-
ENV LLVM_VERSION=20.1.1
5+
ENV LLVM_VERSION=20.1.4
66

77
RUN apt-get update && \
88
apt-get install -y \
@@ -86,7 +86,7 @@ WORKDIR /home/gha
8686

8787
FROM ci-container as ci-container-agent
8888

89-
ENV GITHUB_RUNNER_VERSION=2.323.0
89+
ENV GITHUB_RUNNER_VERSION=2.324.0
9090

9191
RUN mkdir actions-runner && \
9292
cd actions-runner && \

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ describes how to get involved, raise issues and submit patches.
99

1010
## Getting in touch
1111

12-
Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
13-
chat](https://discord.gg/xS7Z362), or #llvm IRC channel on
14-
[OFTC](https://oftc.net/).
12+
Join the [LLVM Discourse forums](https://discourse.llvm.org/) or [Discord
13+
chat](https://discord.gg/xS7Z362).
1514

1615
The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
1716
participants to all modes of communication within the project.

bolt/Maintainers.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ what goes in or not.
55

66
The list is sorted by surname and formatted to allow easy grepping and
77
beautification by scripts. The fields are: name (N), email (E), web-address
8-
(W), PGP key ID and fingerprint (P), description (D), snail-mail address
9-
(S) and (I) IRC handle. Each entry should contain at least the (N), (E) and
10-
(D) fields.
8+
(W), PGP key ID and fingerprint (P), and description (D). Each entry should
9+
contain at least the (N), (E) and (D) fields.
1110

1211
N: Maksim Panchenko, Rafael Auler
1312

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ class BinaryContext {
14991499
MCEInstance.LocalCtx.reset(
15001500
new MCContext(*TheTriple, AsmInfo.get(), MRI.get(), STI.get()));
15011501
MCEInstance.LocalMOFI.reset(
1502-
TheTarget->createMCObjectFileInfo(*MCEInstance.LocalCtx.get(),
1502+
TheTarget->createMCObjectFileInfo(*MCEInstance.LocalCtx,
15031503
/*PIC=*/!HasFixedLoadAddress));
15041504
MCEInstance.LocalCtx->setObjectFileInfo(MCEInstance.LocalMOFI.get());
15051505
MCEInstance.MCE.reset(

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ class BinaryFunction {
142142
/// Types of profile the function can use. Could be a combination.
143143
enum {
144144
PF_NONE = 0, /// No profile.
145-
PF_LBR = 1, /// Profile is based on last branch records.
146-
PF_SAMPLE = 2, /// Non-LBR sample-based profile.
145+
PF_BRANCH = 1, /// Profile is based on branches or branch stacks.
146+
PF_BASIC = 2, /// Non-branch IP sample-based profile.
147147
PF_MEMEVENT = 4, /// Profile has mem events.
148148
};
149149

@@ -360,6 +360,11 @@ class BinaryFunction {
360360
/// True if the function is used for patching code at a fixed address.
361361
bool IsPatch{false};
362362

363+
/// True if the original entry point of the function may get called, but the
364+
/// original body cannot be executed and needs to be patched with code that
365+
/// redirects execution to the new function body.
366+
bool NeedsPatch{false};
367+
363368
/// True if the function should not have an associated symbol table entry.
364369
bool IsAnonymous{false};
365370

@@ -387,7 +392,7 @@ class BinaryFunction {
387392
float ProfileMatchRatio{0.0f};
388393

389394
/// Raw branch count for this function in the profile.
390-
uint64_t RawBranchCount{0};
395+
uint64_t RawSampleCount{0};
391396

392397
/// Dynamically executed function bytes, used for density computation.
393398
uint64_t SampleCountInBytes{0};
@@ -799,6 +804,19 @@ class BinaryFunction {
799804
return iterator_range<const_cfi_iterator>(cie_begin(), cie_end());
800805
}
801806

807+
/// Iterate over instructions (only if CFG is unavailable or not built yet).
808+
iterator_range<InstrMapType::iterator> instrs() {
809+
assert(!hasCFG() && "Iterate over basic blocks instead");
810+
return make_range(Instructions.begin(), Instructions.end());
811+
}
812+
iterator_range<InstrMapType::const_iterator> instrs() const {
813+
assert(!hasCFG() && "Iterate over basic blocks instead");
814+
return make_range(Instructions.begin(), Instructions.end());
815+
}
816+
817+
/// Returns whether there are any labels at Offset.
818+
bool hasLabelAt(unsigned Offset) const { return Labels.count(Offset) != 0; }
819+
802820
/// Iterate over all jump tables associated with this function.
803821
iterator_range<std::map<uint64_t, JumpTable *>::const_iterator>
804822
jumpTables() const {
@@ -862,15 +880,15 @@ class BinaryFunction {
862880
/// Returns if BinaryDominatorTree has been constructed for this function.
863881
bool hasDomTree() const { return BDT != nullptr; }
864882

865-
BinaryDominatorTree &getDomTree() { return *BDT.get(); }
883+
BinaryDominatorTree &getDomTree() { return *BDT; }
866884

867885
/// Constructs DomTree for this function.
868886
void constructDomTree();
869887

870888
/// Returns if loop detection has been run for this function.
871889
bool hasLoopInfo() const { return BLI != nullptr; }
872890

873-
const BinaryLoopInfo &getLoopInfo() { return *BLI.get(); }
891+
const BinaryLoopInfo &getLoopInfo() { return *BLI; }
874892

875893
bool isLoopFree() {
876894
if (!hasLoopInfo())
@@ -1372,6 +1390,9 @@ class BinaryFunction {
13721390
/// Return true if this function is used for patching existing code.
13731391
bool isPatch() const { return IsPatch; }
13741392

1393+
/// Return true if the function requires a patch.
1394+
bool needsPatch() const { return NeedsPatch; }
1395+
13751396
/// Return true if the function should not have associated symbol table entry.
13761397
bool isAnonymous() const { return IsAnonymous; }
13771398

@@ -1757,6 +1778,9 @@ class BinaryFunction {
17571778
IsPatch = V;
17581779
}
17591780

1781+
/// Mark the function for patching.
1782+
void setNeedsPatch(bool V) { NeedsPatch = V; }
1783+
17601784
/// Indicate if the function should have a name in the symbol table.
17611785
void setAnonymous(bool V) {
17621786
assert(isInjected() && "Only injected functions could be anonymous");
@@ -1882,11 +1906,11 @@ class BinaryFunction {
18821906

18831907
/// Return the raw profile information about the number of branch
18841908
/// executions corresponding to this function.
1885-
uint64_t getRawBranchCount() const { return RawBranchCount; }
1909+
uint64_t getRawSampleCount() const { return RawSampleCount; }
18861910

18871911
/// Set the profile data about the number of branch executions corresponding
18881912
/// to this function.
1889-
void setRawBranchCount(uint64_t Count) { RawBranchCount = Count; }
1913+
void setRawSampleCount(uint64_t Count) { RawSampleCount = Count; }
18901914

18911915
/// Return the number of dynamically executed bytes, from raw perf data.
18921916
uint64_t getSampleCountInBytes() const { return SampleCountInBytes; }

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class DIEBuilder {
137137
std::unordered_map<std::string, uint32_t> NameToIndexMap;
138138

139139
/// Returns current state of the DIEBuilder
140-
State &getState() { return *BuilderState.get(); }
140+
State &getState() { return *BuilderState; }
141141

142142
/// Resolve the reference in DIE, if target is not loaded into IR,
143143
/// pre-allocate it. \p RefCU will be updated to the Unit specific by \p

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class MCSymbol;
4949
class raw_ostream;
5050

5151
namespace bolt {
52+
class BinaryBasicBlock;
5253
class BinaryFunction;
5354

5455
/// Different types of indirect branches encountered during disassembly.
@@ -572,6 +573,11 @@ class MCPlusBuilder {
572573
return false;
573574
}
574575

576+
virtual MCPhysReg getSignedReg(const MCInst &Inst) const {
577+
llvm_unreachable("not implemented");
578+
return getNoRegister();
579+
}
580+
575581
virtual ErrorOr<MCPhysReg> getRegUsedAsRetDest(const MCInst &Inst) const {
576582
llvm_unreachable("not implemented");
577583
return getNoRegister();
@@ -622,6 +628,54 @@ class MCPlusBuilder {
622628
return std::make_pair(getNoRegister(), getNoRegister());
623629
}
624630

631+
/// Analyzes if a pointer is checked to be authenticated successfully
632+
/// by the end of the basic block.
633+
///
634+
/// It is possible for pointer authentication instructions not to terminate
635+
/// the program abnormally on authentication failure and return some invalid
636+
/// pointer instead (like it is done on AArch64 when FEAT_FPAC is not
637+
/// implemented). This might be enough to crash on invalid memory access when
638+
/// the pointer is later used as the destination of a load, store, or branch
639+
/// instruction. On the other hand, when the pointer is not used right away,
640+
/// it may be important for the compiler to check the address explicitly not
641+
/// to introduce a signing or authentication oracle.
642+
///
643+
/// This function is intended to detect a complex, multi-instruction pointer-
644+
/// checking sequence spanning a contiguous range of instructions at the end
645+
/// of the basic block (as these sequences are expected to end with a
646+
/// conditional branch - this is how they are implemented on AArch64 by LLVM).
647+
/// If a (Reg, FirstInst) pair is returned and before execution of FirstInst
648+
/// Reg was last written to by an authentication instruction, then it is known
649+
/// that in any successor of BB either
650+
/// * the authentication instruction that last wrote to Reg succeeded, or
651+
/// * the program is terminated abnormally without introducing any signing
652+
/// or authentication oracles
653+
///
654+
/// Note that this function is not expected to repeat the results returned
655+
/// by getAuthCheckedReg(Inst, MayOverwrite) function below.
656+
virtual std::optional<std::pair<MCPhysReg, MCInst *>>
657+
getAuthCheckedReg(BinaryBasicBlock &BB) const {
658+
llvm_unreachable("not implemented");
659+
return std::nullopt;
660+
}
661+
662+
/// Returns the register that is checked to be authenticated successfully.
663+
///
664+
/// If the returned register was last written to by an authentication
665+
/// instruction and that authentication failed, then the program is known
666+
/// to be terminated abnormally as a result of execution of Inst.
667+
///
668+
/// Additionally, if MayOverwrite is false, it is known that the authenticated
669+
/// pointer is not clobbered by Inst itself.
670+
///
671+
/// Use this function for simple, single-instruction patterns instead of
672+
/// its getAuthCheckedReg(BB) counterpart.
673+
virtual MCPhysReg getAuthCheckedReg(const MCInst &Inst,
674+
bool MayOverwrite) const {
675+
llvm_unreachable("not implemented");
676+
return getNoRegister();
677+
}
678+
625679
virtual bool isTerminator(const MCInst &Inst) const;
626680

627681
virtual bool isNoop(const MCInst &Inst) const {

bolt/include/bolt/Passes/FrameAnalysis.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define BOLT_PASSES_FRAMEANALYSIS_H
1111

1212
#include "bolt/Passes/StackPointerTracking.h"
13+
#include <tuple>
1314

1415
namespace llvm {
1516
namespace bolt {
@@ -53,9 +54,7 @@ struct ArgInStackAccess {
5354
uint8_t Size;
5455

5556
bool operator<(const ArgInStackAccess &RHS) const {
56-
if (StackOffset != RHS.StackOffset)
57-
return StackOffset < RHS.StackOffset;
58-
return Size < RHS.Size;
57+
return std::tie(StackOffset, Size) < std::tie(RHS.StackOffset, RHS.Size);
5958
}
6059
};
6160

0 commit comments

Comments
 (0)