Commit Graph

78 Commits

Author SHA1 Message Date
Adrian Kuegel 3c6f115ffc [mlir] Remove unused header include.
Also adjust BUILD.bazel and remove an unused dependency.

Differential Revision: https://reviews.llvm.org/D108027
2021-08-13 14:23:14 +02:00
Adrian Kuegel 970129a2dd [clang] Adjust BUILD.bazel file to also generate AttrDocTable.
Differential Revision: https://reviews.llvm.org/D108017
2021-08-13 09:00:44 +02:00
Emilio Cota 7f3c3d7aa4 [mlir] BUILD.bazel: remove LLVMDialect from MathTransforms
c1ebefdf77 "[mlir] Make polynomial approximation emit
std instead of LLVM ops" removed the dependence on LLVMDialect.

Remove the dependence also from BUILD.bazel.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D107908
2021-08-11 22:27:04 +02:00
Geoffrey Martin-Noble f8b6e1faa9 [Bazel] Update for 9854f2f30f (Diff library)
Updates the Bazel build for
https://github.com/llvm/llvm-project/commit/9854f2f30f by extracting a
library from llvm-diff. Note that this does not include the new
llvm-livepatch binary, for which the CMake file was added accidentally
and reverted in https://github.com/llvm/llvm-project/commit/fec8f1a008.

Differential Revision: https://reviews.llvm.org/D107586
2021-08-05 11:01:44 -07:00
Daniele Vettorel 180f4a87c5 Add llvm-stress binary to Bazel build configuration.
The `llvm-stress` binary is currently missing from the Bazel `BUILD` file for llvm. This patch adds it.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D107571
2021-08-05 12:35:46 -04:00
Geoffrey Martin-Noble 693a95a694 [Bazel] Add support for lld
This patch adds a Bazel configuration to build lld. That includes a
BUILD.bazel file to export the libunwind headers for use by lld. Since
the lld target itself requires libxml2 (through WindowsManifest) it's
currently disabled on Buildkite and marked manual, but all the libraries
build.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D107414
2021-08-04 17:59:43 -07:00
Geoffrey Martin-Noble 981ad13ac6 [Bazel] Drop deprecated tblgen includes mechanism
Includes can now be fully managed via td_library and specified locally
to the tablegen files that require them. This has been deprecated for a
while and is not used upstream. I'm not aware of any downstream users
either.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D107389
2021-08-04 13:19:08 -07:00
Geoffrey Martin-Noble b0d58ddf87 [Bazel] Update build for ee7d20e846
Updates the Bazel configuration for
https://github.com/llvm/llvm-project/commit/ee7d20e84675. We need to
drop the dependency from llvm-tblgen to avoid a dependency cycle:

