Commit Graph

379513 Commits

Author SHA1 Message Date
Alex Zinenko
2996a8d675 [mlir] avoid exposing mutable DialectRegistry from MLIRContext
MLIRContext allows its users to access directly to the DialectRegistry it
contains. While sometimes useful for registering additional dialects on an
already existing context, this breaks the encapsulation by essentially giving
raw accesses to a part of the context's internal state. Remove this mutable
access and instead provide a method to append a given DialectRegistry to the
one already contained in the context. Also provide a shortcut mechanism to
construct a context from an already existing registry, which seems to be a
common use case in the wild. Keep read-only access to the registry contained in
the context in case it needs to be copied or used for constructing another
context.

With this change, DialectRegistry is no longer concerned with loading the
dialects and deciding whether to invoke delayed interface registration. Loading
is concentrated in the MLIRContext, and the functionality of the registry
better reflects its name.

Depends On D96137

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96331
2021-02-10 12:07:34 +01:00
Alex Zinenko
3da51522fb [mlir] enable delayed registration of dialect interfaces
This introduces a mechanism to register interfaces for a dialect without making
the dialect itself depend on the interface. The registration request happens on
DialectRegistry and, if the dialect has not been loaded yet, the actual
registration is delayed until the dialect is loaded. It requires
DialectRegistry to become aware of the context that contains it and the context
to expose methods for querying if a dialect is loaded.

This mechanism will enable a simple extension mechanism for dialects that can
have interfaces defined outside of the dialect code. It is particularly helpful
for, e.g., translation to LLVM IR where we don't want the dialect itself to
depend on LLVM IR libraries.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96137
2021-02-10 12:07:32 +01:00
Fraser Cormack
a3c74d6d53 [RISCV] Add support for selecting vid.v from build_vector
This patch optimizes a build_vector "index sequence" and lowers it to
the existing custom RISCVISD::VID node. This pattern is common in
autovectorized code.

The custom node was updated to allow it to be used by both scalable and
fixed-length vectors, thus avoiding pattern duplication.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D96332
2021-02-10 10:58:40 +00:00
Jeremy Morse
013613964f Reapply [DebugInfo] Re-engineer a test to be stricter, add XFails
Was e05c10380c, reverted in d7d0b17de7, see D95617 for details. I've
added "arm64" to the XFail list (as well as aarch64), will follow up on
the mailing list about whether there's anything else to be done.
2021-02-10 10:46:58 +00:00
Jan Svoboda
b89af18d9e [clang][cli] Generate and round-trip Target options
This patch implements generation of remaining target options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96158
2021-02-10 11:45:32 +01:00
Jan Svoboda
cb933632bc [clang][cli] Generate and round-trip PreprocessorOutput options
This patch implements generation of remaining preprocessor output options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96156
2021-02-10 11:27:55 +01:00
Simon Pilgrim
eb31c3c5cb Revert rGe1172959226689a "[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - merge VPERMILPD ops with different low/high masks."
Revert this while I investigate a downstream breakage report.
2021-02-10 10:26:44 +00:00
Faris Rehman
6d48a1a53f [flang][driver] Add support for -fopenmp and -fopenacc
Add support for the following options:
* -fopenmp
* -fopenacc

Update OpenMP and OpenACC semantics tests to use the new driver if it is built, otherwise use f18.
OpenMP tests that include `use omp_lib` or run `test_symbols.sh` have not been updated as they require options `-intrinsic-module-directory` and `-funparse-with-symbols` which are currently not implemented in the new driver.
Similarly OpenACC tests that run `test_symbols.sh` have not been updated.

This patch also moves semanticsContext to CompilerInvocation and creates it in CompilerInvocation#setSemanticsOpts so that the semantics context can use Fortran::parser::Options#features.

Summary of changes:
- Move semanticsContext to CompilerInvocation.h
- Update OpenMP and OpenACC semantics tests that do not rely on `-intrinsic-module-directory` and `-funparse-with-symbols` to use %flang

