platform/upstream/llvm.git
2 years ago[Support] Add KnownBits::countMaxSignedBits(). Make KnownBits::countMinSignBits(...
Craig Topper [Mon, 3 Jan 2022 07:20:32 +0000 (23:20 -0800)]
[Support] Add KnownBits::countMaxSignedBits(). Make KnownBits::countMinSignBits() always return at least 1.

Even if we don't have any known bits, we can assume that there is
at least 1 sign bit. This is consistent with ComputeNumSignBits
which always returns at least 1.

Add KnownBits::countMaxSignedBits() which computes the number of
bits needed to represent all signed values with those known bits.
This is the signed equivalent of countMaxActiveBits().

Split from D116469.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D116500

2 years ago[RISCV][VP] Add RVV codegen for [nX]vXi1 vp.select
Victor Perez [Mon, 3 Jan 2022 07:12:06 +0000 (23:12 -0800)]
[RISCV][VP] Add RVV codegen for [nX]vXi1 vp.select

Expand [nX]vXi1 vp.select the same way as [nX]vXi1 vselect.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D115546

2 years ago[Transform] Remove redundant declaration PollyAllowFullFunction (NFC)
Kazu Hirata [Mon, 3 Jan 2022 07:08:40 +0000 (23:08 -0800)]
[Transform] Remove redundant declaration PollyAllowFullFunction (NFC)

The variable is declared in ScopDetection.h, which ScopInliner.cpp
includes.

Identified by readability-redundant-declaration.

2 years ago[RISCV] Prune more unnecessary vector pseudo instructions. NFC
Craig Topper [Mon, 3 Jan 2022 07:00:09 +0000 (23:00 -0800)]
[RISCV] Prune more unnecessary vector pseudo instructions. NFC

For floating point specific vector instructions, we don't need
pseudos for mf8.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D116460

2 years agoFix doc on how to run clang-tidy on MLIR codebase (NFC)
Mehdi Amini [Mon, 3 Jan 2022 06:58:45 +0000 (06:58 +0000)]
Fix doc on how to run clang-tidy on MLIR codebase (NFC)

2 years ago[Transforms] Use all_of instead of any_of (NFC)
Kazu Hirata [Mon, 3 Jan 2022 06:53:09 +0000 (22:53 -0800)]
[Transforms] Use all_of instead of any_of (NFC)

2 years ago[API] Remove redundant member initialization (NFC)
Kazu Hirata [Mon, 3 Jan 2022 06:44:15 +0000 (22:44 -0800)]
[API] Remove redundant member initialization (NFC)

Identified with readability-redundant-member-init.

2 years agoRevert "Define a `cppAccessorType` to const-ref in APFloatParameter and update ODS...
Mehdi Amini [Mon, 3 Jan 2022 06:31:44 +0000 (06:31 +0000)]
Revert "Define a `cppAccessorType` to const-ref in APFloatParameter and update ODS emitter to use it for verifier signatures"

This reverts commit 89af17c0c74eb9d8d11870f6510e475eff74eef4.

This broke the gcc5 build.

2 years ago[MLIR] Canonicalize/fold select %x, 1, 0 to extui
William S. Moses [Mon, 3 Jan 2022 04:49:29 +0000 (23:49 -0500)]
[MLIR] Canonicalize/fold select %x, 1, 0 to extui

Two canonicalizations for select %x, 1, 0
  If the return type is i1, return simply the condition %x, otherwise extui %x to the return type.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116517

2 years ago[MLIR][Arith] Canonicalize and/or with ext
William S. Moses [Mon, 3 Jan 2022 05:38:41 +0000 (00:38 -0500)]
[MLIR][Arith] Canonicalize and/or with ext

Replace and(ext(a),ext(b)) with ext(and(a,b)). This both reduces one instruction, and results in the computation (and/or) being done on a smaller type.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116519

2 years agoAdd back missing return to non-void function
Mehdi Amini [Mon, 3 Jan 2022 06:18:25 +0000 (06:18 +0000)]
Add back missing return to non-void function

It was incorrectly removed accidentally in e4e463e7476.

2 years agoRemove misused RAII gil_scoped_release/gil_scoped_acquire: without name they don...
Mehdi Amini [Mon, 3 Jan 2022 06:17:00 +0000 (06:17 +0000)]
Remove misused RAII gil_scoped_release/gil_scoped_acquire: without name they don't have any effect

I'm not sure what is the right fix here, but adding a name to all these
lead to many segfaults.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D116506

2 years ago[MLIR][NFC] Fix clang-tidy errors in Analysis/Presburger/
Groverkss [Mon, 3 Jan 2022 06:06:35 +0000 (11:36 +0530)]
[MLIR][NFC] Fix clang-tidy errors in Analysis/Presburger/

This patch fixes clang-tidy errors related to different parameter names
in header file and source file in Analysis/Presburger/ directory.

2 years agoUse cast<> instead of dyn_cast<> when we don't check the result (NFC)
Mehdi Amini [Mon, 3 Jan 2022 06:06:36 +0000 (06:06 +0000)]
Use cast<> instead of dyn_cast<> when we don't check the result (NFC)

2 years agoRemove dead return after return (NFC)
Mehdi Amini [Mon, 3 Jan 2022 06:03:34 +0000 (06:03 +0000)]
Remove dead return after return (NFC)

2 years agoRemove useless nesting blok and dead return statement in TosaToLinalg.cpp (NFC)
Mehdi Amini [Mon, 3 Jan 2022 06:02:21 +0000 (06:02 +0000)]
Remove useless nesting blok and dead return statement in TosaToLinalg.cpp (NFC)

Flagged by Coverity.

2 years agoMinor reflow of FloorDivSIOp/CeilDivSIOp folder to limit the number of APInt API...
Mehdi Amini [Mon, 3 Jan 2022 05:51:35 +0000 (05:51 +0000)]
Minor reflow of FloorDivSIOp/CeilDivSIOp folder to limit the number of APInt API calls (NFC)

Cache the result of the comparison in boolean, and check early for 0 to
leverage `(a < 0) == !(a > 0)`.

2 years ago[MLIR] Move LinearTransform to Presburger/
Groverkss [Mon, 3 Jan 2022 05:40:14 +0000 (11:10 +0530)]
[MLIR] Move LinearTransform to Presburger/

This patch moves LinearTransform to Presburger/ and makes it use
IntegerPolyhedron instead of FlatAffineConstraints. Also modifies its usage in
`FlatAffineConstraints::findIntegerSample` to support the changes.

This patch is part of a series of patches for moving presburger math functionality into Presburger directory.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116311

2 years ago[MLIR] Create folders for extsi/extui
William S. Moses [Mon, 3 Jan 2022 03:06:57 +0000 (22:06 -0500)]
[MLIR] Create folders for extsi/extui

Create folders/canonicalizers for extsi/extui. Specifically,

extui(extui(x)) -> extui(x)
extsi(extsi(x)) -> extsi(x)
extsi(extui(x)) -> extui(x)

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116515

2 years agoDefine a `cppAccessorType` to const-ref in APFloatParameter and update ODS emitter...
Mehdi Amini [Mon, 3 Jan 2022 04:56:08 +0000 (04:56 +0000)]
Define a `cppAccessorType` to const-ref in APFloatParameter and update ODS emitter to use it for verifier signatures

This reduce an unnecessary amount of copy of non-trivial objects, like
APFloat.

Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D116505

2 years agoAdd a script to run clang-tidy on the entire MLIR codebase
Mehdi Amini [Mon, 3 Jan 2022 04:53:10 +0000 (04:53 +0000)]
Add a script to run clang-tidy on the entire MLIR codebase

2 years ago[JITLink] Move AllocActions and associated types out of JITLinkMemoryManager.
Lang Hames [Mon, 3 Jan 2022 03:33:23 +0000 (14:33 +1100)]
[JITLink] Move AllocActions and associated types out of JITLinkMemoryManager.

They're shared with LinkGraph, so having them as top-level types makes sense,
and saves users from qualifying the names everywhere.

2 years agoApply clang-tidy fixes for misc-unused-parameters in MLIR AffineStructures.cpp (NFC)
Mehdi Amini [Mon, 3 Jan 2022 02:32:10 +0000 (02:32 +0000)]
Apply clang-tidy fixes for misc-unused-parameters in MLIR AffineStructures.cpp (NFC)

2 years ago[clang][AST] Fix crash when printing error
Ellis Hoag [Mon, 3 Jan 2022 02:02:08 +0000 (18:02 -0800)]
[clang][AST] Fix crash when printing error

Clang will crash if it tries to compile the following code. This commit
fixes it.
```
$ cat foo.c
void foo(_Nullable int *ptr) {
    __auto_type _Nonnull a = ptr;
};
$ clang foo.c -c -Wnullable-to-nonnull-conversion
```

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D116342

2 years ago[MLIR] Create fold for cmp of ext
William S. Moses [Sun, 2 Jan 2022 22:44:08 +0000 (17:44 -0500)]
[MLIR] Create fold for cmp of ext

This patch creates folds for cmpi( ext(%x : i1, iN) != 0) -> %x

In essence this matches patterns matching an extension of a boolean, that != 0, which is equivalent to the original condition.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116504

2 years ago[llvm-profgen] Error out for unsupported AutoFDO profile generate with probe
Wenlei He [Mon, 3 Jan 2022 00:25:27 +0000 (16:25 -0800)]
[llvm-profgen] Error out for unsupported AutoFDO profile generate with probe

Error out instead of siliently generate empty profile when trying to generate AutoFDO profile with probe binary.

Differential Revision: https://reviews.llvm.org/D116508

2 years agoUse `= default` for the ValueShapeRange copy-constructor (NFC)
Mehdi Amini [Sun, 2 Jan 2022 23:43:52 +0000 (23:43 +0000)]
Use `= default` for the ValueShapeRange copy-constructor (NFC)

This makes it trivially copyable.

2 years agoReplace raw-loop with llvm::any_of() in PresburgerSet.cpp (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:39:57 +0000 (22:39 +0000)]
Replace raw-loop with llvm::any_of() in PresburgerSet.cpp (NFC)

Reported by clang-tidy.

2 years agoApply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:02:20 +0000 (22:02 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)

2 years agoApply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:02:18 +0000 (22:02 +0000)]
Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)

