platform/upstream/llvm.git
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

2 years agoFix a few unitialized class members in MLIR (NFC)
Mehdi Amini [Sat, 1 Jan 2022 01:39:04 +0000 (01:39 +0000)]
Fix a few unitialized class members in MLIR (NFC)

Flagged by Coverity.

2 years ago[SelectionDAG] Use KnownBits::countMinSignBits() to simplify the end of ComputeNumSig...
Craig Topper [Sat, 1 Jan 2022 01:29:57 +0000 (17:29 -0800)]
[SelectionDAG] Use KnownBits::countMinSignBits() to simplify the end of ComputeNumSignBits.

This matches what is done in ValueTracking.cpp

Reviewed By: RKSimon, foad

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

2 years ago[RISCV][LegalizeIntegerTypes] Teach PromoteSetCCOperands not to sext i32 comparisons...
Craig Topper [Sat, 1 Jan 2022 01:13:36 +0000 (17:13 -0800)]
[RISCV][LegalizeIntegerTypes] Teach PromoteSetCCOperands not to sext i32 comparisons for RV64 if the promoted values are already zero extended.

This is similar to what is done for targets that prefer zero extend
where we avoid using a zero extend if the promoted values are sign
extended.

We'll also check for zero extended operands for ugt, ult, uge, and ule when the
target prefers sign extend. This is different than preferring zero extend, where
we only check for sign bits on equality comparisons.

Reviewed By: RKSimon

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

2 years agoRemove redundant return after return in CodegenStrategy (NFC)
Mehdi Amini [Sat, 1 Jan 2022 01:14:27 +0000 (01:14 +0000)]
Remove redundant return after return in CodegenStrategy (NFC)

Reported by Coverity

2 years ago[mlir][LLVMIR] Add `llvm.eh.typeid.for` intrinsic
Markus Böck [Sat, 1 Jan 2022 01:03:00 +0000 (02:03 +0100)]
[mlir][LLVMIR] Add `llvm.eh.typeid.for` intrinsic

MLIR already exposes landingpads, the invokeop and the personality function on LLVM functions. With this intrinsic it should be possible to implement exception handling via the exception handling mechanisms provided by the Itanium ABI.

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

2 years ago[AMDGPU] Remove unused declarations fold_exp* and fold_log* (NFC)
Kazu Hirata [Sat, 1 Jan 2022 00:50:18 +0000 (16:50 -0800)]
[AMDGPU] Remove unused declarations fold_exp* and fold_log* (NFC)

2 years ago[AMDGPU] Remove replaceWithNative (NFC)
Kazu Hirata [Sat, 1 Jan 2022 00:43:06 +0000 (16:43 -0800)]
[AMDGPU] Remove replaceWithNative (NFC)

The function was introduced without any use on Aug 11, 2017 in commit
7f37794ebd2c6c36224597800e4d1e5a99ad80e9.

2 years ago[X86] Remove unused declaration getTileStoreShape (NFC)
Kazu Hirata [Sat, 1 Jan 2022 00:06:19 +0000 (16:06 -0800)]
[X86] Remove unused declaration getTileStoreShape (NFC)

2 years ago[Hexagon] Use range-based for loops (NFC)
Kazu Hirata [Fri, 31 Dec 2021 23:17:25 +0000 (15:17 -0800)]
[Hexagon] Use range-based for loops (NFC)

2 years agofix test so it doesn't use nonnull assumes on non-pointers
Nuno Lopes [Fri, 31 Dec 2021 23:04:46 +0000 (23:04 +0000)]
fix test so it doesn't use nonnull assumes on non-pointers
The IR verifier should probably catch this. Alive2 did, though.

2 years ago[CodeGen] Remove unused forward declarations (NFC)
Kazu Hirata [Fri, 31 Dec 2021 22:10:30 +0000 (14:10 -0800)]
[CodeGen] Remove unused forward declarations (NFC)

2 years ago[Scalar] Remove a redundant declaration (NFC)
Kazu Hirata [Fri, 31 Dec 2021 22:02:29 +0000 (14:02 -0800)]
[Scalar] Remove a redundant declaration (NFC)

InitializePasses.h contains the proper declaration.

Identified with readability-redundant-declaration.

2 years ago[clang-tidy] Use nullptr instead of 0 or NULL (NFC)
Kazu Hirata [Fri, 31 Dec 2021 21:54:34 +0000 (13:54 -0800)]
[clang-tidy] Use nullptr instead of 0 or NULL (NFC)

Identified with modernize-use-nullptr.

2 years ago[InstSimplify] fold or-nand-xor
Sanjay Patel [Fri, 31 Dec 2021 20:10:19 +0000 (15:10 -0500)]
[InstSimplify] fold or-nand-xor

~(A & B) | (A ^ B) --> ~(A & B)

https://alive2.llvm.org/ce/z/hXQucg

2 years ago[InstSimplify] add tests for or-nand-xor; NFC
Sanjay Patel [Fri, 31 Dec 2021 20:06:23 +0000 (15:06 -0500)]
[InstSimplify] add tests for or-nand-xor; NFC

