900 Commits

Author SHA1 Message Date
Benjamin Kramer
044ed6e09f [bazel] Add missing dependencies for 790f237012 2023-01-20 11:05:29 +01:00
Geoffrey Martin-Noble
6b43568ff8 [Bazel] Fix layering issues
These are caught by clang-16, which we're using in our project.

Reviewed By: rupprecht

Differential Revision: https://reviews.llvm.org/D142158
2023-01-19 14:27:24 -08:00
Frederik Gossen
9ef7ae5073 Revert "[MLIR] Update bazel build file after 455305624884cf9237143e2ba0635fcc5ba5206"
This reverts commit 399b8ee7edf1b108adf7cddead7bf1ab284cf190.
2023-01-19 15:05:05 -05:00
Frederik Gossen
399b8ee7ed [MLIR] Update bazel build file after 455305624884cf9237143e2ba0635fcc5ba5206 2023-01-19 14:25:55 -05:00
Frederik Gossen
7f66e1833f [MLIR] Add InferTypeOpInterface to scf.if op
Differential Revision: https://reviews.llvm.org/D142049
2023-01-19 13:19:50 -05:00
Jordan Rupprecht
afca08a567 [NFC][bazel] Move _tensor_ops_ext.py to the correct filegroup 2023-01-19 08:43:24 -08:00
Jordan Rupprecht
ac0938709c [NFC][bazel] Add _tensor_ops_ext.py to SparseTensorOpsPyFiles
This corresponds to the cmake change in 81ca5aa452400843235e058bc9c83fe71eccd593
2023-01-19 08:39:18 -08:00
Jordan Rupprecht
658bf08f67 [NFC][bazel] Enable layering_check for mlir/unittests 2023-01-19 03:40:59 -08:00
Benjamin Kramer
cb5440104a [bazel] Fix build after c33b9395b1 2023-01-18 13:31:35 +01:00
Manish Gupta
1a1ddf05cb Add NVGPUUtil bazel lib 2023-01-17 18:41:39 -08:00
Jordan Rupprecht
e329715209 [NFC][bazel] Add export_files for utils/textmate/mlir.json 2023-01-17 17:16:37 -08:00
Johannes Reifferscheid
53ac16d844 Fix bazel build overlay. 2023-01-17 13:17:56 +01:00
Haojian Wu
75cb138911 [bazel] Another blank-line format fix for the utils/bazel/configure.bzl, NFC 2023-01-16 13:14:15 +01:00
Haojian Wu
45ab848f53 [bazel] Fix the format of utils/bazel/configure.bzl, NFC 2023-01-16 12:58:25 +01:00
NAKAMURA Takumi
f72601a89f [Bazel] Use LLVM_VERSION from llvm/CMakeLists.txt
* Generate `//:vars.bzl` from `llvm/CMakeLists.txt`

`_extract_cmake_settings()` generates `//:vars.bzl` in `llvm_configure()`.
It would be easier to use external commands like sed(1) and python.
For portability, I think the parser should run on Starlark.

`@llvm-project//:vars.bzl` may be loaded from both WORKSPACE and BUILD.
At the moment, `vars.bzl` provides some values as string.

- CMAKE_CXX_STANDARD = "17"
- LLVM_VERSION_MAJOR = "16"
- LLVM_VERSION_MINOR = "0"
- LLVM_VERSION_PATCH = "0"
- LLVM_VERSION = "16.0.0"
- llvm_vars = (dict of these values)

`CMAKE_CXX_STANDARD` may be used to configure toolchain.

* Use `//vars.bzl` for each BUILD files

It would be smarter if the BUILD phase could generate `llvm-config.h`.
Since I am afraid of the discussion in D126581, I just remove
LLVM_VERSION stuff out of the static `llvm-config.h`.

* Eliminate Bazel stuff in 'bump-version.py'

Current version of `bump-version.py` tries to substitute CLANG_VERSION.
It is the reason why I modify bump-version in this change rather than
incoming patch.

Differential Revision: https://reviews.llvm.org/D136392
2023-01-14 10:26:01 +09:00
Joseph Huber
d1f4bfd2a8 [Clang] Remove CLANG_OPENMP_NVPTX_DEFAULT_ARCH CMake option.
The `CLANG_OPENMP_NVPTX_DEFAULT_ARCH` is a static build configuration to
set the default OpenMP value. This was replaced in D141708 with the use
of the `nvptx-arch` tool which lets us query this at runtime instead.
This makes the behaviour between AMD and NVIDIA be more consisten and
allows users to have a default architecture that does not rely on
whoever configured the LLVM build.

Depends on D141708

Reviewed By: tra, MaskRay

