Commit Graph

415722 Commits

Author SHA1 Message Date
Prateek Gupta 1a2bb03eda [MLIR][LINALG] Add canonicalization pattern in `linalg.generic` op for static shape inference.
This commit adds canonicalization pattern in `linalg.generic` op
for static shape inference. If any of the inputs or outputs have
static shape or is casted from a tensor of static shape, then
shapes of all the inputs and outputs can be inferred by using the
affine map of the static shape input/output.

Signed-Off-By: Prateek Gupta <prateek@nod-labs.com>

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D118929
2022-02-21 07:51:13 +00:00
Shraiysh Vaishay c1e4e01945 [mlir][OpenMP] Added assemblyFormat for SectionsOp
This patch adds assemblyFormat for omp.sections operation.

Some existing functions have been altered to fit the custom directive
in assemblyFormat. This has led to their callsites to get modified too,
but those will be removed in later patches, when other operations get
their assemblyFormat. All operations were not changed in one patch for
ease of review.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D120176
2022-02-21 13:01:49 +05:30
Kito Cheng c1f17b0a9e [RISCV] Fix the include search path order between sysroot and resource folder (Recommit again)
Resource folder[1] should include before sysroot[2] in general (Linux clang
toolchain, BareMetal clang toolchain, and GCC using that order), and that
prevent sysroot's header file override resource folder's one, this change is
reference from BareMetal::AddClangSystemIncludeArgs@BareMetal.cpp[3].

And also fix the behavior of `-nobuiltininc`.

[1] Include path from resource folder is something like this: `<toolchain-path>/lib/clang/13.0.0/include/`
[2] Include path from sysroot is something like this: `<toolchain-path>/riscv32-unknown-elf/include`
[3] https://github.com/llvm/llvm-project/blob/llvmorg-13.0.1/clang/lib/Driver/ToolChains/BareMetal.cpp#L193

Reviewed By: asb

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

The recommit fixes the Windows build failure due to path issue.
2022-02-21 15:25:21 +08:00
Kito Cheng cc279529e8 Revert "[RISCV] Fix the include search path order between sysroot and resource folder (Recommit)"
This reverts commit 47b1fa5fc4.
2022-02-21 14:56:58 +08:00
Craig Topper a6fb1bb306 [ARM] Remove unused lowerABS function. NFC
This function was added in D49837, but no setOperationAction call
was added with it. The code is equivalent to what is done by the
default ExpandIntRes_ABS implementation when ADDCARRY is supported.
Test case added to verify this. There was some existing coverage
from Thumb2 MVE tests, but they started from vectors.
2022-02-20 22:43:23 -08:00
Kito Cheng 47b1fa5fc4 [RISCV] Fix the include search path order between sysroot and resource folder (Recommit)
Resource folder[1] should include before sysroot[2] in general (Linux clang
toolchain, BareMetal clang toolchain, and GCC using that order), and that
prevent sysroot's header file override resource folder's one, this change is
reference from BareMetal::AddClangSystemIncludeArgs@BareMetal.cpp[3].

And also fix the behavior of `-nobuiltininc`.

[1] Include path from resource folder is something like this: `<toolchain-path>/lib/clang/13.0.0/include/`
[2] Include path from sysroot is something like this: `<toolchain-path>/riscv32-unknown-elf/include`
[3] https://github.com/llvm/llvm-project/blob/llvmorg-13.0.1/clang/lib/Driver/ToolChains/BareMetal.cpp#L193

Reviewed By: asb

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

The recommit fixes the Windows build failure due to path issue.
2022-02-21 14:39:43 +08:00
Kito Cheng 0a17ee1ebe Revert "[RISCV] Fix the include search path order between sysroot and resource folder"
This reverts commit 079d13668b.
2022-02-21 14:25:49 +08:00
Kito Cheng 079d13668b [RISCV] Fix the include search path order between sysroot and resource folder
Resource folder[1] should include before sysroot[2] in general (Linux clang
toolchain, BareMetal clang toolchain, and GCC using that order), and that
prevent sysroot's header file override resource folder's one, this change is
reference from BareMetal::AddClangSystemIncludeArgs@BareMetal.cpp[3].