2 years ago[flang] Use `GNUInstallDirs` to support custom installation dirs.
John Ericson [Sun, 4 Apr 2021 17:02:18 +0000 (13:02 -0400)]
[flang] Use `GNUInstallDirs` to support custom installation dirs.

Extracted from D99484. My new plan is to start from the outside and work
inward.

Reviewed By: stephenneuendorffer

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

2 years ago[lld][CMake] Use `GNUInstallDirs` to support custom installation dirs
John Ericson [Thu, 30 Dec 2021 06:22:48 +0000 (06:22 +0000)]
[lld][CMake] Use `GNUInstallDirs` to support custom installation dirs

Extracted from D99484. My new plan is to start from the outside and work
inward.

Reviewed By: stephenneuendorffer

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

2 years ago[clang-tools-extra] Remove unused using (NFC)
Kazu Hirata [Fri, 31 Dec 2021 18:51:10 +0000 (10:51 -0800)]
[clang-tools-extra] Remove unused using (NFC)

Identified by misc-unused-using-decls.

2 years ago[Analysis] Remove unused forward declarations (NFC)
Kazu Hirata [Fri, 31 Dec 2021 18:25:16 +0000 (10:25 -0800)]
[Analysis] Remove unused forward declarations (NFC)

2 years ago[ARM] Introduce an empty "armv8.8-a" architecture.
Simon Tatham [Thu, 11 Feb 2021 11:11:55 +0000 (11:11 +0000)]
[ARM] Introduce an empty "armv8.8-a" architecture.

This is the first commit in a series that implements support for
"armv8.8-a" architecture. This should contain all the necessary
boilerplate to make the 8.8-A architecture exist from LLVM and Clang's
point of view: it adds the new arch as a subtarget feature, a definition
in TargetParser, a name on the command line, an appropriate set of
predefined macros, and adds appropriate tests. The new architecture name
is supported in both AArch32 and AArch64.

However, in this commit, no actual _functionality_ is added as part of
the new architecture. If you specify -march=armv8.8a, the compiler
will accept it and set the right predefines, but generate no code any
differently.

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

2 years ago[NFC][SVE] Minor reorder of some AArch64ISD nodes and ISel patterns.
Paul Walker [Fri, 24 Dec 2021 18:10:58 +0000 (18:10 +0000)]
[NFC][SVE] Minor reorder of some AArch64ISD nodes and ISel patterns.

2 years ago[LV] Turn check for unexpected VF into assertion (NFC).
Florian Hahn [Fri, 31 Dec 2021 13:19:03 +0000 (13:19 +0000)]
[LV] Turn check for unexpected VF into assertion (NFC).

VF should always be non-zero in widenIntOrFpInduction. Turn check into
assertion.

2 years ago[MIPS] Add -mfix4300 flag to enable vr4300 mulmul bugfix pass
Random [Mon, 27 Dec 2021 13:12:26 +0000 (16:12 +0300)]
[MIPS] Add -mfix4300 flag to enable vr4300 mulmul bugfix pass

Early revisions of the VR4300 have a hardware bug where two consecutive
multiplications can produce an incorrect result in the second multiply.
This revision adds the `-mfix4300` flag to llvm (and clang) which, when
passed, provides a software fix for this issue.

More precise description of the "mulmul" bug:
```
mul.[s,d] fd,fs,ft
mul.[s,d] fd,fs,ft  or  [D]MULT[U] rs,rt
```

When the above sequence is executed by the CPU, if at least one of the
source operands of the first mul instruction happens to be `sNaN`, `0`
or `Infinity`, then the second mul instruction may produce an incorrect
result. This can happen both if the two mul instructions are next to each
other and if the first one is in a delay slot and the second is the first
instruction of the branch target.

Description of the fix:
This fix adds a backend pass to llvm which scans for mul instructions in
each basic block and inserts a nop whenever the following conditions are
met:

 - The current instruction is a single or double-precision floating-point
   mul instruction.
 - The next instruction is either a mul instruction (any kind) or a branch
   instruction.

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

2 years ago[AMDGPU] Regenerate checks for waitcnt-overflow.mir
Jay Foad [Fri, 31 Dec 2021 11:27:15 +0000 (11:27 +0000)]
[AMDGPU] Regenerate checks for waitcnt-overflow.mir

2 years ago[lldb/qemu] Support setting arg0 of the debugged program
Pavel Labath [Thu, 30 Dec 2021 14:29:00 +0000 (15:29 +0100)]
[lldb/qemu] Support setting arg0 of the debugged program

Just what it says on the box.

2 years ago[RISCV] Use MxListW instead of MxList[0-5]. NFC
Craig Topper [Fri, 31 Dec 2021 08:22:52 +0000 (00:22 -0800)]
[RISCV] Use MxListW instead of MxList[0-5]. NFC

Better to use the named list instead of assuming the size of MxList.