2896 Commits

Author SHA1 Message Date
Adrian Kuegel
ad05543428 [Bazel] Also adapt test/BUILD for 9a553d3766aacb69e884823da92dedff264e3f0f 2025-05-21 07:51:38 +00:00
Adrian Kuegel
462cede350 [Bazel] Follow fixes for 9a553d3766aacb69e884823da92dedff264e3f0f 2025-05-21 07:41:19 +00:00
Srinivasa Ravi
9a553d3766
[MLIR][NVVM] Add NVVMRequiresSM op traits (#126886)
Motivation:
Currently, the NVVMOps are not verified against the supported SM
architectures. This can manifest as an ISel failure in the NVPTX LLVM
backend during CodeGen to PTX ISA. This PR addresses this issue by
adding verifier checks for Target-SM architectures in the NVVM Dialect
itself, thereby catching the errors early on.

Summary:
* Parametric traits named `NVVMRequiresSM` and `NVVMRequiresSMa` are
added to facilitate the version checks for typical and arch-accelerated
versions respectively.
* These traits can be attached to any NVVM Op to enable the checks for
the particular Op. (example shown below)
* An attribute interface called named `TargetAttrVerifyInterface` is
added to the GPU dialect which any target attribute seeking to perform
target-verification on the module can implement.
* The checks are performed by the `NVVMTargetAttr` (implementing the
`TargetAttrVerifyInterface` interface) when called from the GPU module
verifier where it walks through the module and performs the checks for
Ops with the `NVVMRequiresSM` traits.
* A few Ops in `NVVMOps.td` have been updated to serve as examples.

Example Usage:
```
       def NVVM_ReduxOp : NVVM_Op<"redux.sync"> {...} 
 ----> def NVVM_ReduxOp : NVVM_Op<"redux.sync", [NVVMRequiresSM<80>]> {...}

       def NVVM_WgmmaFenceAlignedOp : NVVM_Op<"wgmma.fence.aligned"> {...}
 ----> def NVVM_WgmmaFenceAlignedOp : NVVM_Op<"wgmma.fence.aligned", [NVVMRequiresSMa<[90]>]> {...}
```

---------

Co-authored-by: Guray Ozen <guray.ozen@gmail.com>
2025-05-21 08:53:00 +05:30
Pat Doyle
064912217c
[bazel][mlir] Add missing dep for 747620d (#140830)
fixes the following errors:

ERROR:
/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/6a1efeb401da192d3572f00e2f11245b/external/llvm-project/mlir/BUILD.bazel:3410:11:
Compiling mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp
failed: (Exit 1): clang failed: error executing CppCompile command (from
target @@llvm-project//mlir:XeGPUTransforms) /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 130 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain
the sandbox build root for debugging

external/llvm-project/mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp:11:10:
error: module llvm-project//mlir:XeGPUTransforms does not depend on a
module exporting 'mlir/Dialect/Arith/Utils/Utils.h'
   11 | #include "mlir/Dialect/Arith/Utils/Utils.h"
      |          ^

external/llvm-project/mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp:13:10:
fatal error: 'mlir/Dialect/Index/IR/IndexDialect.h' file not found
   13 | #include "mlir/Dialect/Index/IR/IndexDialect.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
2025-05-20 20:55:20 -05:00
Adrian Kuegel
b565933fd7 [Bazel] Adapt to d561d595c4ee741f873972c03afa829e6c566ffd
Also restore ":Core" dependency, it is actually needed.
2025-05-20 07:42:11 +00:00
Adrian Kuegel
67f4d841f0 [llvm][Bazel] Adjust according to changes in 4cfbe55 2025-05-20 06:30:50 +00:00
Jorge Gorbe Moya
5c154277ef [bazel] Add missing dep after 6a0e626af58bdf8ae8c07cfe8aec94f4565734a3 2025-05-16 17:56:32 -07:00
Jorge Gorbe Moya
fec9be9f73 [bazel][mlir] Add missing dep and include after 9b63bdd15418e90d0c6889d26e490db89ae744d1
This fixes issues when compiling SliceMatchers.h separately. In
particular, the missing include triggered a "member access into
incomplete type" error:

```
third_party/llvm/llvm-project/mlir/include/mlir/Query/Matcher/SliceMatchers.h:91:30: error: member access into incomplete type 'Operation'
   91 |     for (auto operand : subOp->getOperands()) {
      |                              ^
third_party/llvm/llvm-project/mlir/include/mlir/Analysis/SliceAnalysis.h:20:7: note: forward declaration of 'mlir::Operation'
   20 | class Operation;
      |       ^
```
2025-05-16 14:14:01 -07:00
James Y Knight
7fe1b43122 NFC: reformat bazel files with buildifier. 2025-05-16 12:12:03 -04:00
Jorge Gorbe Moya
113898326b [bazel] Add missing dep after 3d6d5dfed2b303e9fba74586993df3fa85058991 2025-05-15 10:22:46 -07:00
Jeremy Kun
a3d2b7e2cb
[mlir][polynomial] Remove polynomial dialect (#139766)
Cf. https://discourse.llvm.org/t/future-of-the-polynomial-dialect/86117

For posterity, the polynomial dialect development has moved to HEIR, and
as of this writing the different components can be found here:

-
a422f130fa/lib/Dialect/Polynomial
-
a422f130fa/lib/Transforms/PolynomialApproximation
-
a422f130fa/lib/Transforms/LowerPolynomialEval
2025-05-13 16:04:30 -07:00
Jorge Gorbe Moya
8af397af65 [bazel] Add missing dep after 810148cb0769f61f8afebdaf27a9c1af95de27aa 2025-05-13 11:49:07 -07:00
Jorge Gorbe Moya
165d47ef70 [bazel] Add missing deps after 91f3cdbd4f173c534d718322ef6b1ec537024af6 2025-05-13 10:24:15 -07:00
Jorge Gorbe Moya
5fb742ae27 [bazel] port 3bdfa6f3e8ebb6b3c139a7f4929f7016a6f56386 2025-05-12 19:17:02 -07:00
Jorge Gorbe Moya
227328f6f6 [bazel] Add missing dep after d896e2883e6f6b6266fa745ab758adc351778a89 2025-05-12 15:11:33 -07:00
Benjamin Kramer
fbd056532f [bazel] Port db42345dc660329e34fd119fc8edab74521f7c06 2025-05-12 19:11:40 +02:00
Benjamin Kramer
3197909694 [bazel] Fix lldb-dap-Info.plist.in path after 6f84ec3496f5ec9038a59c11d2ea495f1e601049 2025-05-12 13:27:10 +02:00
NAKAMURA Takumi
6f4dcaed6b [bazel] Update AVR TableGen (for #139407) 2025-05-12 06:43:05 +09:00
Jorge Gorbe Moya
0eae457be3 [bazel] Add missing deps for 9ca46640062a6c0b955d16ad6f88305b534af8a3 2025-05-09 15:23:43 -07:00
Jorge Gorbe Moya
1678f47a91 [bazel] add missing dep for 74ed33484e84a331591fde66f7375c26bbf14672 2025-05-09 15:16:14 -07:00
Jorge Gorbe Moya
ccaf69a334 [bazel] Port c60db55568e82fd7b70dfec017d23e19aed6925f 2025-05-09 14:32:17 -07:00
Mikhail Goncharov
7618ce880d [bazel] port f9f2bf8e5e5c266a51b4ec6d23317a7e3dfeb670 2025-05-09 13:47:23 +02:00
Jordan Rupprecht
2693a715bf
[bazel] Port 515b4a4fdd7ac97373b68850a2ffa72e2b8e9178 (#139155) 2025-05-08 16:06:15 -05:00
Benjamin Kramer
1d3f8f4871 [bazel] Port 92cc31b0f7737408dffd38c2384dff825abb8e3a for Lanai 2025-05-08 14:09:29 +02:00
Jordan Rupprecht
28521368d7
[bazel] Port 6babd63a4bbc094bee4ef8e75f95dccd32325c15 (#139026) 2025-05-08 00:16:40 -05:00
Alexey Samsonov
98d26b8f67
[libc][bazel] Re-enable memcpy prefetching on x86. (#138945)
It was re-enabled downstream after further performance analysis, so we
can revert c65ed964657c93d51f3e05de9e0609419768a143, effectively
re-landing the change.
2025-05-07 22:14:21 -07:00
NAKAMURA Takumi
c6c2e21028 [bazel] Update Sparc (for #138450) 2025-05-06 11:00:48 +09:00
Christian Sigg
1b479e8314
[bazel] NFC: Change tbl_outs to dicts. (#137788)
There were some `gentbl_cc_library` targets left to convert.

Allow `gentbl_filegroup` rule to take a dict as well and change all
targets.

Move lld/BUILD.bazel from //llvm:tblgen.bzl to //mlir:tblgen.bzl, delete
the former.

This makes the BUILD files shorter and more readable.
2025-05-05 10:06:23 +02:00
Jorge Gorbe Moya
cd6a614ef5 [bazel] Add missing dep after a073bb5afdb8715429d98ea80ecdef1390fb4962 2025-05-01 15:16:38 -07:00
Jorge Gorbe Moya
472c211f58 [bazel] Add deps missing from 0009a1783490a8ff69251a0ec7df1891a427cfb0 to //mlir:AllExtensions 2025-05-01 15:07:43 -07:00
Mircea Trofin
b6d4b7eba1
[mlir][EmitC] Add Bazel rules for conversions (#138154)
Follow-up from #117549

tested by:

```
cd utils/bazel
bazelisk build --config=generic_clang @llvm-project//mlir:all
bazelisk test --config=generic_clang @llvm-project//mlir/test:all
```
2025-05-01 10:27:35 -07:00
NAKAMURA Takumi
c588224ca7 [bazel] Turn on LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING
This has been defined in #137787 and affects in
llvmorg-21-init-10310-g92195f6fc873 (#137787).
2025-05-01 11:37:11 +09:00
Keith Smiley
c3715ecb1e
[bazel] Add clang-apply-replacements BUILD file (#138054) 2025-04-30 16:57:35 -07:00
Jorge Gorbe Moya
27e8e08b66
[bazel] port d30554b19edc27bc9ca3475b888c1b3e4eda87c4 (#138022) 2025-04-30 16:18:48 -05:00
NAKAMURA Takumi
b262785137 [bazel] Give ConstantFolding.cpp "-ftrapping-math" (for #137652)
I've introduced the split lib `AnalysisFpExc`. Let me know if better
solutions would be applicable.
2025-04-30 16:20:43 +09:00
Keith Smiley
a9a891029d
[bazel] Fix layering check violation (#137734)
I broke this in 2ce6333a41a68c89866d4075527bd43ce8fd3b6c since I only
tested with a toolchain that doesn't support layering checks
2025-04-28 16:37:51 -07:00
Keith Smiley
2ce6333a41
[bazel] Fix lldb ODR issue (#137729)
In 42622c79592b98b899d787c89db11cea1b540b96, depending on the entire
utility library resulted in the lldb binary having more symbols that it
needs, duplicating those in liblldb, leading to odr violations. Now
instead we just expose the Host library's headers, which happens to be
enough for this to compile and link, referencing the symbols from
liblldb
2025-04-28 16:30:54 -07:00
Alexey Samsonov
882bae9f43
[libc][bazel] Make top section of BUILD.bazel files more uniform. (#137689)
Make sure all BUILD.bazel files under llvm-libc are specifying
package-level default_visibility and licenses.

Add top-level license notice and comment to new BUILD.bazel for
complex.h functions.
2025-04-28 12:40:24 -07:00
Jorge Gorbe Moya
4050a6a3d5 [bazel] add missing dep after a74e4ac9d52029f9c9fe80654acd9fdd34d2a4cd 2025-04-25 20:29:02 -07:00
Alexey Samsonov
157dfcf531
[libc][bazel] Fix BUILD.bazel after 5ff2774. (#137404)
Add a missing dependency to __support_macros_null_check.
2025-04-25 18:06:30 -04:00
Augie Fackler
119910a8f8 [bazel] catch BUILD files up to d555b9f9a01705097edf2434cf897e351095e5c9 in lldb 2025-04-25 13:03:18 -04:00
Sergei Lebedev
6d99d1a4a9
[mlir][bazel] Added a target for the CF dialect C API (#137146) 2025-04-25 06:54:12 +02:00
Keith Smiley
42622c7959
[bazel] Depend on full Utility library in lldb (#137265)
Since 6493345c5ab96f60ab5ee38272fb6635f2083318 the utility library is
needed by the driver. Since liblldb's exports are limited with
-exports_symbols_list on macOS, some symbols like
`__ZN12SelectHelper10FDSetWriteEi` are not exported from liblldb and
therefore cause linker failures on macOS only. In the cmake the driver
now depends on the full utility library, even though that leads to some
duplication of symbols, so it should be safe for us to do in bazel as
well.
2025-04-24 16:22:56 -07:00
Christian Sigg
e37c236597
[mlir][bazel] Remove unnecessary dependencies. (#136999) 2025-04-24 12:04:37 +02:00
Jorge Gorbe Moya
178cdbf746 [bazel] Add missing deps in mlir/test/BUILD.bazel after 905f1d8068a5bc1149732b46afc3f5dd780aa5d9 2025-04-23 18:27:49 -07:00
Jorge Gorbe Moya
adab66f7a5 [bazel] Add missing deps after 905f1d8068a5bc1149732b46afc3f5dd780aa5d9 2025-04-23 18:09:25 -07:00
Keith Smiley
a0fce0ba31
[bazel] Use non_arc_srcs instead of passing -fno-objc-arc (#137037)
This is the recommended way in bazel to differentiate between files that
require arc and those that require it be disabled. This matters
depending on the toolchain since the order of these flags may not have
been correct and we were relying on overwriting the default.
2025-04-23 11:37:23 -07:00
Christian Sigg
237ed0cffc [mlir][bazel] Port 0f32809139bd104adb2c1de4fa1044da78a7e5af. 2025-04-23 16:12:55 +02:00
Christian Sigg
dfc60b2ceb [mlir][bazel] Also add SideEffectInterfaces dep to PtrDialect.
Fix for port of e112dcc.
2025-04-23 09:01:45 +02:00
Christian Sigg
439f16a7e1 [mlir][bazel] Port e112dccc8ba49425c575a6b15325f2cbeef5c606. 2025-04-23 07:15:38 +02:00