Commit Graph

379544 Commits

Author SHA1 Message Date
Craig Topper
cb161b3a88 [RISCV] Add support for matching .vf forms of fadd/fsub/fmul/fdiv/fma for fixed vectors.
fma+neg will come in a different patch since I haven't done it for .vv
yet either.

Differential Revision: https://reviews.llvm.org/D96375
2021-02-10 10:16:27 -08:00
Tom Stellard
997f6b6f8e [CMake] Remove some dead code in llvm_install_library_symlink()
Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D95666
2021-02-10 10:13:04 -08:00
Mehdi Amini
e49967fbd9 Revert "Add convenience C++ helper to manipulate ranked strided memref"
This reverts commit 11f32a41c2.

The build is broken because this commit conflits with the refactoring of
the DialectRegistry APIs in the context. It'll reland shortly after
fixing the API usage.
2021-02-10 18:09:38 +00:00
Craig Topper
0c254b4a69 [RISCV] Add support for selecting vrgather.vx/vi for fixed vector splat shuffles.
The test cases extract a fixed element from a vector and splat it
into a vector. This gets DAG combined into a splat shuffle.

I've used some very wide vectors in the test to make sure we have
at least a couple tests where the element doesn't fit into the
uimm5 immediate of vrgather.vi so we fall back to vrgather.vx.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D96186
2021-02-10 10:01:56 -08:00
Christopher Di Bella
2193e8be3e [libcxx] adds concept std::copy_constructible
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96230

Differential Revision: https://reviews.llvm.org/D96232
2021-02-10 17:56:42 +00:00
Fangrui Song
04a2e12612 DebugInfo/Symbolize: Retrieve filename from the preceding STT_FILE for .symtab symbolization
The ELF spec says:

> STT_FILE: Conventionally, the symbol's name gives the name of the source file associated with the object file. A file symbol has STB_LOCAL binding, its section index is SHN_ABS, and it precedes the other STB_LOCAL symbols for the file, if it is present.

For a local symbol, the preceding STT_FILE symbol is almost always in the same
file[1]. GNU addr2line uses this heuristic to retrieve the filename associated
with a local symbol (e.g. internal linkage functions in C/C++).

GNU addr2line can assign STT_FILE filename to a non-local symbol, too, but the trick
only works if no regular symbol precede STT_FILE. This patch does not implement this corner case
(not useful for most executables which have more than one files).

In case of filename mismatch between .debug_line & .symtab, arbitrarily make .debug_line win.