Differential Revision: https://reviews.llvm.org/D96032
2021-02-10 09:59:35 +00:00
Sven van Haastregt
a7d01772ac [OpenCL] Add cl_khr_subgroup_clustered_reduce to TableGen BIFs
Add the builtin functions brought by the
cl_khr_subgroup_clustered_reduce extension to
`-fdeclare-opencl-builtins`.
2021-02-10 09:44:52 +00:00
Sven van Haastregt
9ae99a0de8 [OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs
Add the builtin functions brought by the
cl_khr_subgroup_non_uniform_arithmetic extension to
`-fdeclare-opencl-builtins`.

Differential Revision: https://reviews.llvm.org/D95951
2021-02-10 09:44:39 +00:00
Sander de Smalen
9db6e97a86 [LoopVectorize] NFC: Change computeFeasibleMaxVF to operate on ElementCount.
This patch is NFC and changes occurrences of `unsigned MaxVectorSize`
to work on type ElementCount.

This patch is a preparatory patch with the ultimate goal of making
`computeMaxVF()` return both a max fixed VF and a max scalable VF,
so that `selectVectorizationFactor()` can pick the most cost-effective
vectorization factor.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D96018
2021-02-10 08:52:10 +00:00
Sander de Smalen
750a78cd5d [ValueTypes] Add MVT for nxv1bf16.
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D96249
2021-02-10 08:50:41 +00:00
Sam Parker
9d81ccc02f [WebAssembly] Enable loop unrolling
Enable partial and runtime unrolling with a threshold of 30, which
was derived from a large number of kernels running on node and
wasmtime for amd64 and aarch64.

Unrolling is enabled by default at -O2 and -O3 and is disabled at
-Oz and -Os. Compiling with -Os is recommended if the wasm binary
size is the most important factor.

Differential Revision: https://reviews.llvm.org/D95125
2021-02-10 08:25:46 +00:00
Jessica Paquette
7eee858585 [AArch64][GlobalISel] Fold selects fed by G_PTR_ADD
Similar to the case for G_ADD.

There was a function in CTMark/pairlocalalign which was missing this case,
causing GlobalISel to emit a add + csel when a csinc is all that is necessary.

https://godbolt.org/z/ax69E9

Minor code size improvements on CTMark at -Os.

Differential Revision: https://reviews.llvm.org/D96390
2021-02-10 00:03:13 -08:00
Artem Dergachev
ddb01010b2 Revert "[analyzer] RetainCountChecker: Add a suppression for OSSymbols."
This reverts commit 3500cc8d89.

This old commit was made over a completely false premise. OSSymbols
aren't different from other OSObjects and we shouldn't treat them
differently for the purposes of static analysis.
2021-02-09 23:44:33 -08:00
Tres Popp
f30f347da1 [mlir][shape] Generalize broadcast to a variadic number of shapes
Previously broadcast was a binary op. Now it can support more inputs.
This has been changed in such a way that for now, this is an NFC for
all broadcast operations that were previously legal.

Differential Revision: https://reviews.llvm.org/D95777
2021-02-10 08:31:28 +01:00
Kazu Hirata
7e75f6fc1d [SelectionDAG] Use range-based for loops (NFC) 2021-02-09 22:14:30 -08:00
Kazu Hirata
781d0fea72 [TableGen] Drop unnecessary const from return types (NFC) 2021-02-09 22:14:28 -08:00
Kazu Hirata
0f360fffe7 [TableGen] Use ListSeparator (NFC) 2021-02-09 22:14:27 -08:00
Michael Kruse
222d380d2f [Polly] Make the NewPM pass pipeline more similar to the legacy's.
Even though it has some oddities, both pipelines should be as similar as
possible. Also use report_fatal_error instead of assertions to ensure a
proper failure in release builds for unsupported options.

This finalizes the patch serious to make Polly run in the default
configuration when using the NewPM by default.
2021-02-09 23:56:22 -06:00
Michael Kruse
08bab4b030 [Polly] Make NewPM's IslAstAnalysis more similar to the legacy IslAstInfoWrapperPass.
In particular, print the ast with -debug-only=polly-ast, print a
per-scop header with print<polly-ast> and force-add the analysis with
-polly-code-generation=ast.
2021-02-09 23:56:21 -06:00
Michael Kruse
13f758a805 [Polly] Improve Simplify pass PM integration.
1. LegacyPM: Rename SimplifyLegacyPass to SimplifyWrapperPass.
2. LegacyPM: Complete create/init functions in LinkAllPasses.h
3. NewPM: Only invalidate non-Scop passes if changed.
4. NewPM: Add to default pass pipeline.
5. NewPM: Print -analyze header for each print<polly-simplify>
2021-02-09 23:56:21 -06:00
Michael Kruse
e200df952b [Polly] Port IslScheduleOptimizer to the NewPM. 2021-02-09 23:56:21 -06:00
Michael Kruse
5ff963fd11 [Polly] Add TargetTransformInfo to ScopPass standard analysis results.
TargetTransformInfo is required by IslScheduleOptimizer, as ScopPass.
Unfortunately it is not possible to get arbitrary larger-unit analyses
in for as ScopPass. Loop passes also already use TargetTransformInfo as
LoopStandardAnalysisResults, hence wei might expect it to be available
to Scop passes as well.
2021-02-09 23:56:20 -06:00
Michael Kruse
e7b9e43c9a [Polly] Register pass-instrumentation for NewPM's Scop level.
The pass-instrumentation pass is implicitly execute by the NewPM
whenever a new analysis runs. Not registering it will cause the crash
whenever a scop pass requests an analysis.

For instance this is the case for the IstAstAnalysis requesting the
DependenceAnalsis result.
2021-02-09 23:56:20 -06:00
Michael Kruse
b687fc9122 [Polly] Port PruneUnprofitable to the NewPM. 2021-02-09 23:56:20 -06:00
Michael Kruse
7903d594ea [Polly] Port DeLICM to the NewPM. 2021-02-09 23:56:19 -06:00
Michael Kruse
4c64d8ee3a [Polly] Port ForwardOpTree to the NewPM. 2021-02-09 23:56:19 -06:00
Ta-Wei Tu
e89fcbfad6 Fix deprecated usage of mallinfo
glibc deprecates `mallinfo` in the latest version of 2.33. This patch replaces the usage of `mallinfo` with the new `mallinfo2` when it's available.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D96359
2021-02-10 13:53:57 +08:00
Max Kazantsev
b910fab705 [Test] Two more tests on usub
They are analogous to the existing tests, but use different starting offset
which can be important for some transforms.
2021-02-10 12:29:08 +07:00
Timm Bäder
a6439b5208 [clang][driver] Only warn once about invalid library values
Since ToolChain::GetCXXStdlibType() is a simple getter that might emit
the "invalid library name in argument" warning, it can conceivably be
called several times while initializing the build pipeline.

Before this patch, a simple 'clang++ -stdlib=foo ./test.cpp' would print
the warning twice, -rt=lib=foo would print 6 times.

Change this and always only print the warning once. Keep the rest of the
semantics of the functions.

Differential Revision: https://reviews.llvm.org/D95915
2021-02-10 06:19:52 +01:00
Uday Bondhugula
fdfd647837 [MLIR] NFC Fix vector transforms build warnings
Fix build warnings from VectorTransforms.cpp.
2021-02-10 10:42:56 +05:30
Uday Bondhugula
5400f602cd [MLIR] Update affine.for unroll utility for iter_args support
Update affine.for loop unroll utility for iteration arguments support.
Fix promoteIfSingleIteration as well.

Fixes PR49084: https://bugs.llvm.org/show_bug.cgi?id=49084

Differential Revision: https://reviews.llvm.org/D96383
2021-02-10 10:38:47 +05:30
Christopher Di Bella
8caf835337 [libcxx] adds concept std::convertible_to
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Differential Revision: https://reviews.llvm.org/D77961
2021-02-10 03:27:41 +00:00
Yang Fan
66ac53fe31
[clang][cli] Fix gcc "enumeral and non-enumeral type in conditional expression" warning (NFC) 2021-02-10 11:15:39 +08:00
Todd Lipcon
747c450e6f
Fix JSON formatting when converting to trace event format
Reviewed By: dberris

Differential Revision: https://reviews.llvm.org/D96384
2021-02-10 13:00:28 +11:00
Todd Lipcon
5dd29d9922
Fix xray fdr mode to allow multiple flushes
Reviewed By: dberris

Differential Revision: https://reviews.llvm.org/D96382
2021-02-10 12:57:24 +11:00
Jim Ingham
483ec136da Use internal_dict everywhere we refer to the python session dict in docs. 2021-02-09 17:48:47 -08:00
Andrew Pritchard
74c3615997 Add LLVMIR Dialect counterparts of @llvm.maximum and @llvm.minimum.
These are similar to maxnum and minnum, but they're defined to treat -0
as less than +0.  This behavior can't be expressed using float
comparisons and selects, since comparisons are defined to treat
different-signed zeros as equal.  So, the only way to communicate this
behavior into LLVM IR without defining target-specific intrinsics is to
add the corresponding ops.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D96373
2021-02-10 00:57:43 +00:00
Andrew Pritchard
018645b81b Fix side-effect detection in LLVMIRIntrinsicGen.
Previously it reported an op had side-effects iff it declared that it
didn't have any side-effects.  This had the undesirable result that
canonicalization would always delete any intrinsic calls that did memory
stores and returned void.

Reviewed By: ftynse, mehdi_amini

Differential Revision: https://reviews.llvm.org/D96369
2021-02-10 00:48:16 +00:00
Tyker
5652e192fc Revert "[InstCombine] convert assumes to operand bundles"
This reverts commit 5eb2e994f9.
2021-02-10 01:32:00 +01:00
Michael Kruse
3dcb535115 [Polly] Remove use of -O3 in regression test.
In addition to that regression tests should not test the intire pass
pipeline (unless they are testing the pipeline itself), the Polly-ACC
currently does not support the new pass manager. If enabled by default,
such tests will therefore fail.

Use the -polly-gpu-runtime and -polly-gpu-arch options also as default
values for the PPCGCodeGeneration pass. This requires to move the option
to be moved from the pipeline-building Register passes to the
PPCGCodeGeneration implementation.

Fixes the spir-typesize.ll buildbot fail.
2021-02-09 18:13:35 -06:00
Shafik Yaghmour
4f14c17df7 [LLDB] Remove uneeded CopyType from BlockPointerSyntheticFrontEnd
BlockPointerSyntheticFrontEnd does a CopyType which results in it copying the type
back into its own context. This will result in a call to ASTImporterDelegate::setOrigin
with &decl->getASTContext() == origin.ctx this can result in an infinite recursion
later on in ASTImporter since it will attempt to find the decl in its origin which will be itself.

Differential Revision: https://reviews.llvm.org/D96366
2021-02-09 16:11:28 -08:00
Jim Ingham
ffd7be65d0 Remove trailing spaces after \ in comments. 2021-02-09 16:06:47 -08:00
Jim Ingham
365b186c24 Add documentation for the extra_args parameter to breakpoint commands.
Differential Revision: https://reviews.llvm.org/D96368
2021-02-09 15:33:36 -08:00
Jing Pu
4bd68f238c Add NoSideEffect trait to shape.split_at and shape.concat
Reviewed By: jpienaar, silvas

Differential Revision: https://reviews.llvm.org/D96358
2021-02-09 15:19:53 -08:00
Eric Schweitz
e090182fe1 [flang][fir] Updates to internal name uniquer.
https://github.com/flang-compiler/f18-llvm-project/pull/474

Differential Revision: https://reviews.llvm.org/D96361
2021-02-09 14:43:33 -08:00
Thomas Lively
067f005500 [lld][WebAssembly] Fix segfault in map file support
The code previously assumed that `getChunk` would return a non-null pointer for
every symbol, but in fact it only returns non-null pointers for DefinedFunction
and DefinedData symbols. This patch fixes the segfault by checking whether
`getChunk` returns a null for each symbol and skipping the mapping output for
any symbols for which it does.

Differential Revision: https://reviews.llvm.org/D88369
2021-02-09 14:42:43 -08:00
River Riddle
6e3292b0b7 [mlir][OpFormatGen] Refactor type_ref into a more general ref directive
This allows for referencing nearly every component of an operation from within a custom directive.

It also fixes a bug with the current type_ref implementation, PR48478

Differential Revision: https://reviews.llvm.org/D96189
2021-02-09 14:33:48 -08:00
River Riddle
b9c876bd7e [mlir] Add initial support for an alias analysis framework in MLIR
This revision adds a new `AliasAnalysis` class that represents the main alias analysis interface in MLIR. The purpose of this class is not to hold the aliasing logic itself, but to provide an interface into various different alias analysis implementations. As it evolves this should allow for users to plug in specialized alias analysis implementations for their own needs, and have them immediately usable by other analyses and transformations.

This revision also adds an initial simple generic alias, LocalAliasAnalysis, that provides support for performing stateless local alias queries between values. This class is similar in scope to LLVM's BasicAA.

Differential Revision: https://reviews.llvm.org/D92343
2021-02-09 14:21:27 -08:00