And also fix the behavior of `-nobuiltininc`.

[1] Include path from resource folder is something like this: `<toolchain-path>/lib/clang/13.0.0/include/`
[2] Include path from sysroot is something like this: `<toolchain-path>/riscv32-unknown-elf/include`
[3] https://github.com/llvm/llvm-project/blob/llvmorg-13.0.1/clang/lib/Driver/ToolChains/BareMetal.cpp#L193

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D119837
2022-02-21 14:06:47 +08:00
Craig Topper 440c4b705a [SelectionDAG][RISCV][ARM][PowerPC][X86][WebAssembly] Change default abs expansion to use sra (X, size(X)-1); sub (xor (X, Y), Y).
Previous we used sra (X, size(X)-1); xor (add (X, Y), Y).

By placing sub at the end, we allow RISCV to combine sign_extend_inreg
with it to form subw.

Some X86 tests for Z - abs(X) seem to have improved as well.

Other targets look to be a wash.

I had to modify ARM's abs matching code to match from sub instead of
xor. Maybe instead ISD::ABS should be made legal. I'll try that in
parallel to this patch.

This is an alternative to D119099 which was focused on RISCV only.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D119171
2022-02-20 21:11:23 -08:00
Serguei Katkov 7f2293ba25 [STATEPOINT] Mark LR is early-clobber implicit def.
LR is modified at the moment of the call and before any use is read.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D120114
2022-02-21 10:37:43 +07:00
esmeyi 7b67d2e398 Reland [XCOFF][llvm-objdump] change the priority of symbols with the same address by symbol types.
Fix the Buildbot failure #19373.

Differential Revision: https://reviews.llvm.org/D117642
2022-02-20 21:51:10 -05:00
Chen Zheng efe5b8ad90 [ISEL] remove unnecessary getNode(); NFC
Reviewed By: RKSimon, craig.topper

Differential Revision: https://reviews.llvm.org/D120049
2022-02-20 21:08:49 -05:00
Lian Wang 4abe484525 [RISCV][NFC] Add sched for some instructions in Zb extension
Add sched to brev8, zip and unzip instruction.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D120009
2022-02-21 09:58:08 +08:00
Luo, Yuanke 67ef63138b [SDAG] enable binop identity constant folds for sub
This patch extract the sub folding from D119654 and leave only add
folding in that patch.

Differential Revision: https://reviews.llvm.org/D120116
2022-02-21 09:37:36 +08:00
Amir Ayupov d44f99c748 [BOLT] Added fuzzer target (llvm-bolt-fuzzer)
This adds a target that would consume random binary as an
input ELF file.
TBD: add structured input support (ELF).

Build:
```
cmake /path/to/llvm-project/llvm -GNinja \
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=1 \
-DCMAKE_C_COMPILER=<sanitizer-capable clang> \
-DCMAKE_CXX_COMPILER=<sanitizer-capable clang++> \
-DLLVM_ENABLE_PROJECTS="bolt"  \
-DLLVM_USE_SANITIZER=Address \
-DLLVM_USE_SANITIZE_COVERAGE=On
ninja llvm-bolt-fuzzer
```

Test Plan: ninja llvm-bolt-fuzzer

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D120016
2022-02-20 17:24:16 -08:00
Amir Ayupov 36ada32727 [BOLT][NFC] Fix data race in ShrinkWrapping stats
Fix data race reported by ThreadSanitizer in clang.test:
```
ThreadSanitizer: data race /data/llvm-project/bolt/lib/Passes/ShrinkWrapping.cpp:1359:28
in llvm::bolt::ShrinkWrapping::moveSaveRestores()
```