[1]: LLD does not synthesize STT_FILE symbols
(https://bugs.llvm.org/show_bug.cgi?id=48023 see also
https://sourceware.org/bugzilla/show_bug.cgi?id=26822).  An assembly file
without `.file` directives can cause mis-attribution. This is an edge case.

Differential Revision: https://reviews.llvm.org/D95927
2021-02-10 09:47:10 -08:00
Fangrui Song
4f30a3d3d2 [llvm-cfi-verify] Set UseSymbolTable to false
parseSectionContents expects to skip regions not described by DWARF.  With my
pending DebugInfo/Symbolize change, the filename can be recovered and there
will be more IndirectInstructions entries.
2021-02-10 09:44:13 -08:00
Mehdi Amini
11f32a41c2 Add convenience C++ helper to manipulate ranked strided memref
Differential Revision: https://reviews.llvm.org/D96192
2021-02-10 17:40:36 +00:00
Christopher Di Bella
2b2f36a8b1 [libcxx] adds concept std::move_constructible
Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D77961

Differential Revision: https://reviews.llvm.org/D96230
2021-02-10 17:33:35 +00:00
Fangrui Song
564788ddce [Polly] Fix -Wunused-lambda-capture 2021-02-10 09:19:05 -08:00
Fangrui Song
89e257bd62 [Polly] Fix -DPOLLY_ENABLE_GPGPU_CODEGEN=off build after 222d380d2f 2021-02-10 09:17:13 -08:00
Mitch Phillips
b93786907c [GWP-ASan] Add back some headers removed by IWYU.
These headers are required for Android.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D96374
2021-02-10 09:13:45 -08:00
Nicolas Vasilache
0ac3d97bf4 [mlir][Linalg] Fix pad hoisting.
This revision fixes the indexing logic into the packed tensor that result from hoisting padding. Previously, the index was incorrectly set to the loop induction variable when in fact we need to compute the iteration count (i.e. `(iv - lb).ceilDiv(step)`).

Differential Revision: https://reviews.llvm.org/D96417
2021-02-10 16:49:38 +00:00
Tom Weaver
b86a763afb Revert "Revert "[clang][driver] Only warn once about invalid library values""
This reverts commit a743702a1f.

Test was fixed in c6a1b16db7
2021-02-10 16:40:07 +00:00
Tom Weaver
a743702a1f Revert "[clang][driver] Only warn once about invalid library values"
This reverts commit a6439b5208.

Caused buildbot failure http://lab.llvm.org:8014/#/builders/125/builds/125
2021-02-10 16:37:34 +00:00
Colin Finck
ebfadd82cb [libc++] Fix copy-paste mistake in __threading_support
Differential Revision: https://reviews.llvm.org/D96115
2021-02-10 11:00:32 -05:00
Jeremy Morse
1d68e0a075 Reland [DWARF] Location-less inlined variables should not have DW_TAG_variable
Originally landed in ddc2f1e3fb and reverted in d32deaab4d because of
a Generic test objecting. That was fixed up in 013613964f. Original
landing commit message follows:

[DWARF] Location-less inlined variables should not have DW_TAG_variable

Discussed in this thread:

  https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html

DwarfDebug::collectEntityInfo accidentally distinguishes between variable
locations that never have a location specified, and variable locations that
have an empty location specified. The latter leads to the creation of an
empty variable referring to the abstract origin.

Fix this by seeking a non-empty location before producing a concrete
entity, to guarantee a DW_AT_location will be produced. Other loops in
collectEntityInfo and endFunctionImpl take care of examining the
retainedNodes collection and ensuring optimised-out variables are created.

Differential Revision: https://reviews.llvm.org/D95617
2021-02-10 15:40:47 +00:00
Paul Robinson
5ea2d4fa48 Avoid conflicts between debug-info and pseudo-probe profiling
After D93264, using both -fdebug-info-for-profiling and
-fpseudo-probe-for-profiling will cause the compiler to crash.
Diagnose these conflicting options in the driver.

Also, the existing CodeGen test was using the driver when it should be
running cc1.

Differential Revision: https://reviews.llvm.org/D96354
2021-02-10 07:09:18 -08:00
Jay Foad
b5f3383152 [AMDGPU] Add another test case for combining DS reads 2021-02-10 14:59:49 +00:00
Jay Foad
2114b458b0 [AMDGPU] Fix comments in SILoadStoreOptimizer::offsetsCanBeCombined 2021-02-10 14:49:33 +00:00
Nico Weber
c6a1b16db7 clang: try to fix Driver/undefined-libs.cpp on non-linux 2021-02-10 09:45:04 -05:00
Luís Marques
acac29ca42 [DAGCombiner] Don't fold FCOPYSIGN vector sign operand casts
Avoid doing the following combine for vector types:

```
copysign(x, fp_extend(y)) -> copysign(x, y)
copysign(x, fp_round(y)) -> copysign(x, y)
```

That combine seemed to impede the selection of vector instruction and cause
a mess in some circumstances.

Differential Revision: https://reviews.llvm.org/D96037
2021-02-10 14:25:24 +00:00
Nicolas Vasilache
bb69de3f41 [mlir][Linalg] Add a vectorization pattern for linalg::PadTensorOp
The new pattern is exercised from the TestLinalgTransforms pass.

Differential Revision: https://reviews.llvm.org/D96410
2021-02-10 14:13:49 +00:00
Timm Bäder
6f9db455a5 [clang][NFC] Fix undefined-libs tests
Not all platforms accept -stdlib or -rtlib. Instead of complaining about
the wrong argument to these options, clang complains about the option
itself being present.

Pass an appropriate -target to the clang invocations.
2021-02-10 15:01:09 +01:00
Nico Weber
ec4fb5bcd3 [gn build] (manually) port e89fcbfad6 2021-02-10 08:59:07 -05:00
Daniel Cederman
ad3b023c88 [Sparc] Support relocatable expressions in the assembler
Allow assembler expressions to start with an identifier. This allows for expressions such as
```
b symbol + 4
```
and
```
mov symEnd - symStart, %g1
```

The patch builds upon https://reviews.llvm.org/D47136.

Reviewed By: joerg

Differential Revision: https://reviews.llvm.org/D47458
2021-02-10 14:52:44 +01:00
Andrzej Warzynski
cf471632b1 [flang][driver] Add missing dependency in unit tests (nfc)
The following patch revealed a missing dependency in the CMake script
for Flang driver unit tests:
  * https://reviews.llvm.org/D96032
The following buildbots are failing ("BUILD_SHARED_LIBS" is set to ON):
  * http://lab.llvm.org:8011/#/builders/134/builds/1840
  * http://lab.llvm.org:8011/#/builders/66/builds/1785
  * http://lab.llvm.org:8011/#/builders/33/builds/2436

This patch adds the missing dependency.

From what I can see, FortranSemantics and FortranParser are only
indirect dependencies of FlangFrontendTests and IIUC shouldn't be
required here. This is something that we should revisit at some point.
In this patch I focus on fixing the build.
2021-02-10 13:31:49 +00:00
Jan Svoboda
a7150415dd [clang][cli] Declare local variable for marshalling macros
Some Windows build bots report `FileSystemOpts` and `MigratorOpts` as undeclared. This fix renames the parameter and declares a local variable with the original name.
2021-02-10 13:54:08 +01:00
Jan Svoboda
fa11496b61 [clang][cli] Extract FileSystem and Migrator options parsing/generation
This patch splits out the last two option groups (`Filesystem` and `Migrator`) into their own `Parse`/`Generate` functions.

This effectively removes the need for `parseSimpleArgs` and marshalling block in `CompilerInvocation::generateCC1CommandLine`.

The two new `Parse`/`Generate` functions are not part of the round-trip, because they contain no custom code and the very next patch starts round-tripping the whole `CompilerInvocation`.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96278
2021-02-10 13:36:00 +01:00
Jan Svoboda
eb581fc324 [clang][cli] Generate and round-trip Diagnostic options
This patch implements generation of remaining diagnostic options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96274
2021-02-10 12:44:49 +01:00
Jan Svoboda
17e5c99d51 [clang][cli] Generate and round-trip DependencyOutput options
This patch implements generation of remaining dependency output options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96273
2021-02-10 12:20:51 +01:00
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