```
.-> @llvm-project//llvm:llvm-tblgen
|   @llvm-project//llvm:tblgen
|   @llvm-project//llvm:MC
|   @llvm-project//llvm:ProfileData
|   @llvm-project//llvm:Core
|   @llvm-project//llvm:attributes_gen
|   @llvm-project//llvm:include/llvm/IR/Attributes.inc
|   @llvm-project//llvm:attributes_gen__gen_attrs_genrule
`-- @llvm-project//llvm:llvm-tblgen
```

It appears this dep was not strictly necessary though. TableGen uses MC
headers but it can get those through Support, which also exports MC
headers due to layering issues.

Differential Revision: https://reviews.llvm.org/D107480
2021-08-04 10:08:57 -07:00
Adrian Kuegel 8385de1184 [mlir][Bazel] Adjust BUILD.bazel file.
The dependency is needed after 1b00b94ffc

Differential Revision: https://reviews.llvm.org/D107426
2021-08-04 08:51:02 +02:00
Matthias Springer 3a41ff4883 [mlir][SCF] Peel scf.for loops for even step divison
Add ForLoopBoundSpecialization pass, which specializes scf.for loops into a "main loop" where `step` divides the iteration space evenly and into an scf.if that handles the last iteration.

This transformation is useful for vectorization and loop tiling. E.g., when vectorizing loads/stores, programs will spend most of their time in the main loop, in which only unmasked loads/stores are used. Only the in the last iteration (scf.if), slower masked loads/stores are used.

Subsequent commits will apply this transformation in the SparseDialect and in Linalg's loop tiling.

Differential Revision: https://reviews.llvm.org/D105804
2021-08-03 10:21:38 +09:00
Shivam Gupta c3f19804f3 [Bazel] Typo fix
Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D107142
2021-07-30 08:38:39 -07:00
Geoffrey Martin-Noble d983499543 [Bazel] Make td_library usable as data
This patch makes it possible to list a td_library as a rule's data
attribute and get its source files and all its transitive dependencies
at runtime. This is useful for, e.g. shell tests running tblgen.

Note that this is a bit different from how a "normal" (e.g. C++) library
rule would work because those have actual library outputs and the
td_library rule just bundles some source files and includes. If someone
wanted to make use of the includes, they would have to access the TdInfo
provider, but this keeps simple things simple.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106922
2021-07-29 18:12:39 -07:00
Geoffrey Martin-Noble f3a8a7b91e [Bazel] Unconditionally define STDC LIMIT/CONSTANT/FORMAT
These are unconditionally included in the CMake build as well and
necessary for some odd platforms (even though the C++11 standard says
they shouldn't be).

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D107123
2021-07-29 18:11:52 -07:00
Geoffrey Martin-Noble 6fa2d0fbf4 [Bazel] Derive targets from file presence as in CMake build
This makes the logic used to determine if targets have the given
features the same as is used in CMake. Incidentally, it enables these
features for the targets added in https://reviews.llvm.org/D106921
which were missing because this was previously a hardcoded list.

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D107019
2021-07-29 18:10:46 -07:00
Lei Zhang 26be7fe27c [mlir] NFC: split MemRef to SPIR-V conversion into their own files
Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D107094
2021-07-29 16:34:10 -04:00
Lei Zhang 995c3984ef [mlir] NFC: split Math to SPIR-V conversion into their own files
Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D107093
2021-07-29 16:34:10 -04:00
Stella Laurenzo 768f562641 Update file names and extensions for MLIR Python execution engine changes. 2021-07-29 03:19:14 +00:00
Geoffrey Martin-Noble 91842bf6aa [Bazel] Fix digest for bazel-skylib 1.0.3
I apparently left in the old digest when updating the version, so for my
local build Bazel just happily used the cached version, but anyone
attempting a fresth build would get a mismatch.

Differential Revision: https://reviews.llvm.org/D107010
2021-07-28 15:36:51 -07:00
Itai Zukerman 3ff451ca6a [Bazel] Added missing targets to LLVM bazel rules.
Added the following targets to the LLVM Bazel overlay:

AVR
Mips
MPS430
SystemZ
XCore

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D106921
2021-07-28 13:32:18 -07:00
Geoffrey Martin-Noble 668aa531d6 [Bazel] Update for dbed061bf1
This adds Bazel configuration for the TargetMCA targets, which currently
only includes AMDGPU.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D106996
2021-07-28 13:24:16 -07:00
Jacques Pienaar d1c7a57fe8 [mlir][bzl] Fix typo 2021-07-27 13:32:09 -07:00
Eugene Zhulenev de7a4e53a2 [mlir] Async: lower SCF operations into CFG inside coroutines
Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D106747
2021-07-24 14:36:26 -07:00
Geoffrey Martin-Noble 3f2c1e99e4 [Bazel] Swap stray td_srcs to deps
This is the last instance of td_srcs in MLIR core build files. `deps` is
generally preferred. There are still some cases where `td_srcs` is
useful where creating a td_library would just be another layer of
indirection, so not (yet) dropping it entirely.

Differential Revision: https://reviews.llvm.org/D106716
2021-07-23 15:07:17 -07:00
Geoffrey Martin-Noble be583be23b [Bazel] Rename LLVMDWP to DWP
Since Bazel has packages, we don't prefix target names with LLVM. I
forgot when translating the CMake.
2021-07-22 16:05:43 -07:00
Michael McLoughlin b4f8a000f6 [Bazel] Change external_zlib attribute to string
When using `llvm_zlib_external` rule with `external_zlib` attribute set to a
label referring to the main repository, like `@//third_party/zlib`, it will be
replaced with `//third_party/zlib` after template substitution. This will then
attempt to find `//third_party/zlib` within the local repository
`@llvm_zlib//third_party/zlib`, which does not exist, rather than the intended
reference back to the main repository. The issue appears to be that the
conversion of `Label` type to string with
`str(repository_ctx.attr.external_zlib)`, which is causing the main repository
qualifier to be lost.

This diff fixes the issue by changing the `external_zlib` attribute to
`attr.string` type rather than `attr.label`.

In future a more elegant solution may be possible that preserves use of the
`Label` type, depending on resolution of the issue
https://github.com/bazelbuild/bazel/issues/13731.

