Skip to content

Commit 00ec14f

Browse files
committed
Merge branch 'main' into xegpu-wg-sg-reduction
2 parents 100341d + ce5a115 commit 00ec14f

File tree

2,383 files changed

+123886
-42653
lines changed

Some content is hidden

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

2,383 files changed

+123886
-42653
lines changed

.ci/compute_projects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898

9999
EXCLUDE_WINDOWS = {
100100
"cross-project-tests", # TODO(issues/132797): Tests are failing.
101-
"compiler-rt", # TODO(issues/132798): Tests take excessive time.
102101
"openmp", # TODO(issues/132799): Does not detect perl installation.
103102
"libc", # No Windows Support.
104103
"lldb", # TODO(issues/132800): Needs environment setup.

.ci/compute_projects_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ def test_clang_windows(self):
110110
["clang/CMakeLists.txt"], "Windows"
111111
)
112112
self.assertEqual(
113-
env_variables["projects_to_build"], "clang;clang-tools-extra;llvm"
113+
env_variables["projects_to_build"], "clang;clang-tools-extra;lld;llvm"
114114
)
115115
self.assertEqual(
116116
env_variables["project_check_targets"], "check-clang check-clang-tools"
117117
)
118-
self.assertEqual(env_variables["runtimes_to_build"], "")
118+
self.assertEqual(env_variables["runtimes_to_build"], "compiler-rt")
119119
self.assertEqual(
120120
env_variables["runtimes_check_targets"],
121-
"",
121+
"check-compiler-rt",
122122
)
123123
self.assertEqual(
124124
env_variables["runtimes_check_targets_needs_reconfig"],
@@ -318,11 +318,11 @@ def test_windows_ci(self):
318318
)
319319
self.assertEqual(
320320
env_variables["runtimes_to_build"],
321-
"",
321+
"compiler-rt",
322322
)
323323
self.assertEqual(
324324
env_variables["runtimes_check_targets"],
325-
"",
325+
"check-compiler-rt",
326326
)
327327
self.assertEqual(
328328
env_variables["runtimes_check_targets_needs_reconfig"],

.ci/monolithic-linux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
6161
-D LLDB_ENABLE_PYTHON=ON \
6262
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
6363
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
64-
-D CMAKE_EXE_LINKER_FLAGS="-no-pie"
64+
-D CMAKE_EXE_LINKER_FLAGS="-no-pie" \
65+
-D LLVM_ENABLE_WERROR=ON
6566

6667
start-group "ninja"
6768

.ci/monolithic-windows.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ source .ci/utils.sh
1717

1818
projects="${1}"
1919
targets="${2}"
20+
runtimes="${3}"
21+
runtimes_targets="${4}"
2022

2123
start-group "CMake"
2224
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
@@ -46,9 +48,14 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4648
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
4749
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
4850
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
49-
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO"
51+
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
52+
-D LLVM_ENABLE_RUNTIMES="${runtimes}"
5053

5154
start-group "ninja"
5255

5356
# Targets are not escaped as they are passed as separate arguments.
5457
ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
58+
59+
start-group "ninja runtimes"
60+
61+
ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log

.github/workflows/premerge.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,21 @@ jobs:
108108
109109
echo "Building projects: ${projects_to_build}"
110110
echo "Running project checks targets: ${project_check_targets}"
111+
echo "Building runtimes: ${runtimes_to_build}"
112+
echo "Running runtimes checks targets: ${runtimes_check_targets}"
111113
112114
echo "windows-projects=${projects_to_build}" >> $GITHUB_OUTPUT
113115
echo "windows-check-targets=${project_check_targets}" >> $GITHUB_OUTPUT
116+
echo "windows-runtimes=${runtimes_to_build}" >> $GITHUB_OUTPUT
117+
echo "windows-runtimes-check-targets=${runtimes_check_targets}" >> $GITHUB_OUTPUT
114118
- name: Build and Test
115119
if: ${{ steps.vars.outputs.windows-projects != '' }}
116120
shell: cmd
117121
run: |
118122
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
119123
# See the comments above in the Linux job for why we define each of
120124
# these environment variables.
121-
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; mkdir artifacts; SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\""
125+
bash -c "export SCCACHE_GCS_BUCKET=$CACHE_GCS_BUCKET; export SCCACHE_GCS_RW_MODE=READ_WRITE; export SCCACHE_IDLE_TIMEOUT=0; mkdir artifacts; SCCACHE_LOG=info SCCACHE_ERROR_LOG=$(pwd)/artifacts/sccache.log sccache --start-server; .ci/monolithic-windows.sh \"${{ steps.vars.outputs.windows-projects }}\" \"${{ steps.vars.outputs.windows-check-targets }}\" \"${{ steps.vars.outputs.windows-runtimes }}\" \"${{ steps.vars.outputs.windows-runtimes-check-targets }}\""
122126
- name: Upload Artifacts
123127
# In some cases, Github will fail to upload the artifact. We want to
124128
# continue anyways as a failed artifact upload is an infra failure, not

bolt/lib/Core/BinaryContext.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,23 +1568,19 @@ unsigned BinaryContext::addDebugFilenameToUnit(const uint32_t DestCUID,
15681568
DWARFCompileUnit *SrcUnit = DwCtx->getCompileUnitForOffset(SrcCUID);
15691569
const DWARFDebugLine::LineTable *LineTable =
15701570
DwCtx->getLineTableForUnit(SrcUnit);
1571-
const std::vector<DWARFDebugLine::FileNameEntry> &FileNames =
1572-
LineTable->Prologue.FileNames;
1573-
// Dir indexes start at 1, as DWARF file numbers, and a dir index 0
1571+
const DWARFDebugLine::FileNameEntry &FileNameEntry =
1572+
LineTable->Prologue.getFileNameEntry(FileIndex);
1573+
// Dir indexes start at 1 and a dir index 0
15741574
// means empty dir.
1575-
assert(FileIndex > 0 && FileIndex <= FileNames.size() &&
1576-
"FileIndex out of range for the compilation unit.");
15771575
StringRef Dir = "";
1578-
if (FileNames[FileIndex - 1].DirIdx != 0) {
1576+
if (FileNameEntry.DirIdx != 0) {
15791577
if (std::optional<const char *> DirName = dwarf::toString(
1580-
LineTable->Prologue
1581-
.IncludeDirectories[FileNames[FileIndex - 1].DirIdx - 1])) {
1578+
LineTable->Prologue.IncludeDirectories[FileNameEntry.DirIdx - 1])) {
15821579
Dir = *DirName;
15831580
}
15841581
}
15851582
StringRef FileName = "";
1586-
if (std::optional<const char *> FName =
1587-
dwarf::toString(FileNames[FileIndex - 1].Name))
1583+
if (std::optional<const char *> FName = dwarf::toString(FileNameEntry.Name))
15881584
FileName = *FName;
15891585
assert(FileName != "");
15901586
DWARFCompileUnit *DstUnit = DwCtx->getCompileUnitForOffset(DestCUID);
@@ -1925,7 +1921,7 @@ static void printDebugInfo(raw_ostream &OS, const MCInst &Instruction,
19251921
const DWARFDebugLine::Row &Row = LineTable->Rows[RowRef.RowIndex - 1];
19261922
StringRef FileName = "";
19271923
if (std::optional<const char *> FName =
1928-
dwarf::toString(LineTable->Prologue.FileNames[Row.File - 1].Name))
1924+
dwarf::toString(LineTable->Prologue.getFileNameEntry(Row.File).Name))
19291925
FileName = *FName;
19301926
OS << " # debug line " << FileName << ":" << Row.Line;
19311927
if (Row.Column)

bolt/runtime/instr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,11 @@ static char *getBinaryPath() {
714714
uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
715715
assert(Ret != -1 && Ret != BufSize, "readlink error");
716716
TargetPath[Ret] = '\0';
717+
__close(FDdir);
717718
return TargetPath;
718719
}
719720
}
721+
__close(FDdir);
720722
return nullptr;
721723
}
722724

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# REQUIRES: system-linux
2+
3+
## Check that BOLT correctly prints debug line comments for DWARF-5.
4+
5+
6+
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
7+
# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q
8+
# RUN: llvm-bolt %t.exe --update-debug-sections --print-debug-info \
9+
# RUN: --print-after-lowering -o %t.bolt | FileCheck %s
10+
11+
# CHECK: xorq %rdi, %rdi # debug line main.c:2:5
12+
13+
# __attribute__((naked)) void _start() {
14+
# __asm__(
15+
# "xor %rdi, %rdi\n" // exit code 0
16+
# "mov $60, %rax\n" // syscall number for exit
17+
# "syscall\n"
18+
# );
19+
# }
20+
21+
.file "main.c"
22+
.text
23+
.globl _start # -- Begin function _start
24+
.p2align 4
25+
.type _start,@function
26+
_start: # @_start
27+
.Lfunc_begin0:
28+
.file 0 "/home/gpastukhov/tmp2" "main.c" md5 0x94c0e54a615c2a21415ddb904991abd8
29+
.cfi_startproc
30+
# %bb.0:
31+
.loc 0 2 5 prologue_end # main.c:2:5
32+
#APP
33+
xorq %rdi, %rdi
34+
movq $60, %rax
35+
syscall
36+
37+
#NO_APP
38+
.Ltmp0:
39+
.Lfunc_end0:
40+
.size _start, .Lfunc_end0-_start
41+
.cfi_endproc
42+
# -- End function
43+
.section .debug_abbrev,"",@progbits
44+
.byte 1 # Abbreviation Code
45+
.byte 17 # DW_TAG_compile_unit
46+
.byte 1 # DW_CHILDREN_yes
47+
.byte 37 # DW_AT_producer
48+
.byte 37 # DW_FORM_strx1
49+
.byte 19 # DW_AT_language
50+
.byte 5 # DW_FORM_data2
51+
.byte 3 # DW_AT_name
52+
.byte 37 # DW_FORM_strx1
53+
.byte 114 # DW_AT_str_offsets_base
54+
.byte 23 # DW_FORM_sec_offset
55+
.byte 16 # DW_AT_stmt_list
56+
.byte 23 # DW_FORM_sec_offset
57+
.byte 27 # DW_AT_comp_dir
58+
.byte 37 # DW_FORM_strx1
59+
.byte 17 # DW_AT_low_pc
60+
.byte 27 # DW_FORM_addrx
61+
.byte 18 # DW_AT_high_pc
62+
.byte 6 # DW_FORM_data4
63+
.byte 115 # DW_AT_addr_base
64+
.byte 23 # DW_FORM_sec_offset
65+
.byte 0 # EOM(1)
66+
.byte 0 # EOM(2)
67+
.byte 2 # Abbreviation Code
68+
.byte 46 # DW_TAG_subprogram
69+
.byte 0 # DW_CHILDREN_no
70+
.byte 17 # DW_AT_low_pc
71+
.byte 27 # DW_FORM_addrx
72+
.byte 18 # DW_AT_high_pc
73+
.byte 6 # DW_FORM_data4
74+
.byte 64 # DW_AT_frame_base
75+
.byte 24 # DW_FORM_exprloc
76+
.byte 3 # DW_AT_name
77+
.byte 37 # DW_FORM_strx1
78+
.byte 58 # DW_AT_decl_file
79+
.byte 11 # DW_FORM_data1
80+
.byte 59 # DW_AT_decl_line
81+
.byte 11 # DW_FORM_data1
82+
.byte 63 # DW_AT_external
83+
.byte 25 # DW_FORM_flag_present
84+
.byte 0 # EOM(1)
85+
.byte 0 # EOM(2)
86+
.byte 0 # EOM(3)
87+
.section .debug_info,"",@progbits
88+
.Lcu_begin0:
89+
.long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
90+
.Ldebug_info_start0:
91+
.short 5 # DWARF version number
92+
.byte 1 # DWARF Unit Type
93+
.byte 8 # Address Size (in bytes)
94+
.long .debug_abbrev # Offset Into Abbrev. Section
95+
.byte 1 # Abbrev [1] 0xc:0x23 DW_TAG_compile_unit
96+
.byte 0 # DW_AT_producer
97+
.short 29 # DW_AT_language
98+
.byte 1 # DW_AT_name
99+
.long .Lstr_offsets_base0 # DW_AT_str_offsets_base
100+
.long .Lline_table_start0 # DW_AT_stmt_list
101+
.byte 2 # DW_AT_comp_dir
102+
.byte 0 # DW_AT_low_pc
103+
.long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
104+
.long .Laddr_table_base0 # DW_AT_addr_base
105+
.byte 2 # Abbrev [2] 0x23:0xb DW_TAG_subprogram
106+
.byte 0 # DW_AT_low_pc
107+
.long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
108+
.byte 1 # DW_AT_frame_base
109+
.byte 87
110+
.byte 3 # DW_AT_name
111+
.byte 0 # DW_AT_decl_file
112+
.byte 1 # DW_AT_decl_line
113+
# DW_AT_external
114+
.byte 0 # End Of Children Mark
115+
.Ldebug_info_end0:
116+
.section .debug_str_offsets,"",@progbits
117+
.long 20 # Length of String Offsets Set
118+
.short 5
119+
.short 0
120+
.Lstr_offsets_base0:
121+
.section .debug_str,"MS",@progbits,1
122+
.Linfo_string0:
123+
.asciz "clang version 20.1.8 (CentOS 20.1.8-1.el9)" # string offset=0
124+
.Linfo_string1:
125+
.asciz "main.c" # string offset=43
126+
.Linfo_string2:
127+
.asciz "/home/gpastukhov/tmp2" # string offset=50
128+
.Linfo_string3:
129+
.asciz "_start" # string offset=72
130+
.section .debug_str_offsets,"",@progbits
131+
.long .Linfo_string0
132+
.long .Linfo_string1
133+
.long .Linfo_string2
134+
.long .Linfo_string3
135+
.section .debug_addr,"",@progbits
136+
.long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
137+
.Ldebug_addr_start0:
138+
.short 5 # DWARF version number
139+
.byte 8 # Address size
140+
.byte 0 # Segment selector size
141+
.Laddr_table_base0:
142+
.quad .Lfunc_begin0
143+
.Ldebug_addr_end0:
144+
.ident "clang version 20.1.8 (CentOS 20.1.8-1.el9)"
145+
.section ".note.GNU-stack","",@progbits
146+
.addrsig
147+
.section .debug_line,"",@progbits
148+
.Lline_table_start0:

0 commit comments

Comments
 (0)