3435 Commits

Author SHA1 Message Date
Christian Sigg
5e0e389360 [bazel] Port a29f0dd, second attempt. 2026-02-10 15:59:18 +01:00
Christian Sigg
1e47ccf030 [bazel] Port a29f0dd. 2026-02-10 15:47:14 +01:00
Christian Sigg
c1a6b136a1 [bazel] Port b4032db. 2026-02-10 13:26:24 +01:00
Christian Sigg
b62a7527d2 [bazel] Port 9de8463 2026-02-10 11:54:19 +01:00
Christian Sigg
a481252122
[bazel] NFC: shave off unnecessary newlines (#180626)
And silence `stubgen_runner` console spew.
2026-02-10 09:54:02 +01:00
HighW4y2H3ll
0c94a1814f
[Bazel] NFC refactor out redundant is_x86_64_non_windows config (#180296)
The logic of `is_x86_64_non_windows` looks unnecessarily complicated and
is only used at one site... clean up the unused targets and refactor
x86_64 BLAKE3 asm sources into a separate filegroup. And then
`is_x86_64_non_windows` can be put inside a default condition.
2026-02-09 15:30:52 -08:00
David Zbarsky
5d57c40043
[bazel] Fix multicall tool invocation disambiguation (#180607)
The code seems to have considered the potential problem but did not
quite succeed in solving it ;)
2026-02-09 17:20:49 -06:00
Christian Sigg
61c24328fc
[bazel] Fix llvm reference 2026-02-09 20:29:50 +01:00
Christian Sigg
afd53ae84b
[bazel] Fix layering checks 2026-02-09 20:25:39 +01:00
Christian Sigg
48f53422fe [bazel] Slight polish after ef68a53. 2026-02-09 19:38:22 +01:00
Christian Sigg
7de4eb97d9 [bazel] Port fccbdcb. 2026-02-09 16:08:13 +01:00
Christian Sigg
b4bc9fa1c6 [bazel] Port da0ad392ffc6. 2026-02-09 15:16:55 +01:00
Sergei Lebedev
ef68a53139
[MLIR] [Python] Added plumbing to run stubgen on the mlir._mlir package (#179211)
This allows generating stubs during Bazel builds, which was previously
only supported under CMake.

I decided not to use nanobind_stubgen from nanobind-bazel, because the
py_binary it generates is not easily usable in a genrule.
2026-02-09 12:29:31 +00:00
Zorojuro
d94caea215
[libc][math] Refactor ffmal to Header Only. (#179069)
closes #175326

Part of #147386
2026-02-07 16:13:09 +02:00
Iasonaskrpr
15832a6967
[libc][math] Refactor sqrtf128 to header only (#177760)
Closes #177652
2026-02-07 16:03:49 +02:00
Jordan Rupprecht
c0c42c4e39
Revert "Fix Bazel build for d005cb2" (#180271)
Reverts #180134, as the change it fixes was itself reverted in #180252
2026-02-06 19:44:02 +00:00
Jordan Rupprecht
4a94cddad2
[bazel][WebAssembly][GlobalISel] Port 9976e5702f05a4019123ee1ad2bb9a8b69ca7dcb (#180270)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-06 19:41:39 +00:00
Jordan Rupprecht
823799d9ed
[bazel][mlir][AMDGPU] Port #180112: Add td dep (#180248) 2026-02-06 12:09:14 -06:00
Benjamin Kramer
15737387c7 [bazel] Run builidifer. NFC. 2026-02-06 10:18:14 +01:00
Benjamin Kramer
743116acd9
[bazel] Add missing dependency for 61b8a5783972f03d2a5a72713fa0daa095802ce (#180145) 2026-02-06 10:18:08 +01:00
Anshul Nigham
6f5b84232c
Fix Bazel build for d005cb2 (#180134)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-06 09:45:46 +01:00
Tomás Longeri
edebc7544e
Fix Bazel build for ba58225 (#180136) 2026-02-06 09:16:35 +01:00
Zorojuro
ee816947ac
[libc][math] Refactor f16fmaf to Header Only. (#178851)
closes #175319
2026-02-05 21:56:27 +02:00
Aiden Grossman
a76f63870e
Fix Bazel build for 823e3e0 (#179980)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-05 08:53:52 -08:00
Zorojuro
10910771e8
[libc][math] Refactor f16fmaf128 to Header Only (#177850)
Closes #175318 

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
2026-02-05 17:44:53 +02:00
Ivan Tadeu Ferreira Antunes Filho
477f3af782
Fix Bazel build for 07ebb18 (#179840)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-05 02:22:25 +00:00
Jordan Rupprecht
9fa14216a1
[bazel][mlir][shard,mpi] Port #178870: arith dialect dep (#179723) 2026-02-04 18:31:38 +00:00
Haojian Wu
aa7faec962
[bazel] Build mcp server for lldb (#178437) 2026-02-04 15:06:08 +01:00
Jordan Rupprecht
22cc68ca2f
[bazel][mlir][emitc][test] Port #177339: tosa -> emitc test deps (#179578) 2026-02-03 18:33:06 -06:00
Jordan Rupprecht
7c29a09cd8
[bazel][lldb] Port #179355: data formatters location (#179552) 2026-02-03 15:49:09 -06:00
Jordan Rupprecht
3ce60c4ff9
[bazel][mlir][NFC] Run buildifier (#179554) 2026-02-03 21:41:12 +00:00
Anshul Nigham
911acc8ef4
[Bazel] Fix Bazel build for 4f9843b (#179321)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-02 21:00:05 +00:00
ziereis
d376a7e75f
[mlir] TileUsingInterface bugfix for dominance error (#178190)
In this PR i move the insertion point in the
`yieldReplacementForFusedProducer` because i ran into some issue where a
`tensor.extract_slices` tried to use a result of `affine.apply` that was
inserted at the end of the block instead of the start of it.

This is the full error of the test i added before this change:

```mlir
third-party/llvm-project/mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-scfforall.mlir:83:11: error: operand #1 does not dominate this use
  %pack = linalg.pack %gen#1
          ^
third-party/llvm-project/mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-scfforall.mlir:83:11: note: see current operation: %24 = "tensor.extract_slice"(%23, %36, %8) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
third-party/llvm-project/mlir/test/Interfaces/TilingInterface/tile-fuse-and-yield-using-scfforall.mlir:71:12: note: operand defined here (op in the same block)
  %gen:2 = linalg.generic {
           ^
// -----// IR Dump After InterpreterPass Failed (transform-interpreter) //----- //
#map = affine_map<(d0, d1) -> (d0, d1)>
#map1 = affine_map<(d0) -> (d0 * 16)>
#map2 = affine_map<(d0) -> (d0 * -16 + 32)>
#map3 = affine_map<(d0) -> (16, d0 * -16 + 32)>
#map4 = affine_map<(d0) -> (d0 - 1)>
"builtin.module"() ({
  "func.func"() <{function_type = (tensor<32x1024xf32>) -> (tensor<32x1024xf32>, tensor<2x512x16x2xi8>), sym_name = "fuse_pack_consumer_into_multi_output_generic"}> ({
  ^bb0(%arg1: tensor<32x1024xf32>):
    %2 = "arith.constant"() <{value = 0 : i8}> : () -> i8
    %3 = "tensor.empty"() : () -> tensor<32x1024xf32>
    %4 = "tensor.empty"() : () -> tensor<32x1024xi8>
    %5 = "tensor.empty"() : () -> tensor<2x512x16x2xi8>
    %6:2 = "linalg.generic"(%arg1, %3, %4) <{indexing_maps = [#map, #map, #map], iterator_types = [#linalg.iterator_type<parallel>, #linalg.iterator_type<parallel>], operandSegmentSizes = array<i32: 1, 2>}> ({
    ^bb0(%arg9: f32, %arg10: f32, %arg11: i8):
      %41 = "arith.fptoui"(%arg9) : (f32) -> i8
      "linalg.yield"(%arg9, %41) : (f32, i8) -> ()
    }) : (tensor<32x1024xf32>, tensor<32x1024xf32>, tensor<32x1024xi8>) -> (tensor<32x1024xf32>, tensor<32x1024xi8>)
    %7:3 = "scf.forall"(%5, %3, %4) <{operandSegmentSizes = array<i32: 0, 0, 0, 3>, staticLowerBound = array<i64: 0>, staticStep = array<i64: 1>, staticUpperBound = array<i64: 2>}> ({
    ^bb0(%arg2: index, %arg3: tensor<2x512x16x2xi8>, %arg4: tensor<32x1024xf32>, %arg5: tensor<32x1024xi8>):
      %8 = "affine.apply"(%arg2) <{map = #map1}> : (index) -> index
      %9 = "affine.apply"(%arg2) <{map = #map2}> : (index) -> index
      %10 = "affine.min"(%arg2) <{map = #map3}> : (index) -> index
      %11 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      %12 = "affine.apply"(%arg2) <{map = #map1}> : (index) -> index
      %13 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      %14 = "affine.apply"(%arg2) <{map = #map1}> : (index) -> index
      %15 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      %16 = "affine.apply"(%arg2) <{map = #map1}> : (index) -> index
      %17 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      %18 = "tensor.extract_slice"(%arg1, %12, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
      %19 = "tensor.empty"() : () -> tensor<32x1024xf32>
      %20 = "tensor.extract_slice"(%19, %14, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
      %21 = "tensor.extract_slice"(%3, %14, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
      %22 = "tensor.empty"() : () -> tensor<32x1024xi8>
      %23 = "tensor.extract_slice"(%22, %16, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xi8>, index, index) -> tensor<?x1024xi8>
      %24 = "tensor.extract_slice"(%4, %16, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xi8>, index, index) -> tensor<?x1024xi8>
      %25 = "tensor.empty"() : () -> tensor<32x1024xf32>
      %26 = "tensor.extract_slice"(%25, %38, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
      %27 = "tensor.extract_slice"(%arg4, %38, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xf32>, index, index) -> tensor<?x1024xf32>
      %28 = "tensor.empty"() : () -> tensor<32x1024xi8>
      %29 = "tensor.extract_slice"(%28, %8, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xi8>, index, index) -> tensor<?x1024xi8>
      %30 = "tensor.extract_slice"(%arg5, %8, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xi8>, index, index) -> tensor<?x1024xi8>
      %31:2 = "linalg.generic"(%18, %27, %30) <{indexing_maps = [#map, #map, #map], iterator_types = [#linalg.iterator_type<parallel>, #linalg.iterator_type<parallel>], operandSegmentSizes = array<i32: 1, 2>}> ({
      ^bb0(%arg6: f32, %arg7: f32, %arg8: i8):
        %40 = "arith.fptoui"(%arg6) : (f32) -> i8
        "linalg.yield"(%arg6, %40) : (f32, i8) -> ()
      }) : (tensor<?x1024xf32>, tensor<?x1024xf32>, tensor<?x1024xi8>) -> (tensor<?x1024xf32>, tensor<?x1024xi8>)
      %32 = "tensor.extract_slice"(%6#1, %8, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<32x1024xi8>, index, index) -> tensor<?x1024xi8>
      %33 = "tensor.empty"() : () -> tensor<2x512x16x2xi8>
      %34 = "tensor.extract_slice"(%33, %arg2) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808, 0, 0, 0>, static_sizes = array<i64: 1, 512, 16, 2>, static_strides = array<i64: 1, 1, 1, 1>}> : (tensor<2x512x16x2xi8>, index) -> tensor<1x512x16x2xi8>
      %35 = "tensor.extract_slice"(%arg3, %arg2) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808, 0, 0, 0>, static_sizes = array<i64: 1, 512, 16, 2>, static_strides = array<i64: 1, 1, 1, 1>}> : (tensor<2x512x16x2xi8>, index) -> tensor<1x512x16x2xi8>
      %36 = "linalg.pack"(%31#1, %35, %2) <{inner_dims_pos = array<i64: 0, 1>, operandSegmentSizes = array<i32: 1, 1, 1, 0>, static_inner_tiles = array<i64: 16, 2>}> : (tensor<?x1024xi8>, tensor<1x512x16x2xi8>, i8) -> tensor<1x512x16x2xi8>
      %37 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      %38 = "affine.apply"(%arg2) <{map = #map1}> : (index) -> index
      %39 = "affine.apply"(%10) <{map = #map4}> : (index) -> index
      "scf.forall.in_parallel"() ({
        "tensor.parallel_insert_slice"(%36, %arg3, %arg2) <{operandSegmentSizes = array<i32: 1, 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808, 0, 0, 0>, static_sizes = array<i64: 1, 512, 16, 2>, static_strides = array<i64: 1, 1, 1, 1>}> : (tensor<1x512x16x2xi8>, tensor<2x512x16x2xi8>, index) -> ()
        "tensor.parallel_insert_slice"(%31#0, %arg4, %38, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<?x1024xf32>, tensor<32x1024xf32>, index, index) -> ()
        "tensor.parallel_insert_slice"(%31#1, %arg5, %8, %10) <{operandSegmentSizes = array<i32: 1, 1, 1, 1, 0>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1024>, static_strides = array<i64: 1, 1>}> : (tensor<?x1024xi8>, tensor<32x1024xi8>, index, index) -> ()
      }) : () -> ()
    }) : (tensor<2x512x16x2xi8>, tensor<32x1024xf32>, tensor<32x1024xi8>) -> (tensor<2x512x16x2xi8>, tensor<32x1024xf32>, tensor<32x1024xi8>)
    "func.return"(%7#1, %7#0) : (tensor<32x1024xf32>, tensor<2x512x16x2xi8>) -> ()
  }) : () -> ()
  "builtin.module"() ({
    "transform.named_sequence"() <{arg_attrs = [{transform.readonly}], function_type = (!transform.any_op) -> (), sym_name = "__transform_main"}> ({
    ^bb0(%arg0: !transform.any_op):
      %0 = "transform.structured.match"(%arg0) <{ops = ["linalg.pack"]}> : (!transform.any_op) -> !transform.any_op
      %1:2 = "transform.test.fuse_and_yield"(%0) <{tile_interchange = [], tile_sizes = [1], use_forall = true}> : (!transform.any_op) -> (!transform.any_op, !transform.any_op)
      "transform.yield"() : () -> ()
    }) : () -> ()
  }) {transform.with_named_sequence} : () -> ()
}) : () -> ()
``` 

I also noticed that Interface tests are missing from the bazel overlay
so i also added this.
2026-02-02 11:09:10 -08:00
Benjamin Kramer
2edd2ee584
[bazel] Port 9d5a42c8411b22fdcfb80dbbda4d68d6aa957328 (#179218) 2026-02-02 13:17:57 +01:00
Benjamin Kramer
371b9bded2
[bazel] Port 1e33b736ff3888b04206acb9fbd9f6623c0723aa (#179216) 2026-02-02 13:10:28 +01:00
Benjamin Kramer
2b873aa9b2
[bazel] Add missing dependency for f992f9719fe13c9ed8bf8e3571d190a69e0e5593 2026-01-31 10:04:31 +01:00
Saina Daneshmand
737f4447ad
[libc][math] Refactor sqrtf to header-only (#178778)
Refactors sqrtf to be header-only.

Closes #177649.
2026-01-30 05:31:04 +00:00
Ash
a17bc05818
[libc][math] Refactor sincosf implementation to header only (#177523)
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

Closes #177640
2026-01-30 03:05:51 +00:00
Zhihui Yang
947df33d3d
[libc][math] Refactor f16sqrt to Header Only (#177167)
Fixes #175330
Part of https://github.com/llvm/llvm-project/issues/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
2026-01-30 04:27:03 +02:00
Walter Lee
05e9086092
[bazel][mlir][AMDGPU] Fix BUILD file formatting for #178784 (#178798) 2026-01-30 00:36:54 +00:00
Walter Lee
3dfcd84dd9
[bazel][mlir][AMDGPU] Fix build for #178562 (#178784)
Fixes 52dfcab327fe959074563603b6ebaaed314e9677.

Co-authored-by: Pranav Kant <prka@google.com>
2026-01-29 19:29:10 -05:00
Walter Lee
db6b186e47
[bazel][[mlir][xegpu] Fix build for #177492 (#178728)
Fix d9c65f94b11f2fed7b78af3a8e7bec6c84bdf219.
2026-01-29 19:08:02 +00:00
AidinT
caae29c4b9
[MLIR] convert OpAsmDialectInterface using ODS (#171488)
This PR converts OpAsmDialectInterface using ODS.

It also introduces a new Interface Method class `InterfaceMethodDeclaration` which will declare the function without definition.
2026-01-29 17:41:34 +00:00
Walter Lee
223e750afe
[bazel] Fix build for #177289 (#178596)
Fix 5968e29dad63d9c866675dbce9cc284fcec8a900.

Co-authored-by: Pranav Kant <prka@google.com>
2026-01-29 00:34:53 -05:00
Walter Lee
667c981ac0
[bazel][mlir] Fix build for #178526 (#178593)
Fix 9aaf0b89f5ab3c84f8ad24213992a8158d344b96.
2026-01-29 00:07:22 -05:00
Walter Lee
46606bbc53
[bazel] Fix formatting for #178527 (#178582)
Fixes 5b9751b99b6bf37eb8d2d7d0e5085a4b560544b6.
2026-01-29 03:46:41 +00:00
Saina Daneshmand
3404537393
[libc][math] Refactor sqrt to header-only (#178335)
This refactors `sqrt` to be header-only, following the libc math
refactoring plan.

Part of #147386  
Closes #177648
2026-01-29 03:10:33 +00:00
Walter Lee
5b9751b99b
[bazel] Fix build for 241de80d38d4482eeecc2c7f51dc1f2b7f06ad69 (#178527) 2026-01-28 22:49:49 +00:00
Atharv Mane
18925d131b
[libc] [math] Refactor fsqrtl to be header-only (#176169)
This PR refactors fsqrtl to be header only as discussed. No functional
change intended. Test and build files were updated as required by the
refactor
Fixes #175335
2026-01-28 20:12:45 +00:00
cpist (He / Him)
a8913a2229
[libc][math] Refactor logf16 to header-only shared math (#175408)
## Summary

Following the discussion in the RFC [1], Refactors logf16 to a
header-only shared math.

[1]
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450

## Implementation 

- Moved the core logic and lookup tables from `generic/logf16.cpp` to
`__support/math/logf16.h`
- Updated `generic/logf16.cpp` to include the new header and call
`internal::logf16`
- Updated `CMakeLists.txt` and `BUILD.bazel` to reflect the dependency
changes and new header library

Fix : https://github.com/llvm/llvm-project/issues/175367
2026-01-28 19:40:14 +00:00