Aviad Cohen
d5c8024dae
[mlir][bazel]: Add FuncUtil rule in bazel files ( #145463 )
2025-06-24 10:40:57 +03:00
Benjamin Kramer
9881a507a2
[bazel] Port 8584b216b8
2025-06-23 14:31:15 +02:00
Benjamin Kramer
7e77aaebfb
[bazel] Add missing dependency for 4af96a9d83
2025-06-23 13:37:45 +02:00
Benjamin Kramer
bd809ffb4b
[bazel] Make lld:ELF glob wider so it doesn't break as easily
2025-06-23 13:32:30 +02:00
Benjamin Kramer
680bce0072
[bazel] Add missing dependency for c7165587e4
2025-06-23 13:28:57 +02:00
NAKAMURA Takumi
ad36800d65
[bazel][lld] Follow up 491b82a5ec (llvmorg-21-init-16192-g491b82a5ec1a)
2025-06-21 07:50:35 +09:00
Yijia Gu
bae48ac3c0
[mlir][bazel] add missing deps for XeGPUTransforms
2025-06-20 11:14:14 -07:00
Karlo Basioli
fdb572681d
Fix bazel build after #144594 ( #144904 )
2025-06-19 15:50:53 +01:00
Jakub Kuderski
96bbe472ef
Revert "[mlir][spirv] Fix int type declaration duplication when serializing" and follow up commits ( #144773 )
...
This reverts the following PRs:
* https://github.com/llvm/llvm-project/pull/143108
* https://github.com/llvm/llvm-project/pull/144538
* https://github.com/llvm/llvm-project/pull/144685
Reverting because this disabled tests when building without the llvm
spirv backend enabled.
2025-06-18 16:15:06 -04:00
Karlo Basioli
2a41350aab
Fix bazel build issue caused by #142986 second attempt ( #144721 didnt… ( #144743 )
...
… cover everything)
2025-06-18 17:15:12 +01:00
Karlo Basioli
8fc20bffab
Fix bazel build issue caused by 142986 ( #144721 )
2025-06-18 16:07:56 +01:00
Karlo Basioli
5a9cc93a20
Fix for bazel build #142079 ( #144665 )
2025-06-18 10:57:03 +01:00
Karlo Basioli
58c4fa96cb
Fix bazel build for #142771 ( #144659 )
2025-06-18 10:21:37 +01:00
Yijia Gu
0cfc59ff51
[mlir][bazel] remove extra empty space for XeGPUTransforms
2025-06-17 10:56:31 -07:00
Yijia Gu
030b5519ec
[mlir][bazel] add missing deps for XeGPUTransforms
2025-06-17 10:52:34 -07:00
Karlo Basioli
7ec103a984
Port #143108 to bazel ( #144538 )
2025-06-17 15:52:33 +01:00
Benjamin Kramer
de3339063a
[bazel] Port b4e39e4ff9
2025-06-17 15:44:30 +02:00
Karlo Basioli
dfd00edbab
Fix for #144391 not fully addressed by #144484 ( #144488 )
2025-06-17 10:37:18 +01:00
Karlo Basioli
64bd4858dc
Amend enviroment variables in bazel - change from #144391 ( #144484 )
2025-06-17 10:09:10 +01:00
Jorge Gorbe Moya
199428e047
[bazel][lld] Remove unneeded dependencies. ( #144455 )
...
As far as I can tell these are not used in any includes in their
respective targets, and building all of LLD with
```
bazel build --config=generic_clang @llvm-project//lld/...
```
still works.
2025-06-16 20:41:40 -07:00
Jacques Pienaar
9e16792639
[mlir][bzl] Add CAPIIndex rule. ( #144248 )
2025-06-14 23:35:20 -07:00
Jorge Gorbe Moya
15f100d144
[bazel] fix mlir/tblgen.bzl formatting after 6e988bd33f
2025-06-13 17:17:20 -07:00
Jorge Gorbe Moya
2c440232e2
[bazel][libc] Add missing deps after 51689c9df2
2025-06-13 15:07:14 -07:00
Reid Kleckner
52a6492136
[bazel] Add missing errno deps one more time
2025-06-13 20:32:21 +00:00
Reid Kleckner
acc58ac8bf
[bazel] Add missing dep for 52d34865b9 ( #144147 )
2025-06-13 12:37:20 -07:00
Reid Kleckner
f6bf3bd5e0
[bazel] Fix XeGpu deps for 5578bcbcfd ( #144133 )
2025-06-13 11:08:15 -07:00
Michael Jones
51689c9df2
[libc][NFC] clean internal fd handling ( #143991 )
...
The previous internal fcntl implementation modified errno directly, this
patch fixes that. This patch also moves open and close into OSUtil since
they are used in multiple places. There are more places that need
similar cleanup but only got comments in this patch to keep it
relatively reviewable.
Related to: https://github.com/llvm/llvm-project/issues/143937
2025-06-13 10:31:47 -07:00
Reid Kleckner
ec330cf670
[bazel] Update llvm-config.h and disable DebugLoc tracking ( #144125 )
...
In c588224ca7 , @chapuni set
LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING to 1, but from what I can tell,
this is not the default setting for CMake builds. I think the intention
was mostly just to update llvm-config.h to fix the Bazel build.
I'm adding LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING as well to fix the build
for the same purpose.
2025-06-13 10:31:35 -07:00
Reid Kleckner
6e988bd33f
[mlir] Forward **kwargs through gentbl_shard_rule ( #144001 )
...
This allows clients to pass additional cc_library arguments through this
macro to the build rules it calls.
2025-06-13 09:56:57 -07:00
Reid Kleckner
e1bb35d067
[bazel] Fix modules build for llvm-libc (speculative) ( #143995 )
2025-06-12 16:52:32 -07:00
lntue
d1ca8d891f
[libc][math] Refactor expf implementation to header-only in src/__support/math folder. ( #143790 )
...
This is a step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-06-12 13:18:30 -04:00
Jorge Gorbe Moya
6c72084a57
[bazel] port 1ecd108cb7
2025-06-11 16:57:14 -07:00
lntue
d87eea35fa
[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. ( #143187 )
...
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-06-11 16:25:27 -04:00
Jorge Gorbe Moya
c70658e32d
[bazel] port 5dafe9dca8
2025-06-11 13:09:11 -07:00
Jorge Gorbe Moya
d5f68cb145
[bazel] Port fe7bf4b90b
2025-06-11 12:10:09 -07:00
Yifei Xu
8d7da9a2a4
Update BUILD.bazel
...
Add missing dependency after https://github.com/llvm/llvm-project/pull/142916 .
2025-06-11 13:33:23 -05:00
NAKAMURA Takumi
ee3f50939d
[bazel] Turn on LLVM_ENABLE_PLUGINS on posix
...
Since #141650 , `LLVM_ABI inline` has had different linkage regarding
to LLVM_ENABLE_PLUGINS.
This was introduced in 8830e3802a (llvmorg-21-init-14426-g8830e3802a92)
but reverted in #143419 due to breakage of msvc build.
2025-06-10 21:41:33 +09:00
Yifei Xu
787efa78a4
[bazel] Revert "[bazel] llvm-config.h: Turn on LLVM_ENABLE_PLUGINS" as it fails TensorFlow Windows build ( #143419 )
...
Here is the error message
[3,466 / 5,762] 1 / 149 tests; [Sched] Compiling
llvm/lib/Support/BinaryStreamError.cpp ... (456 actions, 2 running)
ERROR: C:/t/g5cdusdm/external/llvm-project/llvm/BUILD.bazel:253:11:
Compiling llvm/lib/Support/ExtensibleRTTI.cpp [for tool] failed: (Exit
1): clang-cl.exe failed: error executing CppCompile command (from target
@@llvm-project//llvm:Support)
cd /d C:/t/g5cdusdm/execroot/org_tensorflow
SET INCLUDE=C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Tools\MSVC\14.42.34433\include;C:\Program
Files\Microsoft Visual
Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files
(x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files
(x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files
(x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files
(x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files
(x86)\Windows
Kits\10\\include\10.0.22621.0\\cppwinrt;C:\tools\LLVM\lib\clang\18\include
SET PATH=C:\Program Files\Microsoft Visual
Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64;C:\Program
Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program
Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program
Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team
Explorer;C:\Program Files\Microsoft Visual
Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files
(x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files
(x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual
Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program
Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program
Files\Microsoft Visual
Studio\2022\Community\Common7\Tools\;;C:\Windows\system32;C:\Program
Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
SET PWD=/proc/self/cwd
SET TEMP=C:\TMP
SET TMP=C:\TMP
SET VSLANG=1033
C:\tools\LLVM\bin\clang-cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX
/D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE
/D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250
/wd4996 /Iexternal/llvm-project
/Ibazel-out/x64_windows-opt-exec-ST-766941a09caf/bin/external/llvm-project
/Iexternal/llvm-project/llvm/include
/Ibazel-out/x64_windows-opt-exec-ST-766941a09caf/bin/external/llvm-project/llvm/include
/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS
/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_NONSTDC_NO_WARNINGS
/D_SCL_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS /DUNICODE
/D_UNICODE /DLTDL_SHLIB_EXT=".dll" /DLLVM_PLUGIN_EXT=".dll"
/DLLVM_NATIVE_ARCH="X86"
/DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser
/DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter
/DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler
/DLLVM_NATIVE_TARGET=LLVMInitializeX86Target
/DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86TargetInfo
/DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC
/DLLVM_NATIVE_TARGETMCA=LLVMInitializeX86TargetMCA
/DLLVM_HOST_TRIPLE="x86_64-pc-win32"
/DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-pc-win32" /DLLVM_VERSION_MAJOR=21
/DLLVM_VERSION_MINOR=0 /DLLVM_VERSION_PATCH=0
/DLLVM_VERSION_STRING="21.0.0git" /D__STDC_LIMIT_MACROS
/D__STDC_CONSTANT_MACROS /D__STDC_FORMAT_MACROS
/DLLVM_HAS_AArch64_TARGET=1 /DLLVM_HAS_AMDGPU_TARGET=1
/DLLVM_HAS_ARM_TARGET=1 /DLLVM_HAS_NVPTX_TARGET=1
/DLLVM_HAS_PowerPC_TARGET=1 /DLLVM_HAS_RISCV_TARGET=1
/DLLVM_HAS_SystemZ_TARGET=1 /DLLVM_HAS_X86_TARGET=1 /DBLAKE3_USE_NEON=0
/DBLAKE3_NO_AVX2 /DBLAKE3_NO_AVX512 /DBLAKE3_NO_SSE2 /DBLAKE3_NO_SSE41
/showIncludes /MD /O2 /Oy- /DNDEBUG /wd4117 -D__DATE__="redacted"
-D__TIMESTAMP__="redacted" -D__TIME__="redacted"
-Wno-builtin-macro-redefined /Gy /Gw /W0 /Zc:__cplusplus
/D_USE_MATH_DEFINES /d2ReducedOptimizeHugeFunctions
-D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN32_LEAN_AND_MEAN -DNOGDI
/Zc:preprocessor /clang:-Weverything /clang:-Weverything
/d2ReducedOptimizeHugeFunctions /std:c++17
/Fobazel-out/x64_windows-opt-exec-ST-766941a09caf/bin/external/llvm-project/llvm/_objs/Support/ExtensibleRTTI.obj
/c external/llvm-project/llvm/lib/Support/ExtensibleRTTI.cpp
# Configuration:
f85b29406574d83c673497718f542456050c5649ae41eb37a803b7085e15c4ef
# Execution platform:
//tensorflow/tools/toolchains/win2022:windows_ltsc2022_clang
external/llvm-project/llvm/lib/Support/ExtensibleRTTI.cpp(12,22): error:
definition of dllimport static field not allowed
12 | char llvm::RTTIRoot::ID = 0;
| ^
external/llvm-project/llvm/include\llvm/Support/ExtensibleRTTI.h(71,7):
note: attribute is here
71 | class LLVM_ABI RTTIRoot {
| ^
external/llvm-project/llvm/include\llvm/Support/Compiler.h(205,29):
note: expanded from macro 'LLVM_ABI'
205 | #define LLVM_ABI __declspec(dllimport)
| ^
1 error generated.
2025-06-09 12:41:47 -07:00
Chenguang Wang
b7ef3e7a85
[bazel] Fix llvm-min-tblgen bazel build ( #143213 )
...
Broken by 7b2aa02a . Tested with:
bazelisk build \
@llvm-project//llvm:llvm-min-tblgen \
@llvm-project//llvm:FrontendOpenACC \
@llvm-project//llvm:FrontendOpenMP \
@llvm-project//llvm:TableGen
2025-06-06 15:33:23 -07:00
Michael Jones
59f88a8e92
[libc] clean up string_utils memory functions ( #143031 )
...
The string_utils.h file previously included both memcpy and bzero. There
were no uses of bzero, and only one use of memcpy which was replaced
with __builtin_memcpy.
Also fix strsep which was broken by this change, fix a useless assert of
"sizeof(char) == sizeof(cpp::byte)", and update the bazel.
2025-06-06 11:16:54 -07:00
Jordan Rupprecht
5537733a04
[bazel] Port #140572 ( #143110 )
...
Commit b9d3a644c2
2025-06-06 06:06:46 -05:00
Jordan Rupprecht
fb5baef89b
[bazel] Port #135636 ( #143109 )
...
Commit 44a047c929
2025-06-06 05:52:30 -05:00
Chenguang Wang
9eb90c2139
[bazel] Fix LLVM plugin tests under Analysis. ( #142999 )
...
Those tests were broken on bazel as a side effect of 8830e380 .
This commit is tested with this command on Linux:
bazelisk test \
@llvm-project//llvm/unittests:analysis_tests \
@llvm-project//llvm/unittests:plugin_inline_advisor_analysis_test \
@llvm-project//llvm/unittests:plugin_inline_order_analysis_test
2025-06-05 09:58:17 -07:00
Jordan Rupprecht
578c75e9f7
Revert "[libc][bazel] Support generating public libc headers in Bazel builds. ( #141256 )" ( #143001 )
...
This reverts commit 27143f2929 . It causes
some downstream failures when bootstrapping builds.
2025-06-05 11:24:47 -05:00
NAKAMURA Takumi
8830e3802a
[bazel] llvm-config.h: Turn on LLVM_ENABLE_PLUGINS
...
Since #141650 , `LLVM_ABI inline` has had different linkage regarding
to LLVM_ENABLE_PLUGINS. This doesn't intend Bazel build would
introduce plugins.
2025-06-05 22:38:55 +09:00
Rahul Joshi
e53ccb78e4
[LLVM][MC] Introduce OrFail variants of MCD ops ( #138614 )
...
Introduce `OrFail` variants for all MCD Decoder Ops that have
`NumToSKip` encoded with them. This is intended to capture the common
case of jumps to the end of the decoder table which has a `OP_Fail` at
the end. Using the `OrFail` variants of these ops avoid encoding the
`NumToSkip` jump offset for these cases, resulting in a reduction in the
size of the decoder tables (from 5 - 17%). Additionally, for the AArch64
target, the table size reduces enough to switch to using 2-byte
`NumToSkip` encoding instead of existing 3-bytes, resulting in a net 30%
reduction in the size of the decoder table.
The total reduction in the size of the decoder tables for different
targets is as follows (computed using the following command: `for i in
*.inc; do echo -n ``basename $i: ``; grep "MCD::OPC_Fail," $i | awk
'{sum += $2} END { print sum}'; done`)
```
Target Old Size New Size % Reduction
================================================
AArch64 153268 106987 30.20
AMDGPU 412056 340856 17.28
ARC 5061 4605 9.01
ARM 73831 60847 17.59
AVR 1306 1158 11.33
BPF 1927 1795 6.85
CSKY 8692 6922 20.36
Hexagon 41965 34759 17.17
Lanai 982 924 5.91
LoongArch 21629 20035 7.37
M68k 13461 11689 13.16
MSP430 3716 3384 8.93
Mips 31415 25771 17.97
PPC 28931 24771 14.38
RISCV 34800 28352 18.53
Sparc 7432 6236 16.09
SystemZ 32248 29716 7.85
VE 42873 36923 13.88
XCore 2316 2196 5.18
Xtensa 3443 2793 18.88
```
2025-06-05 06:17:50 -07:00
Jordan Rupprecht
2917040642
[bazel] Port #141332 ( #142890 )
...
Commit e4c8ff94e7
2025-06-04 22:20:49 -05:00
Jordan Rupprecht
7578922d71
[bazel] Fix one missed target also broken by ff844df719 ( #142854 )
...
a4320ba67b fixed most targets but missed
one.
2025-06-04 16:09:58 -05:00
Chenguang Wang
a4320ba67b
[bazel] fix libc bazel build broken by ff844df7. ( #142848 )
...
Fixes `bazelisk test @llvm-project//libc/test/src/string/...`
2025-06-04 13:42:45 -07:00
Chenguang Wang
6dd3891b72
[bazel] fix bazel build broken by d96447b4. ( #142841 )
2025-06-04 13:09:52 -07:00