The issue is with incrementing global counters from multiple threads.

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D120218
2022-02-20 17:21:58 -08:00
Krystian Kuzniarek aacc110bdc [clang-format][NFC] Fix typos and inconsistencies
Differential Revision: https://reviews.llvm.org/D120220
2022-02-20 17:20:34 -08:00
David Blaikie 323c672789 DebugInfo: Add an assert about cross-unit references in dwo units
This is helping me debug some issues with simplified template names
2022-02-20 14:53:17 -08:00
Kesavan Yogeswaran c57b8ca721
[clang-tidy] Provide fine control of color in run-clang-tidy
D90110 modified the behavior of `run-clang-tidy` to always pass the
`--use-color` option to clang-tidy, which enabled colored diagnostics
output regardless of TTY status or .clang-tidy settings. This left the
user with no option to disable the colored output.

This presents an issue when trying to parse the output of run-clang-tidy
programmaticall, as the output is polluted with ANSI escape characters.

This PR fixes this issue in two ways:
1. It restores the default behavior of `run-clang-tidy` to let
   `clang-tidy` decide whether to color output. This allows the user to
   configure color via the `UseColor` option in a .clang-tidy file.
2. It adds mutually exclusive, optional `-use-color` and `-no-use-color`
   argument flags that let the user explicitly set the color option via
   the invocation.

After this change the default behavior of `run-clang-tidy` when no
.clang-tidy file is available is now to show no color, presumably
because `clang-tidy` detects that the output is being piped and defaults
to not showing colored output. This seems like an acceptable tradeoff
to respect .clang-tidy configurations, as users can still use the
`-use-color` option to explicitly enable color.

Fixes #49441 (50097 in Bugzilla)

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D119562
2022-02-20 22:00:28 +00:00
Krystian Kuzniarek 8f310d1967 [clang-format][docs] Fix incorrect 'clang-format 13' configuration ...
...options markers

Note: Option 'IndentRequiresClause' was previously known as
'IndentRequires' but the version marker should still indicate
'clang-format 15' as this option most recent name wasn't accessible
earlier and it would produce:
error: unknown key 'IndentRequiresClause'

Differential Revision: https://reviews.llvm.org/D119682
2022-02-20 22:33:27 +01:00
Björn Schäpers 9b139923bc [clang-format][NFC] Return early in ContinuationIndenter::mustBreak
We can return as early as possible and only calculate IsComparison if we
really need to. Also cache getPrecedence() instead of querying it at
most 4 times.

Differential Revision: https://reviews.llvm.org/D119923
2022-02-20 22:33:27 +01:00
Björn Schäpers be9a7fdd6a [clang-format] Fixed handling of requires clauses followed by attributes
Fixes https://github.com/llvm/llvm-project/issues/53820.

Differential Revision: https://reviews.llvm.org/D119893
2022-02-20 22:33:26 +01:00
Marek Kurdej 4701bcae97 Revert "[clang-format] Avoid inserting space after C++ casts."
This reverts commit e021987273.

This commit provokes failures in formatting tests of polly.
Cf. https://lab.llvm.org/buildbot/#/builders/205/builds/3320.

That's probably because of `)` being annotated as `CastRParen` instead of `Unknown` before, hence being kept on the same line with the next token.
2022-02-20 22:19:51 +01:00
Marek Kurdej e021987273 [clang-format] Avoid inserting space after C++ casts.
Fixes https://github.com/llvm/llvm-project/issues/53876.

This is a solution for standard C++ casts: const_cast, dynamic_cast, reinterpret_cast, static_cast.

