Skip to content

Commit 6af11fe

Browse files
rebase
Created using spr 1.3.6
2 parents 0e133eb + 862f69a commit 6af11fe

File tree

336 files changed

+9111
-2443
lines changed

Some content is hidden

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

336 files changed

+9111
-2443
lines changed

.ci/utils.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function at-exit {
2424
retcode=$?
2525

2626
mkdir -p artifacts
27+
sccache --show-stats
2728
sccache --show-stats >> artifacts/sccache_stats.txt
2829
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
2930
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :

.github/new-prs-labeler.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ LTO:
9090
- llvm/lib/Transforms/*/FunctionImport*
9191
- llvm/tools/gold/**
9292

93-
mc:
94-
- llvm/*/MC/**
95-
9693
clang:driver:
9794
- clang/*/Driver/**
9895

@@ -621,6 +618,12 @@ llvm:adt:
621618
llvm:support:
622619
- llvm/**/Support/**
623620

621+
# Skip llvm/test/MC and llvm/unittests/MC, which includes target-specific directories.
622+
llvm:mc:
623+
- llvm/include/llvm/MC/**
624+
- llvm/lib/MC/**
625+
- llvm/tools/llvm-mc/**
626+
624627
llvm:transforms:
625628
- llvm/lib/Transforms/**
626629
- llvm/include/llvm/Transforms/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ RUN curl -L 'https://github.com/mozilla/sccache/releases/download/v0.10.0/sccach
8181

8282
ENV LLVM_SYSROOT=$LLVM_SYSROOT
8383
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
84+
ENV CC=clang
85+
ENV CXX=clang++
8486

8587
# Create a new user to avoid test failures related to a lack of expected
8688
# permissions issues in some tests. Set the user id to 1001 as that is the

.github/workflows/libclang-python-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ permissions:
44
contents: read
55

66
on:
7-
workflow_dispatch:
87
push:
98
branches:
109
- 'main'
@@ -13,14 +12,12 @@ on:
1312
- 'clang/tools/libclang/**'
1413
- 'clang/CMakeList.txt'
1514
- '.github/workflows/libclang-python-tests.yml'
16-
- '.github/workflows/llvm-project-tests.yml'
1715
pull_request:
1816
paths:
1917
- 'clang/bindings/python/**'
2018
- 'clang/tools/libclang/**'
2119
- 'clang/CMakeList.txt'
2220
- '.github/workflows/libclang-python-tests.yml'
23-
- '.github/workflows/llvm-project-tests.yml'
2421

2522
jobs:
2623
check-clang-python:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ autoconf/autom4te.cache
5252
# CLion project configuration
5353
/.idea
5454
/cmake-build*
55+
# Coding assistants' stuff
56+
/CLAUDE.md
57+
/.claude/
58+
/GEMINI.md
59+
/.gemini/
5560

5661
#==============================================================================#
5762
# Directories to ignore (do not add trailing '/'s, they skip symlinks).

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,10 @@ class MCPlusBuilder {
740740
return false;
741741
}
742742

743+
/// Return true if the hlt instruction under the x86, otherwise, default to
744+
/// false.
745+
virtual bool isX86HLT(const MCInst &Inst) const { return false; }
746+
743747
/// Return the width, in bytes, of the memory access performed by \p Inst, if
744748
/// this is a pop instruction. Return zero otherwise.
745749
virtual int getPopSize(const MCInst &Inst) const {

bolt/lib/Core/MCPlusBuilder.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ bool MCPlusBuilder::equals(const MCSpecifierExpr &A, const MCSpecifierExpr &B,
132132
}
133133

134134
bool MCPlusBuilder::isTerminator(const MCInst &Inst) const {
135-
return Analysis->isTerminator(Inst) ||
136-
(opts::TerminalTrap && Info->get(Inst.getOpcode()).isTrap());
135+
return (opts::TerminalTrap && Info->get(Inst.getOpcode()).isTrap()) ||
136+
Analysis->isTerminator(Inst)
137+
? !isX86HLT(Inst)
138+
: false;
137139
}
138140

139141
void MCPlusBuilder::setTailCall(MCInst &Inst) const {

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ class X86MCPlusBuilder : public MCPlusBuilder {
223223
return Inst.getOpcode() == X86::ENDBR32 || Inst.getOpcode() == X86::ENDBR64;
224224
}
225225

226+
bool isX86HLT(const MCInst &Inst) const override {
227+
return Inst.getOpcode() == X86::HLT;
228+
}
229+
226230
int getPopSize(const MCInst &Inst) const override {
227231
switch (Inst.getOpcode()) {
228232
case X86::POP16r:

bolt/test/X86/cfg_build_hlt.s

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Check CFG for halt instruction
2+
3+
# RUN: %clang %cflags %s -static -o %t.exe -nostdlib
4+
# RUN: llvm-bolt %t.exe --print-cfg --print-only=main -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-CFG
5+
# RUN: llvm-objdump -d %t --print-imm-hex | FileCheck %s --check-prefix=CHECK-BIN
6+
7+
# CHECK-CFG: BB Count : 1
8+
# CHECK-BIN: <main>:
9+
# CHECK-BIN-NEXT: f4 hlt
10+
# CHECK-BIN-NEXT: c3 retq
11+
12+
.global main
13+
.type main, %function
14+
main:
15+
hlt
16+
retq
17+
.size main, .-main
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %check_clang_tidy -std=c++20 %s modernize-type-traits %t
2+
3+
namespace std {
4+
template <class> struct tuple_size {
5+
static const int value = 1;
6+
};
7+
template <int, class> struct tuple_element {
8+
using type = int;
9+
};
10+
}
11+
12+
struct A {};
13+
template <int> int get(const A&);
14+
15+
auto [a] = A();

0 commit comments

Comments
 (0)