2988 Commits

Author SHA1 Message Date
Jordan Rupprecht
fb4450c459
[bazel] Add more load statements for C++ rules (#154207)
Same thing as #149584, but for more elements of cc_rules (e.g.
`CcInfo`), and applying it to some files that were added since then
(build files under mlir/examples).

Command: `buildifier --lint=fix
--warnings=native-cc-binary,native-cc-import,native-cc-library,native-cc-objc-import,native-cc-objc-library,native-cc-shared-library,native-cc-test,native-cc-toolchain,native-cc-toolchain-suite,native-cc-fdo-prefetch-hints,native-cc-fdo-profile,native-cc-memprof-profile,native-cc-propeller-optimize,native-cc-common,native-cc-debug-package-info,native-cc-info,native-cc-shared-library-info,native-cc-shared-library-hint-info`
2025-08-18 19:41:49 -05:00
Muhammad Bassiouni
2c79dc1082
[libc][math] Refactor coshf16 implementation to header-only in src/__support/math folder. (#153582)
Part of #147386

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-08-19 02:08:07 +03:00
Jordan Rupprecht
462929183c
[bazel] Port #153497: reland clang modules scanner change (#154192) 2025-08-18 20:15:12 +00:00
Jordan Rupprecht
8d256733a0
[bazel] Port #151175: VectorFromElementsLowering (#154169) 2025-08-18 13:07:05 -05:00
Chenguang Wang
e68989b930
[bazel] Fix //mlir:XeGPUDialect compilation. (#153904)
Broken by https://github.com/llvm/llvm-project/pull/153273.
2025-08-15 23:45:32 +00:00
Chenguang Wang
eecbaac5c6
[bazel] Add yaml2obj to mlir/Test/Target/BUILD.bazel (#153875)
https://github.com/llvm/llvm-project/pull/152131 uses yaml2obj, which is
not listed as a dependency of the lit tests in bazel. This is causing
LLVM CI failures, e.g [1].

[1]:
https://buildkite.com/llvm-project/upstream-bazel/builds/146788/steps/canvas?sid=0198af37-f624-470f-aac1-d9e0b42fab56
2025-08-15 21:16:03 +00:00
Chenguang Wang
b3e3a2090b
[bazel] Add missing test inputs inclusion on mlir/test/Target. (#153854)
https://github.com/llvm/llvm-project/pull/152131 added a few tests that
depend on `mlir/test/Target/Wasm/inputs/*`, e.g.
`mlir/test/Target/Wasm/import.mlir` reads `inputs/import.yaml.wasm`.
These inputs should be included as data dependency.
2025-08-15 12:32:15 -07:00
Benjamin Chetioui
8c0914d826
[mlir][bazel] Fix Bazel build after 6bb8f6f2d0ed672217e0a0521afc5b86913b717e (#153811) 2025-08-15 14:28:44 +00:00
Aiden Grossman
4f15debe13 [bazel] Reformat libc build
Buildifier flags some issues, so run it over everything and have it
automatically reformat the files.
2025-08-15 04:41:56 +00:00
DeanSturtevant1
cb2f0d0a5f
[bazel] Fix mlir/BUILD.bazel for VectorToXeGPU. (#153696) 2025-08-14 15:03:41 -07:00
DeanSturtevant1
4e63d704e8
Fix mlir/BUILD.bazel for XeGPUUtils. (#153689) 2025-08-14 14:32:18 -07:00
DeanSturtevant1
7d91213559
[bazel][MLIR] Fix for MemRefToEmitC for #151206 (#153590) 2025-08-14 14:57:25 +00:00
Muhammad Bassiouni
9ddc85f6d5
[libc][math] Refactor coshf implementation to header-only in src/__support/math folder. (#153427)
Part of #147386

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-08-14 17:19:47 +03:00
Jordan Rupprecht
e20a2611ee
[bazel] More port of #148286: only include spirv dep when enabled (#153531)
The fix in #153520 works so long as SPIRV is actually an enabled target.
Otherwise, the build fails w/ `target 'SPIRVCodeGen' not declared in
package ...`
2025-08-13 21:00:11 -07:00
Jordan Rupprecht
928e7fb40e
[bazel] Port #148286: XeVM target (#153520) 2025-08-13 19:12:03 -07:00
Muhammad Bassiouni
0f6d3ad0fe
[libc][math] Refactor cosf16 implementation to header-only in src/__support/math folder. (#152871)
Part of #147386

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-08-13 18:04:35 +03:00
Benjamin Chetioui
e861e4957f
Fix bazel BUILD after 7d1b9cad873f585309c9892c091f990fbebff878 (#153388) 2025-08-13 11:01:44 +00:00
Muhammad Bassiouni
200a99073f
[libc][math] Refactor cosf implementation to header-only in src/__support/math folder. (#152069)
Part of #147386

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-08-11 21:08:21 +03:00
Alexey Samsonov
5ccc734fa0
[libc][bazel] Set LIBC_ERRNO_MODE_SYSTEM_INLINE by default. (#152946)
Bazel only supports overlay build currently, so there's always system
libc (and system errno_ present. Use the new
LIBC_ERRNO_MODE_SYSTEM_INLINE by default, instead of using thread-local
one in the unit tests and system errno for "public packaging" (i.e. prod
build). This way, we can ensure that we're testing the same
configuration as the one that will be used in production.

This is the second attempt to do that after f9146cc was reverted in
279e82f. Since then, many tests have been migrated to ErrnoCheckingTest
so the change should be safe even for those downstream customers that
clobber system errno value before unit tests are being called.
2025-08-10 22:34:39 -07:00
Muhammad Bassiouni
e86c9b6b1b
[libc][math] Refactor cos implementation to header-only in src/__support/math folder. (#151883)
Part of #147386

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-08-09 18:51:54 +03:00
Keith Smiley
b698927e66
[bazel] Use copy_file rule for zlib-ng (#152752)
This avoids cp usage for potential windows / PATH-less builds
2025-08-08 11:22:30 -07:00
Jordan Rupprecht
4e58724036
[bazel] Port #150146: xegpu/sliceattr (#152772) 2025-08-08 13:16:04 -05:00
Jordan Rupprecht
af54757c70
[bazel] Port #152003: Support padding with poison (#152771) 2025-08-08 13:03:24 -05:00
Jordan Rupprecht
8ad8876cea
[bazel] Skip tests from #152562 (#152759) 2025-08-08 11:50:45 -05:00
Orlando Cazalet-Hyams
1778669739
[KeyInstr] Remove LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS CMake flag (#152735)
The CMake flag has been on by default for a month without any issues.

This makes the feature support in LLVM unconditional (but does not
enable the feature by default).
2025-08-08 17:03:28 +01:00
Muhammad Bassiouni
66734f4c3c
[libc][math] Refactor cbrtf implementation to header-only in src/__support/math folder. (#151846)
Part of #147386

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-08-08 18:28:50 +03:00
Jordan Rupprecht
6a8e376d82
[bazel] Extra layering_check dep for #151228: BFloat16 (#152741) 2025-08-08 10:11:52 -05:00
Bart Chrzaszcz
92f6b15445
[clang] Fix bazel after eccc6e2. (#152681) 2025-08-08 11:02:14 +01:00
Alexey Samsonov
2422972eea
[libc] Migrate FEnvSafeTest and FPTest to ErrnoCheckingTest. (#152633)
This would ensure that errno value is cleared out before test execution
and tests pass even when LIBC_ERRNO_MODE_SYSTEM_INLINE is specified (and
errno may be clobbered before test execution).

A lot of the tests would fail, however, since errno would end up getting
set to EDOM or ERANGE during test execution and never validated before
the end of the test. This should be fixed - and errno should be
explicitly checked or ignored in all of those cases, but for now add a
TODO to address it later (see open issue #135320) and clear out errno in
test fixture to avoid test failures.
2025-08-07 21:49:57 -07:00
Jordan Rupprecht
f68eedde75
[bazel] Port #151410: constFoldBinaryOp (#152568) 2025-08-07 14:34:34 -05:00
Jorge Gorbe Moya
8381f95dec
[bazel] Fix mlir/tests after 281e6d2cc498d05f3ca601e3b1d595420e7ed827 (#152413) 2025-08-06 20:36:55 -05:00
Jordan Rupprecht
381623eb11
[bazel] Port #151228: BFloat16 (#152377) 2025-08-06 15:35:03 -05:00
Jorge Gorbe Moya
c19314f070
[bazel] Port fa39b67de01af189b59f9034ef6228a2951364b0 (#152191) 2025-08-05 12:39:54 -07:00
Bart Chrzaszcz
522ea9c330
[llvm] Fix bazel after 3f59a22. (#152151) 2025-08-05 15:57:18 +01:00
Bart Chrzaszcz
d4f51bd53e
[mlir] Fix bazel after a534896. (#152117)
Needed to define the bazel targets for the new dialect.
2025-08-05 11:39:13 +01:00
Jorge Gorbe Moya
58aeb7952f
[bazel] Port 7b208e04b2e7c4a10eebf026996d8116eac5f603 (#152033) 2025-08-04 14:01:26 -07:00
Adrian Kuegel
f382b7f25c [Bazel][lldb] Add PluginProcessWasm target. 2025-08-04 13:13:48 +00:00
Benjamin Kramer
d07abde4b8 [bazel] Add missing dependency for 185a23e865c31145588276e7e0db2460e01eb703 2025-08-04 12:42:41 +02:00
Muhammad Bassiouni
003f6ada15
[libc][math] Refactor cbrt implementation to header-only in src/__support/math folder. (#151837)
Part of #147386

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-08-03 21:02:53 +03:00
Muhammad Bassiouni
bb3cd6221b
[libc][math] Refactor atanhf16 implementation to header-only in src/__support/math folder. (#151779)
Part of #147386

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-08-02 23:04:02 +03:00
Muhammad Bassiouni
99cd1d8aef
[libc][math] Refactor atanhf implementation to header-only in src/__support/math folder. (#151399)
Part of #147386

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-08-02 02:54:13 +03:00
Muhammad Bassiouni
920079b793
[libc][math] Refactor atan2f128 implementation to header-only in src/__support/math folder. (#151012)
Part of #147386

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-08-02 00:18:57 +03:00
Muhammad Bassiouni
9af2c21be4
[libc][math] Refactor atan2f implementation to header-only in src/__support/math folder. (#150993)
Part of #147386

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-08-01 16:06:09 +03:00
Adrian Kuegel
067f87c583 [lldb][Bazel] Add missing dependency. 2025-08-01 09:20:58 +00:00
Jordan Rupprecht
c05611f191
[bazel] Port #150633 HLSLBinding.h (#151546) 2025-07-31 11:04:14 -05:00
Jordan Rupprecht
d520daeb82
[bazel] Port #145358: LIBC_THREAD_MODE (#151539)
I'm not sure how libc should be configuring this in bazel, but for now
it seems like `LIBC_THREAD_MODE_PLATFORM` restores the default behavior.

Defining this param is required:
```
ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/c9d34ded3a9d94cc250207948aceadfc/external/llvm-project/libc/BUILD.bazel:5788:14: Compiling libc/src/stdio/generic/vprintf.cpp failed: (Exit 1): clang failed: error executing CppCompile command (from target @@llvm-project//libc:vprintf) /usr/lib/llvm-18/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 31 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/llvm-project/libc/src/stdio/generic/vprintf.cpp:11:
In file included from external/llvm-project/libc/src/__support/File/file.h:19:
external/llvm-project/libc/src/__support/threads/mutex.h:25:2: error: LIBC_THREAD_MODE is undefined
   25 | #error LIBC_THREAD_MODE is undefined
      |  ^
```

As an alternative to this PR, we could make the libc header default to
`LIBC_THREAD_MODE_PLATFORM` if not provided, instead of an `#error`
2025-07-31 10:39:34 -05:00
Muhammad Bassiouni
c8b6ddf3a3
[libc][math] Refactor atan2 implementation to header-only in src/__support/math folder. (#150968)
Part of #147386

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-07-31 01:07:55 +03:00
Muhammad Bassiouni
729b0d1b61
[libc][math] Refactor atanf16 implementation to header-only in src/__support/math folder. (#150868)
Part of #147386

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-07-30 23:31:07 +03:00
Jordan Rupprecht
c56be46c1c
[bazel] Port #151010: DW_OP_WASM_location (#151364) 2025-07-30 12:38:19 -05:00
Jordan Rupprecht
c9e2ad7da8
[bazel][mlir] Add build files for transform examples (#151351) 2025-07-30 11:43:33 -05:00