A general approach handling all possible casts is not possible without semantic information.
Consider the code:
```
static_cast<T>(*function_pointer_variable)(arguments);
```
vs.
```
some_return_type<T> (*function_pointer_variable)(parameters);
// Later used as:
function_pointer_variable = &some_function;
return function_pointer_variable(args);
```
In the latter case, it's not a cast but a variable declaration of a pointer to function.
Without knowing what `some_return_type<T>` is (and clang-format does not know it), it's hard to distinguish between the two cases. Theoretically, one could check whether "parameters" are types (not a cast) and "arguments" are value/expressions (a cast), but that might be inefficient (needs lots of lookahead).

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D120140
2022-02-20 21:58:37 +01:00
Luis Penagos d9567babef Fix extraneous whitespace addition in line comments on clang-format directives
Fixes https://github.com/llvm/llvm-project/issues/53844.
I believe this regression was caused by not accounting for clang-format directives in https://reviews.llvm.org/D92257.

Reviewed By: HazardyKnusperkeks, curdeius

Differential Revision: https://reviews.llvm.org/D120188
2022-02-20 21:53:50 +01:00
Simon Pilgrim d0505201c4 [X86] Regenerate switch-default-only.ll 2022-02-20 20:42:36 +00:00
Yannic Bonenberger 6694491aff [llvm] Add missind dep on Symbolize to Debuginfod
`llvm/Debuginfod/DIFetcher.h` imports `llvm/DebugInfo/Symbolize/DIFetcher.h`,
so there should be a dependency on Symbolize.

Reviewed By: #debug-info, dblaikie, phosek

Differential Revision: https://reviews.llvm.org/D119626
2022-02-20 12:35:22 -08:00
Sanjay Patel 7f827ebddc [AArch64][RISCV][x86] add tests for mul-add demanded bits; NFC
See #53829
2022-02-20 15:06:55 -05:00
Alex Bradbury 8d894270a6 [docs] Update ReleaseNotes template
This change makes several updates to the ReleaseNotes template:

* Orders the backend/target updates alphabetically
* Adds RISC-V to the list
* Uses "Backend" rather than a mix of "Target" and "Backend" (I don't
  have a strong view on which term is used, but we should be
  consistent!)
* Uses * ... as the placeholder text, as this matches the format
  actually used for most updates in recent releases

Differential Revision: https://reviews.llvm.org/D120043
2022-02-20 19:42:07 +00:00
Casey Carter eb5950666b [libcxx][test] Update msvc_stdlib_force_include.h for C++23
Make distinct `TEST_STD_VER` values for C++20 and C++23; add C++23 deprecation suppression.

Fixes #53597
2022-02-20 11:35:33 -08:00
Arthur Eubanks 053c2a0020 [SimplifyCFG][OpaquePtr] Check store type when merging conditional store 2022-02-20 11:29:54 -08:00
Simon Pilgrim ec910751fe [X86] combineX86ShufflesRecursively - attempt to fold ISD::EXTRACT_SUBVECTOR into a shuffle chain
Peek through if we're extracting a non-zero'th subvector in an attempt to fold the extract into a lane-crossing shuffle

This also exposes a failure to fold extract_subvector(movddup(x),c) -> movddup(extract_subvector(x,c))
2022-02-20 18:50:33 +00:00
Nuno Lopes 35b92c1464 [docs] fix typo 2022-02-20 18:43:30 +00:00
Michel Weber 56bc87322c [MLIR][Presburger] Inequality Typing in coalesce
This patch adds typing of inequalities to the simplex. This is a cental part of the coalesce algorithm and will be heavily used in later coalesce patches. Currently, only the three most basic types are supported with more to be introduced when they are needed.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D119925
2022-02-20 23:19:14 +05:30
Qiu Chaofan 43d48ed220 [PowerPC] Add option to disable perfect shuffle
Perfect shuffle was introduced into PowerPC backend years ago, and only
available in big-endian subtargets. This optimization has good effects
in simple cases, but brings serious negative impact in large programs
with many shuffle instructions sharing the same mask.

