Commit Graph

142 Commits

Author SHA1 Message Date
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
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
David Spickett 810d4a6ff6 [utils] Don't print username in arcanist clang format message
I didn't realise this message was also posted to the phabricator review.

Just say "the user's local path". "local" is the important part,
the username is not important.
2021-05-14 14:33:00 +00:00
David Spickett 0326d4667a [Utils] Use whoami to get username for arcanist warning message
959eec1fdd changed the message
to show the local username with "$user" but this is not always set.

Some systems will have USER/USERNAME/LOGNAME, so just use "whoami"
instead.
2021-05-13 11:11:43 +01:00
Shivam Gupta 959eec1fdd
[NFC] Give better diagnose on clang-format not found error
Contributors often confused by whether this is a server or local issue.
2021-05-04 09:22:06 +05:30
Richard Smith c25da4b04a Fix arc lint's clang-format rule: only format the file we were asked to format.
This avoids diffs being applied in the work tree to files that are
supposed to be excluded (clang tests), allows arc to properly provide
interactive feedback for the formatting fixes, and reduces the number of
files that we format, in a change affecting N files, from N^2 to N.
2020-10-11 14:24:23 -07:00
Scott Linder ad08ecbd16 Use in-tree clang-format-diff.py as Arcanist linter
Summary:
The only guarantee there seems to be in the clang-format packaging is
that an executable called `clang-format` is in the PATH. Use the
in-tree `clang-format-diff.py` to avoid assuming anything else.

Also remove dead code for SVN repo and switch to `git diff-index` which
is the git plumbing equivalent of `git diff` in this case.

Reviewers: starsid, mehdi_amini, vitalybuka, fhahn, kadircet

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77428
2020-04-06 12:02:20 -04:00
Kadir Cetinkaya 3e1b8db309
Revert "Use git-clang-format as Arcanist linter"
This reverts commit 31b6e182f2.

As it was breaking `arc diff` workflow for multiple people.
2020-04-03 15:35:41 +02:00
Vitaly Buka 1aee1ae532 Use --style file instead of --style LLVM
LLVM includes .clang-format files which must be respected.
2020-04-03 01:37:56 -07:00
Siddhartha Bagaria 31b6e182f2 Use git-clang-format as Arcanist linter
D49116 was using clang-format-diff because at the time of its writing,
it needed to handle the subversion repo as well.

Differential Revision: https://reviews.llvm.org/D77363
2020-04-03 04:53:33 +00:00
Siddhartha Bagaria 3c371491a2 Setup clang-format as an Arcanist linter
Summary:
This uses clang-format-diff as a linter for Arcanist.

`arc lint` flow, also run as part of `arc diff` unless skipped with
`--nolint`, will now run the linter shell script on the changed files,
and prompt the user to accept the suggested changes.

Message when clang-format-diff is not installed:
{F6654094}

Example of the noise during code review when clang-format-diff is not installed:
https://reviews.llvm.org/differential/changeset/?ref=1115809

Prompt when clang-format-diff is installed and suggests edits:
{F6650223}

Reviewers: probinson, scott.linder

Reviewed By: scott.linder

Subscribers: scott.linder, MyDeveloperDay, JonasToth, danilaml, JDevlieghere, dberris, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D49116
2020-03-30 15:02:33 -04:00