2 years agoApply clang-tidy fixes for readability-simplify-boolean-expr to MLIR NormalizeMemRefs...
Mehdi Amini [Sun, 2 Jan 2022 22:02:21 +0000 (22:02 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR NormalizeMemRefs.cpp (NFC)

2 years ago[clang] [MinGW] Pass --no-demangle through to the mingw linker
Martin Storsjö [Tue, 16 Nov 2021 21:10:48 +0000 (23:10 +0200)]
[clang] [MinGW] Pass --no-demangle through to the mingw linker

Clang has custom handling of --no-demangle, where it is removed
from the input -Wl and -Xlinker options, and readded specifically
by the drivers where it's known to be supported.

Both ld.bfd and lld support the --no-demangle option. This handles
the option in the same way as in ToolChains/Gnu.cpp.

Differential Revision: https://reviews.llvm.org/D114064

2 years agoApply clang-tidy fixes for performance-for-range-copy to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:02:14 +0000 (22:02 +0000)]
Apply clang-tidy fixes for performance-for-range-copy to MLIR (NFC)

2 years agoApply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:01:50 +0000 (22:01 +0000)]
Apply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)

2 years agoApply clang-tidy fixes for modernize-use-default-member-init to MLIR ReductionNode...
Mehdi Amini [Sun, 2 Jan 2022 22:01:48 +0000 (22:01 +0000)]
Apply clang-tidy fixes for modernize-use-default-member-init to MLIR ReductionNode.cpp (NFC)