Ported from Github PR https://github.com/google/llvm-bazel/pull/236.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D106606
2021-07-22 16:02:37 -07:00
Geoffrey Martin-Noble 25c02b32a4 [Bazel] Update for f8c6515554
Update Bazel for
https://github.com/llvm/llvm-project/commit/f8c6515554 by splitting out
an LLVMDWP library target.
2021-07-22 14:53:08 -07:00
Geoffrey Martin-Noble 13e5aa8973 [Bazel] Remove deprecated td_relative_includes
This has been deprecated for a while and there are no in-tree usages.
I'm not aware of any out-of-tree usages either.
2021-07-21 08:38:15 -07:00
Geoffrey Martin-Noble 65cead410b [Bazel] Remove copypasta from linalggen.bzl 2021-07-20 17:27:40 -07:00
Geoffrey Martin-Noble cb53febe3d [Bazel] Remove explicit relative_to_caller_repository
This is the default and the argument is deprecated. The documentation
indicating it's the default is only since 4.0
(https://docs.bazel.build/versions/4.0.0/skylark/lib/Label.html#Label),
but looking at the code it has been the default since its introduction
in https://bazel.googlesource.com/bazel/+/6f15335dea with Bazel 0.2.1
(https://bazel.googlesource.com/bazel/+show/0.2.1/CHANGELOG.md)

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106411
2021-07-20 16:42:31 -07:00
Geoffrey Martin-Noble 3b2e40c08e [Bazel] Fix Exegesis target reference and remove stray visibility 2021-07-20 15:03:23 -07:00
Geoffrey Martin-Noble 57de4ac121 [Bazel] Update for bc1a2979fc
Update Bazel build configuration for
https://github.com/llvm/llvm-project/commit/bc1a2979fc70
by adding missing dep to clang tooling unit tests.
2021-07-20 08:36:03 -07:00
MaheshRavishankar 9afc065743 Split `InferShapedTypeOpInterface` to create `ReifyRankedShapedTypeInterface`.
The `reifyReturnTypeShapesPerResultDim` method supports shape
inference for rsults that are ranked types. These are used lower in
the codegeneration stack than its counter part `reifyReturnTypeShapes`
which also supports unranked types, and is more suited for use higher
up the compilation stack. To have separation of concerns, this method
is split into its own interface.
See discussion : https://llvm.discourse.group/t/better-layering-for-infershapedtypeopinterface/3823

Differential Revision: https://reviews.llvm.org/D106133
2021-07-19 14:44:52 -07:00
thomasraoux 73f1d6edc0 [mlir] Fix bazel build
Differential Revision: https://reviews.llvm.org/D106311
2021-07-19 14:06:37 -07:00
Geoffrey Martin-Noble ef648df281 [Bazel] Update for 6103fdfab4
Update Bazel config for
https://github.com/llvm/llvm-project/commit/6103fdfab4
by deleting the llvm-elfabi target.

Differential Revision: https://reviews.llvm.org/D106295
2021-07-19 11:50:47 -07:00
Fangrui Song 263fe133ed [Bazel] Delete blank line to make buildifier happy 2021-07-16 15:33:42 -07:00
Geoffrey Martin-Noble b92f28cc43 [Bazel] Add examples to bazelignore
This avoids Bazel recursing into these directories when overlayed, which
will break if someone has run Bazel in these dirs (which would only be
successful with the http_archive example) because of the Bazel directory
symlinks (already gitignored).

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105357
2021-07-16 13:58:21 -07:00
Geoffrey Martin-Noble 9c5b73fef4 [Bazel] Make gentbl_test compatible with coverage
Add explicit coverage provider. Also remove output_to_genfiles which
isn't necessary for this test (it's just copy-pasta from gentbl_rule,
which needs it for output C++ header files).

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106115
2021-07-16 13:57:15 -07:00
Geoffrey Martin-Noble 8b86b3a846 [Bazel] Use bazel_skylib paths for paths munging
We do a lot of path munging and bazel_sklyib is a pretty reasonable dep.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106175
2021-07-16 13:52:07 -07:00
Geoffrey Martin-Noble 219c729f5e [Bazel] Delete deprecated gentbl rule
This has been deprecated for a while. There are no users in tree and I'm
not aware of any out of tree users either.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D106114
2021-07-16 08:18:20 -07:00
Alexander Belyaev 46ef86b5d8 [mlir] Move linalg::Expand/CollapseShapeOp to memref dialect.
RFC: https://llvm.discourse.group/t/rfc-reshape-ops-restructuring/3310

Differential Revision: https://reviews.llvm.org/D106141
2021-07-16 13:32:17 +02:00
Alex Zinenko e4b79a542e [mlir] add an interface to support custom types in LLVM dialect pointers
This may be necessary in partial multi-stage conversion when a container type
from dialect A containing types from dialect B goes through the conversion
where only dialect A is converted to the LLVM dialect. We will need to keep a
pointer-to-non-LLVM type in the IR until a further conversion can convert
dialect B types to LLVM types.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D106076
2021-07-16 13:05:27 +02:00
Geoffrey Martin-Noble ab03ef124a [Bazel] Update for 01bdb0f75e
Update the build files for
https://github.com/llvm/llvm-project/commit/01bdb0f75efb

Tested:
bazel query //... + @llvm-project//... | xargs bazel test --config=generic_clang --config=rbe --test_output=errors --test_ta
g_filters=-nobuildkite --build_tag_filters=-nobuildkite

Differential Revision: https://reviews.llvm.org/D106075
2021-07-15 09:00:40 -07:00
Geoffrey Martin-Noble 8461995d35 [Bazel] Uniformly export all MLIR td files
CMake would have no restrictions on this and the custom list is a pain
to maintain.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D106003
2021-07-14 12:18:44 -07:00
Mehdi Amini fbab8e6f10 Remove uses of deprecated target AllPassesAndDialectsNoRegistration in Bazel (NFC)
It was an alias for a long time.
2021-07-14 19:02:50 +00:00
MaheshRavishankar f2b5e438aa [mlir][Tensor] Implement `reifyReturnTypeShapesPerResultDim` for `tensor.insert_slice`.
Differential Revision: https://reviews.llvm.org/D105852
2021-07-13 14:53:29 -07:00
Geoffrey Martin-Noble 279c3a5be3 [Bazel] ignore build files under libcxx's copy of google-benchmark
https://github.com/llvm/llvm-project/commit/5208ec5c66dc updated the
of google-benchmark under libcxx adding a BUILD.bazel file. This upsets
Bazel in our overlay configuration because it tries to interpret this
file.

Currently this is breaking the CI:
https://buildkite.com/llvm-project/upstream-bazel-rbe/builds/1828

Tested (same command the CI uses)
`bazel query //... + @llvm-project//... | xargs bazel test --config=generic-clang --config=rbe --test_output=errors --test_tag_filters=-nobuildkite --build_tag_filters=-nobuildkite`

Differential Revision: https://reviews.llvm.org/D105833
2021-07-12 12:46:13 -07:00
Geoffrey Martin-Noble 6ebbf755b6 [Bazel] Update configuration to HEAD
Bazel configuration updates for
https://github.com/llvm/llvm-project/commit/75e5f0aac97d,
https://github.com/llvm/llvm-project/commit/c282d55a3857, and
https://github.com/llvm/llvm-project/commit/26e59cc19f86

Tested: `bazel test ... @llvm-project//...`

Differential Revision: https://reviews.llvm.org/D105830
2021-07-12 11:33:53 -07:00
Fangrui Song 46580d43fc [llvm-readobj] Switch command line parsing from llvm::cl to OptTable
Users should generally observe no difference as long as they don't use
unintended option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=false` and `--demangle=0` cannot be used. Omit the option or use `--no-demangle`. Other flag-style options don't have `--no-` forms.
* `--help-list` is removed. This is a `cl::` specific option.
* llvm-readobj now supports grouped short options as well.
* `--color` is removed. This is generally not useful (only apply to errors/warnings) but was inherited from Support.

Some adjustment to the canonical forms
(usually from GNU readelf; currently llvm-readobj has too many redundant aliases):

* --dyn-syms is canonical. --dyn-symbols is a hidden alias
* --file-header is canonical. --file-headers is a hidden alias
* --histogram is canonical. --elf-hash-histogram is a hidden alias
* --relocs is canonical. --relocations is a hidden alias
* --section-groups is canonical. --elf-section-groups is a hidden alias

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

* Most one-dash long options are still supported. `-dt, -sd, -st, -sr` are dropped due to their conflict with grouped short options.
* `--section-mapping=false` (D57365) is strange but is kept for now.
* Many `cl::opt` variables were unnecessarily external. I added `static` whenever appropriate.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105532
2021-07-12 10:14:42 -07:00
Fangrui Song 47db32e542 [llvm-size] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

* `--totals=false` and `--totals=0` cannot be used. Omit the option.
* `--help-list` is removed. This is a `cl::` specific option.

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

Note: because the tool is simple, and its long options are uncommon, I just drop
the one-dash forms except `-arch <value>` (Darwin style).

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105598
2021-07-09 10:26:53 -07:00
Fangrui Song 48de8bb0d3 [llvm-cxxfilt] Switch command line parsing from llvm::cl to OptTable
Similar to D104889. The tool is very simple and its long options are uncommon,
so just drop the one-dash form in this patch.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105605
2021-07-09 10:10:45 -07:00