Here introduces a temporary backend hidden option to control it until we
implemented better way to fix the gap in vectorshuffle decomposition.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D120072
2022-02-21 01:39:35 +08:00
Simon Pilgrim 8ef3e895ad [X86] combineX86ShufflesRecursively - add TODO not to generate temporary nodes
Extension to PR45974, unless we actual combine the target shuffles we shouldn't be generating temporary nodes as they may interfere with the one use checks in the shuffle recursions
2022-02-20 15:59:23 +00:00
Florian Hahn 5c7ae10cec
[LV] Add store to test to make sure the loop is not dead.
Add an extra store to the test, to make sure the operations in the loop
cannot be optimized away after D118051.
2022-02-20 15:05:29 +00:00
Benjamin Kramer ce0fdf1163 Put back err_drv_negative_columns/err_drv_small_columns for flang
These are unused by Clang, but Flang references them.
2022-02-20 15:42:20 +01:00
Benjamin Kramer 3a1d6a361c [clangd] Remove uuidof warning. Clang never emits this one. 2022-02-20 14:44:47 +01:00
David Green 147b97de90 [AArch64] Extra tests for larger umull/smull generation. NFC 2022-02-20 13:20:34 +00:00
Benjamin Kramer 52fcdc8d69 Prune unused diagnostics. NFC. 2022-02-20 14:06:58 +01:00
Nuno Lopes 8608650a76 [docs] Frotend perf tips: mention poison vs undef and noundef attribute 2022-02-20 11:59:04 +00:00
Valery Pykhtin 29d2ae59e4 [ArgPromotion] Regenerate test checks for dead-gep-no-promotion.ll
with --function-signature option (otherwise filecheck gets confused).
2022-02-20 15:00:18 +03:00
Nuno Lopes da23fc966b [docs] Simplify the description of poison values 2022-02-20 11:41:49 +00:00
Nuno Lopes 5c404049b5 [docs] Add a note saying that the use of poison is preferred to the use of undef
Plus fix a few wrong examples with undef
2022-02-20 11:33:47 +00:00
Benjamin Kramer 51c0650f6b Unionize clang::DynTypedNodeList. NFC. 2022-02-20 12:12:39 +01:00
Iain Sandoe 673879249d Revert "[C++20][Modules][1/8] Track valid import state."
This reverts commit 8a3f9a584a.

need to investigate build failures that do not show on CI or local
testing.
2022-02-20 10:22:07 +00:00
Valery Pykhtin a2ce8df49b [ArgPromotion] auto-update test checks.
Rename %tmp => %temp IR values to avoid update warning.
2022-02-20 13:23:12 +03:00
Iain Sandoe 8a3f9a584a [C++20][Modules][1/8] Track valid import state.
In C++20 modules imports must be together and at the start of the module.
Rather than growing more ad-hoc flags to test state, this keeps track of the
phase of of a valid module TU (first decl, global module frag, module,
private module frag).  If the phasing is broken (with some diagnostic) the
pattern does not conform to a valid C++20 module, and we set the state
accordingly.

We can thus issue diagnostics when imports appear in the wrong places and
decouple the C++20 modules state from other module variants (modules-ts and
clang modules).  Additionally, we attempt to diagnose wrong imports before
trying to find the module where possible (the latter will generally emit an
unhelpful diagnostic about the module not being available).

Although this generally simplifies the handling of C++20 module import
diagnostics, the motivation was that, in particular, it allows detecting
invalid imports like:

import module A;

int some_decl();

import module B;

where being in a module purview is insufficient to identify them.

Differential Revision: https://reviews.llvm.org/D118893
2022-02-20 10:13:57 +00:00
Amara Emerson 2a46450849 [AArch64][GlobalISel] Optimize conjunctions of compares to conditional compares.
This is a partial port of the same optimization from AArch64ISelLowering,
although the original handles more cases when generating regular compares
instead of this one which just does it when selecting G_SELECTs.

For more detailed comments see the original comments for
emitConditionalComparison() in AArch64ISelLowering.

Gives minor code size improvements.

Differential Revision: https://reviews.llvm.org/D117166
2022-02-20 01:13:34 -08:00