2 years agoApply clang-tidy fixes for bugprone-argument-comment to MLIR ArithmeticOps.cpp (NFC)
Mehdi Amini [Sun, 2 Jan 2022 22:01:07 +0000 (22:01 +0000)]
Apply clang-tidy fixes for bugprone-argument-comment to MLIR ArithmeticOps.cpp (NFC)

2 years ago[clang] Allow using std::coroutine_traits in std::experimental
Nathan Sidwell [Sat, 25 Dec 2021 18:30:42 +0000 (13:30 -0500)]
[clang] Allow using std::coroutine_traits in  std::experimental

This is that diff I was aiming for.  When transitioning code from
coroutines-ts to c++20, it can be useful to add a using declaration to
std::experimental pointing to std::coroutine_traits.  This permits
that use by checking whether lookup in std::experimentl finds a
different decl to lookup in std.  You still get a warning about
std::experimental::coroutine_traits being a thing, just not an error.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D115943

2 years agoPrecommit SCEV symbolic w.overflow exit tests
Philip Reames [Sun, 2 Jan 2022 19:37:06 +0000 (11:37 -0800)]
Precommit SCEV symbolic w.overflow exit tests

2 years ago[lldb] Remove unused AproposAllSubCommands (NFC)
Dave Lee [Sun, 2 Jan 2022 03:30:08 +0000 (19:30 -0800)]
[lldb] Remove unused AproposAllSubCommands (NFC)