Differential Revision: https://reviews.llvm.org/D141723
2023-01-13 16:52:07 -06:00
Alex Brachet
521554a7ee Revert "[clang-scan-deps] Migrate to OptTable"
This reverts commit 0c60ec699fc1ccca2e444ceb041cad9b1dca3a64.
2023-01-13 18:17:46 +00:00
Alex Brachet
0c60ec699f [clang-scan-deps] Migrate to OptTable
Differential Revision: https://reviews.llvm.org/D139949
2023-01-13 18:11:29 +00:00
Dmitri Gribenko
208c5fbdbc [bazel] Updates for aa0883b59a 2023-01-13 10:56:24 +01:00
Matthias Springer
fcd4778bdf [mlir][affine][transform] Simplify affine.min/max ops with given constraints
This transform op uses `mlir::simplifyConstrainedMinMaxOp` to simplify `affine.min` and `affine.max` ops based on a given constraints.

Differential Revision: https://reviews.llvm.org/D140997
2023-01-13 10:28:51 +01:00
Jordan Rupprecht
3432f4bf86 [test] Split out Annotations from TestingSupport
The Annotations helper class does not have a gtest or gmock dependency, but because it's bundled with the rest of TestingSupport, it gets one. By splitting it out, a target can use it without being forced to use LLVM's copy of gtest.

Reviewed By: GMNGeoffrey, sammccall, gribozavr2

Differential Revision: https://reviews.llvm.org/D141175
2023-01-12 13:40:47 -08:00
Fangrui Song
de522fd193 [bazel] Fix --features=layering_check issues and enable layering_check for lld 2023-01-12 13:08:06 -08:00
Fangrui Song
bd2658d3b5 [bazel] Enable layering_check for llvm and clang
Similar to D113952 for mlir.

