Commit Graph

277 Commits

Author SHA1 Message Date
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
Eric Christopher 5553d83ada Update Bazel overlay in GPUToGPURuntimeTransforms. 2021-07-08 21:39:26 -07:00
Rob Suderman 82563d8d14 [mlir][bazel] Added missing MathDialect dep to LinalgOps target
LinalgOps needs MathDialect as a dependency for it to build correctly.

Differential Revision: https://reviews.llvm.org/D105656
2021-07-08 13:47:42 -07:00
Jordan Rupprecht 74c308c56a [Bazel] Fixes for b5d847b1b9 and 6412a13539 2021-07-07 16:50:23 -07:00
Fangrui Song cae3b831f4 [llvm-nm] 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"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105330
2021-07-07 13:34:33 -07:00
Benjamin Kramer 775cac4cca [Bazel] Fix build for 98f078324f 2021-07-05 22:40:18 +02:00
Benjamin Kramer b3f5d0639e [Bazel] Fix build for 35d4593e6b 2021-07-05 22:40:18 +02:00
Geoffrey Martin-Noble 7c5d654f64 [Bazel] Fix build for c0a6318d96
This adds explicit deps to satisfy layering_check

Differential Revision: https://reviews.llvm.org/D105356
2021-07-02 09:22:33 -07:00
Rob Suderman 06ac83fcac [mlir][tosa] Update Bazel files for TOSA pass changes
There were some missing bazel dependencies for the Tosa dialect.
Added these deps.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D105326
2021-07-01 17:45:00 -07:00
Geoffrey Martin-Noble bef9464c51 [Bazel] Fixes for 266a7414d8
Adds LinalgOps dep needed for
https://github.com/llvm/llvm-project/commit/266a7414d8f26

Differential Revision: https://reviews.llvm.org/D105294
2021-07-01 09:40:07 -07:00
Geoffrey Martin-Noble d08f8960d0 [Bazel] add missing load to submodule example
I missed this in https://reviews.llvm.org/D105245

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D105252
2021-06-30 19:35:27 -07:00
Geoffrey Martin-Noble 4aa1c141bd [Bazel] Rework LLVM target selection
This patch introduces a custom rule for expanding the LLVM target
enumeration .def files. This provides a slightly cleaner API for these
rules, but is mostly to permit selects to be used when determining which
LLVM targets to build. Right now the target list is generated at Bazel
configure time, but this will allows us to add functionality to also
control which targets are built based on config settings.

Tested: Ran `bazel test --config=rbe ... @llvm-project//...`

Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D104969
2021-06-30 16:53:00 -07:00
Geoffrey Martin-Noble 9cc1ddd393 [Bazel] Update README with examples
Reviewed By: chandlerc

Differential Revision: https://reviews.llvm.org/D105245
2021-06-30 16:50:23 -07:00
Stella Laurenzo 485cc55edf [mlir] Generare .cpp.inc files for dialects.
* Previously, we were only generating .h.inc files. We foresee the need to also generate implementations and this is a step towards that.
* Discussed in https://llvm.discourse.group/t/generating-cpp-inc-files-for-dialects/3732/2
* Deviates from the discussion above by generating a default constructor in the .cpp.inc file (and adding a tablegen bit that disables this in case if this is user provided).
* Generating the destructor started as a way to flush out the missing includes (produces a link error), but it is a strict improvement on its own that is worth doing (i.e. by emitting key methods in the .cpp file, we root vtables in one translation unit, which is a non-controversial improvement).

Differential Revision: https://reviews.llvm.org/D105070
2021-06-29 20:10:30 +00:00
Geoffrey Martin-Noble 09ac97ce35 [Bazel] Update for 0813700de1
Updates Bazel BUILD files for changes in
https://github.com/llvm/llvm-project/commit/0813700de1

Differential Revision: https://reviews.llvm.org/D104990
2021-06-27 08:33:03 -07:00
Aart Bik 557b101ce7 [mlir][sparse] add print methods to Merger (for debugging)
Reviewed By: gussmith23

Differential Revision: https://reviews.llvm.org/D104939
2021-06-25 15:10:06 -07:00
Geoffrey Martin-Noble f0dd6faaec Update Bazel build for 744146f60b
Updates Bazel build files to match
https://github.com/llvm/llvm-project/commit/744146f60b

Differential Revision: https://reviews.llvm.org/D104885
2021-06-24 16:38:16 -07:00
Geoffrey Martin-Noble 1ca4cf9b24 Update Bazel build for 929189a499
Updates Bazel build files to match
https://github.com/llvm/llvm-project/commit/929189a499

Differential Revision: https://reviews.llvm.org/D104864
2021-06-24 09:43:47 -07:00
Geoffrey Martin-Noble b58dfd87da Update Bazel BUILD files up to be9a87fe9b
Differential Revision: https://reviews.llvm.org/D104791
2021-06-23 09:27:26 -07:00
Geoffrey Martin-Noble 4aeb2e60df Introduce a Bazel build configuration
This patch introduces configuration for a Bazel BUILD in a side
directory in the monorepo.

This is following the approval of
https://github.com/llvm/llvm-www/blob/main/proposals/LP0002-BazelBuildConfiguration.md

As detailed in the README, the Bazel BUILD is not supported
by the community in general, and is maintained only by interested
parties. It follows the requirements of the LLVM peripheral tier:
https://llvm.org/docs/SupportPolicy.html#peripheral-tier.

This is largely copied from https://github.com/google/llvm-bazel,
with a few filepath tweaks and the addition of the README.

Reviewed By: echristo, keith, dblaikie, kuhar

Differential Revision: https://reviews.llvm.org/D90352
2021-06-22 12:47:43 -07:00