2 years agoAutogen a SCEV test for ease of update
Philip Reames [Sun, 2 Jan 2022 19:27:18 +0000 (11:27 -0800)]
Autogen a SCEV test for ease of update

2 years ago[LV] Use Builder.CreateVectorReverse directly. (NFC)
Florian Hahn [Sun, 2 Jan 2022 19:09:30 +0000 (19:09 +0000)]
[LV] Use Builder.CreateVectorReverse directly. (NFC)

IRBuilder::CreateVectorReverse already handles all cases required by
LoopVectorize. It can be used directly instead of reverseVector.

2 years ago[clang] Remove redundant member initialization (NFC)
Kazu Hirata [Sun, 2 Jan 2022 18:20:23 +0000 (10:20 -0800)]
[clang] Remove redundant member initialization (NFC)

Identified with readability-redundant-member-init.

2 years ago[wasm] Use nullptr instead of NULL (NFC)
Kazu Hirata [Sun, 2 Jan 2022 18:20:21 +0000 (10:20 -0800)]
[wasm] Use nullptr instead of NULL (NFC)

Identified with modernize-use-nullptr.

2 years agoRemove redundant void arguments (NFC)
Kazu Hirata [Sun, 2 Jan 2022 18:20:19 +0000 (10:20 -0800)]
Remove redundant void arguments (NFC)

Identified by modernize-redundant-void-arg.

2 years agoRemove unused "using" (NFC)
Kazu Hirata [Sun, 2 Jan 2022 18:20:17 +0000 (10:20 -0800)]
Remove unused "using" (NFC)

Identified by misc-unused-using-decls.

2 years ago[Target] Remove unused forward declarations (NFC)
Kazu Hirata [Sun, 2 Jan 2022 18:20:15 +0000 (10:20 -0800)]
[Target] Remove unused forward declarations (NFC)

2 years ago[SCEV] Drop unused param from new version of computeExitLimitFromICmp [NFC]
Philip Reames [Sun, 2 Jan 2022 18:15:17 +0000 (10:15 -0800)]
[SCEV] Drop unused param from new version of computeExitLimitFromICmp [NFC]

2 years ago[SCEV] Split computeExitLimitFromICmp into two versions [NFC]
Philip Reames [Sun, 2 Jan 2022 17:49:45 +0000 (09:49 -0800)]
[SCEV] Split computeExitLimitFromICmp into two versions [NFC]

This is in advance of a following change which needs to the non-icmp API.

2 years ago[libc++] [test] Remove an erroneously copy-paste in the hypot() tests. NFC.
Arthur O'Dwyer [Sun, 2 Jan 2022 17:49:55 +0000 (12:49 -0500)]
[libc++] [test] Remove an erroneously copy-paste in the hypot() tests. NFC.

Line 1140 is a duplicate of line 1119; it tests the two-argument version
of std::hypot, whereas all the lines in this section are supposed to be
testing the C++17 three-argument version. Remove the erroneous duplicated line.

Split out of D116295.