I have added many missing dependencies so that
`bazel-5.0.0 build --config=generic_clang --features=layering_check @llvm-project//llvm:all @llvm-project//clang:all`
works now.
Enable the feature to ensure layering and catch circular dependencies
(https://llvm.org/docs/CodingStandards.html#library-layering).

Reviewed By: GMNGeoffrey, rupprecht

Differential Revision: https://reviews.llvm.org/D141553
2023-01-11 17:27:56 -08:00
Fangrui Song
d6e04ba230 [bazel] Fix all remaining --features=layering_check issues for @llvm-project//clang:all 2023-01-11 17:24:47 -08:00
Fangrui Song
b5a4620131 [bazel] Fix all remaining --features=layering_check issues for @llvm-project//llvm:all 2023-01-11 17:09:09 -08:00
Fangrui Song
db22d3c933 [bazel] Fix some --features=layering_check issues 2023-01-11 15:30:54 -08:00
Caroline Tice
bdcba89356 [Bazel] Fix typo (missing comma) in previous commit.
Commit b4477dd8c5d1f9b27cc6d8f52106359e4f0afe66,
"[Bazel] Add //llvm:TargetParser depenendency to clang driver for RISCVTargetParserDef.inc",
was missing a comma. This fixes that.
2023-01-11 11:11:25 -08:00
Caroline Tice
b4477dd8c5 [Bazel] Add //llvm:TargetParser depenendency to clang driver for RISCVTargetParserDef.inc
Recent update missed this dependency.
2023-01-11 11:09:20 -08:00
NAKAMURA Takumi
1bdb295494 [Bazel] Enable LoongArch by default, corresponding to llvmorg-16-init-16825-g85865f965d57 2023-01-11 23:45:20 +09:00
NAKAMURA Takumi
c041f6d99d [Bazel] Create LoongArch target. 2023-01-11 23:45:20 +09:00
NAKAMURA Takumi
4313b6f9eb [Bazel] Update //llvm:TargetParser for RISCVTargetParserDef.inc
It has been introduced since llvmorg-16-init-16838-gac1ffd3caca1
2023-01-11 23:07:04 +09:00
Alex Brachet
f296dce763 Reland: "[libc] Templatize str{,n}cmp"
This will be used to implement the case insensitive str{,n}casecmp

This was initially reverted because it broke tests on arm platforms.
Unfortunately, it didn't break on my arm machine, but I suspect the
problem was the old comparator returned char and not int.

Differential Revision: https://reviews.llvm.org/D141235
2023-01-10 15:39:54 +00:00
Alex Brachet
3af4e4031d Revert "[libc] Templatize str{,n}cmp"
This reverts commit c6dcbed2e5327f0c11962bdbbcd02f1b5c570fea.

Broke tests on arm and aarch64
2023-01-09 20:24:16 +00:00
Alex Brachet
c6dcbed2e5 [libc] Templatize str{,n}cmp
This will be used to implement the case insensitive str{,n}casecmp

Differential Revision: https://reviews.llvm.org/D141235
2023-01-09 20:13:02 +00:00
Dmitri Gribenko
2d32a01b9f [bazel] Updates for 496f9a7d8d 2023-01-09 10:36:16 +01:00
Dmitri Gribenko
dd9298baec [bazel] Update the mpfr URL to a stable one
mpfr has released a new version, and now the old tar.gz URL does not
work anymore. Update the URL to a stable one.
2023-01-09 10:36:15 +01:00
Alex Zinenko
054ec47c91 [mlir] NFC: move DiagnosedSilenceableFailure to Utils in Transform dialect
It was originally placed in TransformInterfaces for convenience, but it
is really a generic utility. It may also create an include cycle between
TransformTypes and TransformInterfaces if the latter needs to include
the former because the former uses the failure util.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D140978
2023-01-06 12:23:37 +00:00
Benjamin Kramer
943d8644df [bazel] Add missing :Support dependency after 1b8224537070 2023-01-06 12:51:38 +01:00
Jakub Kuderski
47232bea9e [mlir][spirv] Fix extended umul expansion for WebGPU
Fix an off-by-one error in extended umul extension for WebGPU.
Revert to the long multiplication algorithm originally added to wide
integer emulation, which was deleted in D139776. It is much easier
to see why it is correct.

Add runtime tests based on the mlir-vulkan-runner. These run both with
and without umul extension.

Issue: https://github.com/llvm/llvm-project/issues/59563

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D141085
2023-01-05 18:41:26 -05:00
Guillaume Chatelet
8ec0a36967 [llvm-exegesis] Allow building llvm_exegesis_tests on builtkite 2023-01-04 10:43:03 +00:00
Matthias Springer
3a5811a337 [mlir][affine][NFC] Extract core functionality of canonicalizeMinMaxOp
Move code from SCF to Affine: Add a new helper function `simplifyConstrainedMinMaxOp` to Affine/Analysis/Utils.h. `canonicalizeMinMaxOp` was originally designed for loop peeling, but it is not SCF-specific and can be used to simplify any affine.min/max ops.

Various functions in SCF/Transforms are simplified by dropping unnecessary parameters.

Differential Revision: https://reviews.llvm.org/D140962
2023-01-04 11:25:44 +01:00
Haojian Wu
d2ab0134ed Fix the broken bazel build for f6076bd81fce06bb29f83d370b8298110ecc2f99 2023-01-03 00:03:27 +01:00
Adrian Kuegel
9cd113a2a8 [mlir][Bazel] Port cf487cce6f64 2023-01-02 13:05:59 +01:00
NAKAMURA Takumi
5d4cebfa52 [Bazel] Exclude lib/Headers/openmp_wrappers/stdlib.h out of builtin_headers
It has been there since llvmorg-16-init-14999-g07ff3c5ccce6
2022-12-30 13:23:00 +09:00
Jordan Rupprecht
f92ae6dd30 [test] Exclude //llvm/unittests:llvm_exegesis_tests due to buildkite environment.
Buildkite does not allow user perf monitoring and fails: https://buildkite.com/llvm-project/upstream-bazel/builds/49579.

```
[ RUN      ] PerfHelperTest.FunctionalTest
Unable to open event. ERRNO: Permission denied. Make sure your kernel allows user space perf monitoring.
You may want to try:
$ sudo sh -c 'echo -1 > /proc/sys/kernel/perf_event_paranoid'
llvm_exegesis_tests: external/llvm-project/llvm/tools/llvm-exegesis/lib/PerfHelper.cpp:111: llvm::exegesis::pfm::Counter::Counter(llvm::exegesis::pfm::PerfEvent &&): Assertion `FileDescriptor != -1 && "Unable to open event"' failed.
```
2022-12-28 08:43:04 -08:00
Jordan Rupprecht
4aa77690b9 [bazel] Restore libpfm as a conditional dependency for exegesis.
We used to have `pfm` built into exegesis, although since it's an external dependency we marked it as a manual target. Because of this we didn't have buildbot coverage and so we removed it in D134510 after we had a few breakages that weren't caught. This adds it back, but with three possible states similar to the story with `mpfr`, i.e. it can either be disabled, built from external sources (git/make), or use whatever `-lpfm` is installed on the system.

This change is modeled after D119547. Like that patch, the default is off (matching the status quo), but unlike that patch we don't enable it for CI because IIRC we don't have the package installed there, and building from source might be expensive. We could  enable it later either after installing it on buildbot machines or by measuring build cost and deeming it OK.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D138470
2022-12-28 08:13:20 -08:00
Guillaume Chatelet
4e9ac30816 [reland][libc][NFC] Add -fno-lax-vector-conversions compilation flag
Now that a3d2c344773cc4fc95136fd67245880b34d8e335 has been submitted.
2022-12-27 10:32:41 +00:00
Guillaume Chatelet
d065472c9e Revert "[libc][NFC] Add -fno-lax-vector-conversions compilation flag"
This breaks aarch64 build.

This reverts commit 32f4c3f1033e32b7d2b7ba310c46c8c0d4013eb0.
2022-12-27 08:30:19 +00:00
Guillaume Chatelet
32f4c3f103 [libc][NFC] Add -fno-lax-vector-conversions compilation flag 2022-12-27 08:25:32 +00:00
Peiming Liu
34efb3c47c [bazel] fix bazel file.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D140589
2022-12-22 23:09:25 +00:00