2 years agoautogen unroll test for ease of futre update
Philip Reames [Sun, 2 Jan 2022 17:25:19 +0000 (09:25 -0800)]
autogen unroll test for ease of futre update

2 years ago[clang] More informative mixed namespace diagnostics
Nathan Sidwell [Sat, 25 Dec 2021 18:29:58 +0000 (13:29 -0500)]
[clang] More informative mixed namespace diagnostics

First, let's check we get a TemplateDecl, before complaining about
where it might have been found.

Second, if it came from an unexpected place, show where that location is.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D116164

2 years ago[VPlan] Don't consider VPWidenCanonicalIVRecipe phi-like.
Florian Hahn [Sun, 2 Jan 2022 12:24:13 +0000 (12:24 +0000)]
[VPlan] Don't consider VPWidenCanonicalIVRecipe phi-like.

VPWidenCanonicalIVRecipe does not create PHI instructions, so it does
not need to be placed in the phi section of a VPBasicBlock.

Also tidies the code so the WidenCanonicalIV recipe and the
compare/lane-masks are created in the header.

Discussed D113223.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D116473

2 years ago[clang][MinGW] Explicitly ignore `-fPIC` & friends
Markus Böck [Sun, 2 Jan 2022 11:06:54 +0000 (12:06 +0100)]
[clang][MinGW] Explicitly ignore `-fPIC` & friends

GCC on Windows ignores this flag completely [0] which some build systems sadly rely on when compiling for Windows using MinGW. The current behaviour of clang however is to error out as -fPIC & friends has no effect on Windows.

This patch instead changes the behaviour for MinGW to ignore the option for the sake of compatibility

Fixes https://github.com/llvm/llvm-project/issues/52947

[0] https://gcc.gnu.org/legacy-ml/gcc-patches/2015-08/msg00836.html

Differential Revision: https://reviews.llvm.org/D116485

2 years ago[lld][MinGW] Ignore `--[no-]as-neeed` flags in MinGW driver
Markus Böck [Sat, 1 Jan 2022 23:59:23 +0000 (00:59 +0100)]
[lld][MinGW] Ignore `--[no-]as-neeed` flags in MinGW driver

These flags are specific to ELF, but are still accepted by GNU ld, even if it does not do anything. This patch adds them as ignored option for the sake of compatibility.

Part of https://github.com/llvm/llvm-project/issues/52947

Differential Revision: https://reviews.llvm.org/D116484

2 years ago[DebugInfo] Remove hasInterestingContent (NFC)
Kazu Hirata [Sun, 2 Jan 2022 06:50:26 +0000 (22:50 -0800)]
[DebugInfo] Remove hasInterestingContent (NFC)

hasInterestingContent was introduced without a use on Sep 15, 2015 in
commit e5162dba49890d9d436ea99d003c792897c9b880.

2 years ago[CodeGen] Remove DisconnectedComponentsRenamed (NFC)
Kazu Hirata [Sun, 2 Jan 2022 06:50:24 +0000 (22:50 -0800)]
[CodeGen] Remove DisconnectedComponentsRenamed (NFC)

The last use was removed on May 31, 2016 in commit
f9acacaa928d7ba9db900c42893c244fb19714c4.

2 years ago[AArch64] Remove unused constant NeonBitsPerVector (NFC)
Kazu Hirata [Sun, 2 Jan 2022 06:05:16 +0000 (22:05 -0800)]
[AArch64] Remove unused constant NeonBitsPerVector (NFC)

2 years ago[ADT] Remove ImmutableSet::foreach and ImmutableMap::foreach (NFC)
Kazu Hirata [Sun, 2 Jan 2022 06:05:14 +0000 (22:05 -0800)]
[ADT] Remove ImmutableSet::foreach and ImmutableMap::foreach (NFC)

These functions seem to be unused for at least 1 year.

2 years ago[RISCV] Prune unnecessary vector pseudo instructions. NFC
Craig Topper [Sun, 2 Jan 2022 03:53:52 +0000 (19:53 -0800)]
[RISCV] Prune unnecessary vector pseudo instructions. NFC

For .vf instructions, we don't need MF8 pseudos for f16. We don't
need MF8 or MF4 pseudos for f32. Or MF8, MF4, MF2 for f64.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D116437

2 years agoApply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:58:56 +0000 (01:58 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116253

2 years agoApply clang-tidy fixes for readability-container-size-empty for MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:55:30 +0000 (01:55 +0000)]
Apply clang-tidy fixes for readability-container-size-empty for MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116252

2 years agoRemove unused applyPad function from TosaToLinalg.cpp (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:53:18 +0000 (01:53 +0000)]
Remove unused applyPad function from TosaToLinalg.cpp (NFC)

2 years agoApply clang-tidy fixes for readability-const-return-type to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:50:43 +0000 (01:50 +0000)]
Apply clang-tidy fixes for readability-const-return-type to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116251

2 years agoApply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:26:44 +0000 (01:26 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D116250

2 years agoApply clang-tidy fixes for modernize-use-using to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:24:54 +0000 (01:24 +0000)]
Apply clang-tidy fixes for modernize-use-using to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116357

2 years agoApply clang-tidy fixes for modernize-use-override to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:22:19 +0000 (01:22 +0000)]
Apply clang-tidy fixes for modernize-use-override to MLIR (NFC)

Reviewed By: rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D116356

2 years agoApply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:21:01 +0000 (01:21 +0000)]
Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116355

2 years agoApply clang-tidy fixes for bugprone-macro-parentheses to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:18:41 +0000 (01:18 +0000)]
Apply clang-tidy fixes for bugprone-macro-parentheses to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116354

2 years agoApply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)
Mehdi Amini [Sun, 2 Jan 2022 01:11:13 +0000 (01:11 +0000)]
Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116249

2 years agoApply clang-tidy fixes for performance-for-range-copy to MLIR (NFC)
Mehdi Amini [Thu, 23 Dec 2021 22:13:06 +0000 (22:13 +0000)]
Apply clang-tidy fixes for performance-for-range-copy to MLIR (NFC)

Differential Revision: https://reviews.llvm.org/D116248

2 years agoApply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)
Mehdi Amini [Thu, 23 Dec 2021 22:13:00 +0000 (22:13 +0000)]
Apply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC)

Differential Revision: https://reviews.llvm.org/D116247

2 years agoApply clang-tidy fixes for bugprone-copy-constructor-init to MLIR (NFC)
Mehdi Amini [Sat, 1 Jan 2022 21:31:24 +0000 (21:31 +0000)]
Apply clang-tidy fixes for bugprone-copy-constructor-init to MLIR (NFC)

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D116245

2 years agoApply clang-tidy fixes for bugprone-argument-comment to MLIR (NFC)
Mehdi Amini [Wed, 29 Dec 2021 05:12:02 +0000 (05:12 +0000)]
Apply clang-tidy fixes for bugprone-argument-comment to MLIR (NFC)

Differential Revision: https://reviews.llvm.org/D116244

2 years agoEnable a few clang-tidy checks in MLIR
Mehdi Amini [Wed, 22 Dec 2021 00:18:47 +0000 (00:18 +0000)]
Enable a few clang-tidy checks in MLIR

The dry-run of clang-tidy on the codebase with these enable were
well receive, and the codebase is "clean" (or almost) with respect
to these right now.

2 years ago[llvm] Remove redundant member initialization (NFC)
Kazu Hirata [Sun, 2 Jan 2022 00:18:18 +0000 (16:18 -0800)]
[llvm] Remove redundant member initialization (NFC)

Identified with readability-redundant-member-init.

2 years agoMove LinalgDetensorize pass option from .cpp file to the .td declaration (NFC)
Mehdi Amini [Sat, 1 Jan 2022 21:19:31 +0000 (21:19 +0000)]
Move LinalgDetensorize pass option from .cpp file to the .td declaration (NFC)

2 years agoUse const reference for diagnostic in callback (NFC)
Mehdi Amini [Sat, 1 Jan 2022 02:16:11 +0000 (02:16 +0000)]
Use const reference for diagnostic in callback (NFC)

This isn't a "small" struct, flagged by Coverity.

2 years ago[lldb] Add NOLINT(modernize-use-nullptr)
Kazu Hirata [Sat, 1 Jan 2022 21:14:59 +0000 (13:14 -0800)]
[lldb] Add NOLINT(modernize-use-nullptr)

thread_result_t is defined as unsigned on Windows.

This patch prevents clang-tidy from replacing 0 with nullptr.

2 years agoRemove redundant string initialization (NFC)
Kazu Hirata [Sat, 1 Jan 2022 20:34:11 +0000 (12:34 -0800)]
Remove redundant string initialization (NFC)

Identified by readability-redundant-string-init.

2 years ago[ARM] Verify addressing immediates
David Green [Sat, 1 Jan 2022 20:08:45 +0000 (20:08 +0000)]
[ARM] Verify addressing immediates

This adds at extra check into ARMBaseInstrInfo::verifyInstruction to
verify the offsets used in addressing mode immediates using
isLegalAddressImm. Some tests needed fixing up as a result, adjusting
the opcode created from CMSE stack adjustments.

Differential Revision: https://reviews.llvm.org/D114939

2 years ago[lldb] Use nullptr instead of 0 or NULL (NFC)
Kazu Hirata [Sat, 1 Jan 2022 19:54:25 +0000 (11:54 -0800)]
[lldb] Use nullptr instead of 0 or NULL (NFC)

This is a re-submission of 24d240558811604354a8d6080405f6bad8d15b5c
without the hunks in HostNativeThreadBase.{h,cpp}, which break builds
on Windows.

Identified with modernize-use-nullptr.

2 years agoRevert "[lldb] Use nullptr instead of 0 or NULL (NFC)"
Kazu Hirata [Sat, 1 Jan 2022 19:15:14 +0000 (11:15 -0800)]
Revert "[lldb] Use nullptr instead of 0 or NULL (NFC)"

This reverts commit 913457acf07be7f22d71ac41ad1076517d7f45c6.

It again broke builds on Windows:

  lldb/source/Host/common/HostNativeThreadBase.cpp(37,14): error:
  assigning to 'lldb::thread_result_t' (aka 'unsigned int') from
  incompatible type 'std::nullptr_t'

2 years ago[lldb] Use nullptr instead of 0 or NULL (NFC)
Kazu Hirata [Sat, 1 Jan 2022 18:48:56 +0000 (10:48 -0800)]
[lldb] Use nullptr instead of 0 or NULL (NFC)

This is a re-submission of 24d240558811604354a8d6080405f6bad8d15b5c
without the hunk in HostNativeThreadBase.h, which breaks builds on
Windows.

Identified with modernize-use-nullptr.

2 years ago[llvm] Use the default constructor for SDValue (NFC)
Kazu Hirata [Sat, 1 Jan 2022 18:36:59 +0000 (10:36 -0800)]
[llvm] Use the default constructor for SDValue (NFC)

2 years agoRevert "[lldb] Use nullptr instead of 0 or NULL (NFC)"
Nico Weber [Sat, 1 Jan 2022 18:35:54 +0000 (13:35 -0500)]
Revert "[lldb] Use nullptr instead of 0 or NULL (NFC)"

This reverts commit 24d240558811604354a8d6080405f6bad8d15b5c.
Breaks building on Windows:

    ../../lldb/include\lldb/Host/HostNativeThreadBase.h(49,36): error:
        cannot initialize a member subobject of type 'lldb::thread_result_t'
        (aka 'unsigned int') with an rvalue of type 'std::nullptr_t'
      lldb::thread_result_t m_result = nullptr;
                                       ^~~~~~~
    1 error generated.

2 years ago[Target] Use range-based for loops (NFC)
Kazu Hirata [Sat, 1 Jan 2022 18:14:05 +0000 (10:14 -0800)]
[Target] Use range-based for loops (NFC)

2 years ago[docs] Mark @llvm.sideeffect() as willreturn
Nuno Lopes [Sat, 1 Jan 2022 18:00:52 +0000 (18:00 +0000)]
[docs] Mark @llvm.sideeffect() as willreturn
Changed by https://reviews.llvm.org/D65455

2 years agoSet the path to the shared cmake modules based on the llvm directory
John Ericson [Sat, 1 Jan 2022 17:51:16 +0000 (17:51 +0000)]
Set the path to the shared cmake modules based on the llvm directory

It’s still possible to build parts of the main llvm build (lld, clang etc) by symlinking them into llvm/tools.

Reviewed By: Ericson2314

Differential Revision: https://reviews.llvm.org/D116472

2 years ago[Aarch64] Remove redundant declaration initializeSVEIntrinsicOptsPass (NFC)
Kazu Hirata [Sat, 1 Jan 2022 17:14:25 +0000 (09:14 -0800)]
[Aarch64] Remove redundant declaration initializeSVEIntrinsicOptsPass (NFC)

The function is declared in AArch64.h.

Identified with readability-redundant-declaration.

2 years ago[CodeGen] Remove redundant string initialization (NFC)
Kazu Hirata [Sat, 1 Jan 2022 17:14:23 +0000 (09:14 -0800)]
[CodeGen] Remove redundant string initialization (NFC)

Identified with readability-redundant-string-init.

2 years ago[IR] Remove redundant return statements (NFC)
Kazu Hirata [Sat, 1 Jan 2022 17:14:21 +0000 (09:14 -0800)]
[IR] Remove redundant return statements (NFC)

Identified by readability-redundant-control-flow.

2 years ago[mlir] Remove unused "using" (NFC)
Kazu Hirata [Sat, 1 Jan 2022 17:14:19 +0000 (09:14 -0800)]
[mlir] Remove unused "using" (NFC)

Identified by misc-unused-using-decls.

2 years ago[lldb] Use nullptr instead of 0 or NULL (NFC)
Kazu Hirata [Sat, 1 Jan 2022 16:54:05 +0000 (08:54 -0800)]
[lldb] Use nullptr instead of 0 or NULL (NFC)

Identified with modernize-use-nullptr.

2 years ago[Transforms] Remove unused forward declarations (NFC)
Kazu Hirata [Sat, 1 Jan 2022 16:45:35 +0000 (08:45 -0800)]
[Transforms] Remove unused forward declarations (NFC)

2 years ago[VPlan] Remove VPWidenPHIRecipe constructor without start value (NFC).
Florian Hahn [Tue, 28 Dec 2021 17:31:41 +0000 (18:31 +0100)]
[VPlan] Remove VPWidenPHIRecipe constructor without start value (NFC).

This was suggested as a separate cleanup in recent reviews.

2 years ago[mlir][NFC] Fully qualify use of SmallVector in generated C++ code of mlir-tblgen
Markus Böck [Sat, 1 Jan 2022 13:52:32 +0000 (14:52 +0100)]
[mlir][NFC] Fully qualify use of SmallVector in generated C++ code of mlir-tblgen

2 years ago[gn build] Port 2edcde00cb39
LLVM GN Syncbot [Sat, 1 Jan 2022 02:17:49 +0000 (02:17 +0000)]
[gn build] Port 2edcde00cb39

2 years agoPass the LLVMTypeConverter by reference in UnrankedMemRefBuilder (NFC)
Mehdi Amini [Sat, 1 Jan 2022 02:01:41 +0000 (02:01 +0000)]
Pass the LLVMTypeConverter by reference in UnrankedMemRefBuilder (NFC)

This is a fairly large structure (952B according to Coverity), it was
already passed by reference in most places but not consistently.

2 years agoPass the LLVMTypeConverter by reference in MemRefBuilder (NFC)
Mehdi Amini [Sat, 1 Jan 2022 01:56:50 +0000 (01:56 +0000)]
Pass the LLVMTypeConverter by reference in MemRefBuilder (NFC)

This is a fairly large structure (952B according to Coverity), it was
already passed by reference in most places but not consistently.

2 years agoFix possible memory leak in a MLIR unit-test
Mehdi Amini [Sat, 1 Jan 2022 01:42:26 +0000 (01:42 +0000)]
Fix possible memory leak in a MLIR unit-test

Flagged by Coverity