Commit Graph

379428 Commits

Author SHA1 Message Date
Eric Schweitz
399c3d5b29 [flang][fir] Add shape, shape_shift, and slice types.
Adding the FIR types used to describe the Fortran semantics of indexing
FIR arrays.

https://github.com/flang-compiler/f18-llvm-project/pull/267

Differential Revision: https://reviews.llvm.org/D96172
2021-02-09 08:55:47 -08:00
Tobias Gysi
5fa893cc38 [mlir] add support for verification in integration tests
The patch extends the runner utils by verification methods that compare two memrefs. The methods compare the content of the two memrefs and print success if the data is identical up to a small numerical error. The methods are meant to simplify the development of integration tests that for example compare optimized and unoptimized code paths (cf. the updates to the linalg matmul integration tests).

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96326
2021-02-09 17:43:11 +01:00
Jon Chesterfield
56c446a878 [libomptarget][amdgcn] Tolerate deadstripped device_state variable
[libomptarget][amdgcn] Tolerate deadstripped device_state variable

The device_state variable may have been deadstripped. Similar to
device_environment, leave detection of missing but used symbol to loader.

Reviewed By: pdhaliwal

Differential Revision: https://reviews.llvm.org/D96330
2021-02-09 16:29:53 +00:00
Nico Weber
de1966e542 Revert "[ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly"
This reverts commit 4a64d8fe39.
Makes clang crash when buildling trivial iOS programs, see comment
after https://reviews.llvm.org/D92808#2551401
2021-02-09 11:06:32 -05:00
Dave Lee
2309392449 [lldb] Inline invariant params to AppleThreadPlanStepThrough (NFC)
These two `AppleThreadPlanStepThrough` thread plans have parameterized behavior
that is unutilized. To make their interface and implementation simpler, this
change inlines those outside parameters.

Differential Revision: https://reviews.llvm.org/D96276
2021-02-09 08:03:51 -08:00
Jan Svoboda
5e8a246ac9 [clang][cli] Generate and round-trip Frontend options
This patch implements generation of remaining frontend options and tests it by performing parse-generate-parse round trip.

Depends on D96269.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96155
2021-02-09 16:40:30 +01:00
Sam McCall
dd8fb21227 [clangd] Implement semanticTokens modifiers
- Infrastructure to support modifiers (protocol etc)
- standard modifiers:
  - declaration (but no definition, yet)
  - deprecated
  - readonly (based on a fairly fuzzy const checking)
  - static (for class members and locals, but *not* file-scope things!)
  - abstract (for C++ classes, and pure-virtual methods)
- nonstandard modifier:
  - deduced (on "auto" whose Kind is Class etc)
    Happy to drop this if it's controversial at all.
- While here, update sample tweak to use our internal names, in
  anticipation of theia TM scopes going away.

This addresses some of the goals of D77702, but leaves some things undone.
Mostly because I think these will want some discussion.
 - no split between dependent type/name.
   (We may want to model this as a modifier, type+dependent vs ???+dependent)
 - no split between primitive/typedef.
   (Is introducing a nonstandard kind is worth this distinction?)
 - no nonstandard local attribute
   This probably makes sense, I'm wondering if we want others and how
   they fit together.

There's one minor regression in explicit template specialization declarations
due to a latent bug in findExplicitReferences, but fixing it after seems OK.

Differential Revision: https://reviews.llvm.org/D77811
2021-02-09 16:31:22 +01:00
Anastasia Stulova
79b222c39f [OpenCL] Fix types with signed prefix in arginfo metadata.
Signed prefix is removed and the single word spelling is
printed for the scalar types.

Tags: #clang

Differential Revision: https://reviews.llvm.org/D96161
2021-02-09 15:13:19 +00:00
Lei Zhang
7784ce078d [mlir][linalg] Fix depthwise conv C++ symbol to be consistent
The assembly mnemonic includes information about input/filter
data format. The C++ symbol should be consistent.
2021-02-09 10:06:32 -05:00
Thomas Raoux
bfa508efd5 [mlir][linalg] Fix one more missing NoSideEffect in linalg tensor op
Differential Revision: https://reviews.llvm.org/D96314
2021-02-09 07:04:50 -08:00
Jan Svoboda
396d6a3220 [clang][cli] Store unsigned instead of OptSpecifier in table
This fixes some buildbot failures with ambiguous call to OptSpecifier constructor.
2021-02-09 15:46:10 +01:00
Jan Svoboda
7369bfb8ab [clang][cli] Look up program action argument in a table
This patch extracts the mapping between command line option and frontend::ActionKind into a table. The table can be reused when parsing and also generating command line options.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96269
2021-02-09 15:29:33 +01:00
Nico Weber
23cd8d51ad Try to fix compiler-rt tests after 87dbdd2e3b on mac and win
These tests use `--check-prefix=CHECK-%os` but then didn't have
a CHECK line for every os.

In most tests, the linux expectations were sufficient (they match
the "wrap_" prefix with .*), so just remove the check-prefix there.
In the places where this didn't easily work, make sure there are
at least CHECK-Windows and CHECK-Darwin lines.
2021-02-09 09:28:52 -05:00
Jan Svoboda
521e1733f1 [clang][cli] Store InputKind in FrontendOptions
This patch stores the `InputKind` (parsed mainly from `-x`) to `FrontendOptions`. This is necessary for command line generation.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96149
2021-02-09 15:19:26 +01:00
Simon Pilgrim
89d9ff8229 [X86][SSE] foldShuffleOfHorizOp - add SHUFPS v4f32 handling
Fold shufps(hop(x,y),hop(z,w)) -> permute(hop(x,z)) - this is very similar to the equivalent unpack fold.

I did start trying to convert foldShuffleOfHorizOp to handle generic shuffle masks but we're relying on a lot of special cases at the moment.
2021-02-09 14:18:45 +00:00
Denys Shabalin
fa581f9438 [mlir] Add stacksave, stackrestore to llvm dialect
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D96333
2021-02-09 15:13:16 +01:00
poelmanc
98146c1f5d
[clang-tidy] fix modernize-use-nullptr false positive with spaceship operator comparisons
`clang-tidy -std=c++20` with `modernize-use-nullptr` mistakenly inserts `nullptr` in place of the comparison operator if the comparison internally expands in the AST to a rewritten spaceship operator. This can be reproduced by running the new `modernize-use-nullptr-cxx20.cpp` test without applying the supplied patch to `UseNullptrCheck.cpp`; the current clang-tidy will mistakenly replace:
```result = (a1 < a2);```
with
```result = (a1 nullptr a2);```

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D95714
2021-02-09 14:02:45 +00:00
Lei Zhang
068bf9e802 [mlir][linalg] Define a depthwise 2-D convolution op
This commit defines linalg.depthwise_conv_2d_nhwc for depthwise
2-D convolution with NHWC input/output data format.

This op right now only support channel multiplier == 1, which is
the most common case.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D94966
2021-02-09 08:55:20 -05:00
Lei Zhang
4c640e49c9 [mlir][linalg] Verify indexing map required attributes
Indexing maps for named ops can reference attributes so that
we can synthesize the indexing map dynamically. This supports
cases like strides for convolution ops. However, it does cause
an issue: now the indexing_maps() function call is dependent
on those attributes.

Linalg ops inherit LinalgOpInterfaceTraits, which calls
verifyStructuredOpInterface() to verify the interface.
verifyStructuredOpInterface() further calls indexing_maps().
Note that trait verification is done before the op itself,
where ODS generates the verification for those attributes.
So we can have indexing_maps() referencing non-existing or
invalid attribute, before the ODS-generated verification
kick in.

There isn't a dependency handling mechansim for traits.
This commit adds new interface methods to query whether an
op hasDynamicIndexingMaps() and then perform
verifyIndexingMapRequiredAttributes() in
verifyStructuredOpInterface() to handle the dependency issue.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96297
2021-02-09 08:48:29 -05:00
Nico Weber
e0b8604e5d [lld/mac] Implement -u flag
Since we emit diagnostics for undefineds in Writer::scanRelocations()
and symbols referenced by -u flags aren't referenced by any relocations,
this needs some manual code (similar to the entry point).

Differential Revision: https://reviews.llvm.org/D94371
2021-02-09 08:23:06 -05:00
Wang, Pengfei
dd2460ed5d [X86] Always assign reassoc flag for intrinsics *reduce_add/mul_ps/pd.
Intrinsics *reduce_add/mul_ps/pd have assumption that the elements in
the vector are reassociable. So we need to always assign the reassoc
flag when we call _mm_reduce_* intrinsics.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D96231
2021-02-09 21:14:06 +08:00
Nemanja Ivanovic
a5222aa085 [DAGCombine] Do not remove masking argument to FP16_TO_FP for some targets
As of commit 284f2bffc9, the DAG Combiner gets rid of the masking of the
input to this node if the mask only keeps the bottom 16 bits. This is because
the underlying library function does not use the high order bits. However, on
PowerPC's ELFv2 ABI, it is the caller that is responsible for clearing the bits
from the register. Therefore, the library implementation of __gnu_h2f_ieee will
return an incorrect result if the bits aren't cleared.

This combine is desired for ARM (and possibly other targets) so this patch adds
a query to Target Lowering to check if this zeroing needs to be kept.

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

Differential revision: https://reviews.llvm.org/D96283
2021-02-09 06:33:48 -06:00
Nemanja Ivanovic
f6e4b9fc06 [RISCV] Fix shared libs build
Commit a2d19bad07 introduced a
dependency in the RISCV disassembler on two additional libraries
(MC, RISCVDesc) which wasn't added to the CMakeLists.txt. This
causes shared library builds to break. This patch just adds them
to fix failures seen on some bots, such as the PPC64LE Multistage.
2021-02-09 06:14:25 -06:00
Jon Chesterfield
4756f76bce [libomptarget][amdgcn] Tolerate deadstripped env variable
[libomptarget][amdgcn] Tolerate deadstripped env variable

Discovered by Pushpinder. If the device_environment variable is unused
it can be deadstripped, in which case we should not abort due to it
missing. This change is safe in that a missing symbol which is actually
used can be reported by both linker and loader, and a missing unused
symbol is better deadstripped than left in the image.

Reviewed By: pdhaliwal

Differential Revision: https://reviews.llvm.org/D96329
2021-02-09 11:58:37 +00:00
Dylan McKay
2ccb941740 [AVR] Fix global references to function symbols
References to functions are in program memory and need a `pm()` fixup. This should fix trait objects for Rust on AVR.

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

Patch by Alex Mikhalev.
2021-02-10 00:40:49 +13:00
Thomas Preud'homme
a50ab8672d Revert STRICT_FCMP nonan optimisation
Summary: This reverts commit b7b61a7b5b which fails on some of the builders: http://lab.llvm.org:8011/#/builders/14/builds/5806

Reviewers:

Subscribers:
2021-02-09 11:27:35 +00:00
Thomas Preud'homme
b7b61a7b5b Improve STRICT_FSETCC codegen in absence of no NaN
As for SETCC, use a less expensive condition code when generating
STRICT_FSETCC if the node is known not to have Nan.

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D91972
2021-02-09 11:18:16 +00:00
Vitaly Buka
03c6a6d9ef [NFC,Clang] Add more Asan Driver tests 2021-02-09 03:08:00 -08:00
Vitaly Buka
4ddf7562d5 [NFC,Clang] Add SanCov Driver tests 2021-02-09 03:08:00 -08:00
Vitaly Buka
dde9f0fa98 [NFC,Clang] Add LTO Driver MSan,KMsan tests 2021-02-09 03:08:00 -08:00
Vitaly Buka
9ff678f614 [NFC,Clang] Add LTO Driver DFsan tests 2021-02-09 03:08:00 -08:00
Vitaly Buka
ea891099f2 [NFC,Clang] Add LTO Driver Tsan tests 2021-02-09 03:08:00 -08:00
Kirill Bobyrev
b60428c7ea [clangd] Fix false positive in local rename collision detetction
Fixes https://github.com/clangd/clangd/issues/685

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D96247
2021-02-09 11:51:18 +01:00
Valeriy Savchenko
2f994d4ee9 [-Wcompletion-handler][NFC] Remove unexpected warnings on Windows 2021-02-09 13:50:11 +03:00
Jan Svoboda
e721bc9eff [clang][cli] Generate and round-trip CodeGen options
This patch implements generation of remaining codegen options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D96056
2021-02-09 11:43:38 +01:00
Jan Svoboda
ec12f5febe [clang][codegen] Remember string used to create llvm::Regex for optimization remarks
Regular expression patterns passed through the command line are being used to create an instances of `llvm::Regex` and thrown away.

There is no API to serialize `Regex` back to the original pattern. This means we have no way to reconstruct the original pattern from command line. This is necessary for serializing `CompilerInvocation`.

This patch stores the original pattern string in `CodeGenOptions` alongside the `llvm::Regex` instance.

Reviewed By: dexonsmith, thegameg

Differential Revision: https://reviews.llvm.org/D96036
2021-02-09 11:12:13 +01:00
Jeremy Morse
d7d0b17de7 Revert "[DebugInfo] Re-engineer a test to be stricter, add XFails"
This reverts commit e05c10380c.

See parent commit, there's a bot which isn't captured in the XFail list,
reverting til I work out what it is.
2021-02-09 10:02:10 +00:00
Jeremy Morse
2ae580ab5d Revert "Follow up to e05c10380c: add aarch64 to test XFails"
This reverts commit 4fd29e4fd3.

There's a report in D95617 that this is failing on what (I think?) is an
aarch64 bot, which should be covered by the XFail list... reverting this
follow-up and the base patch until I work out what's wrong here.
2021-02-09 10:02:10 +00:00
LLVM GN Syncbot
76748b67d1 [gn build] Port 40c261c41c 2021-02-09 09:19:31 +00:00
Jan Svoboda
40c261c41c [clang][cli] Generate and round-trip language options
This patch implements generation of remaining language options and tests it by performing parse-generate-parse round trip (on by default for assert builds, off otherwise).

This patch also correctly reports failures in `parseSanitizerKinds`, which is necessary for emitting diagnostics when an invalid sanitizer is passed to `-fsanitize=` during round-trip.

This patch also removes TableGen marshalling classes from two options:
* `fsanitize_blacklist` When parsing: it's first initialized via the generated code, but then also changed by manually written code, which is confusing.
* `fopenmp` When parsing: it's first initialized via generated code, but then conditionally changed by manually written code. This is also confusing. Moreover, we need to do some extra checks when generating it, which would be really cumbersome in TableGen. (Specifically, not emitting it when `-fopenmp-simd` was present.)

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95793
2021-02-09 10:18:55 +01:00
Fangrui Song
d82679d805 [ELF] Drop Android specific workaround -m aarch64_elf64_le_vec
`extern const bfd_target aarch64_elf64_le_vec;` is a variable in BFD.
It was somehow misused as an emulation by Android.

```
% aarch64-linux-gnu-ld -m aarch64_elf64_le_vec a.o
aarch64-linux-gnu-ld: unrecognised emulation mode: aarch64_elf64_le_vec
Supported emulations: aarch64linux aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi
```

Acked by Stephen Hines, who removed the flag from Android a while back.
2021-02-09 00:43:10 -08:00
Valeriy Savchenko
d1522d349f [-Wcompletion-handler] Support checks with builtins
It is very common to check callbacks and completion handlers for null.
This patch supports such checks using built-in functions:
  * __builtin_expect
  * __builtin_expect_with_probablity
  * __builtin_unpredictable

rdar://73455388

Differential Revision: https://reviews.llvm.org/D96268
2021-02-09 11:32:24 +03:00
Hongtao Yu
5b8db127a3 [ELF] Rewriting the path of sample profile file for --reproduce response.txt
Rewritting the path of the sample profile file in response.txt to be relative to the repro tar.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D96193
2021-02-09 00:00:16 -08:00
Chuanqi Xu
88d7876e1e [NFC] [Coroutine] Remove Unused Variables 2021-02-09 15:55:06 +08:00
Hsiangkai Wang
a2d19bad07 [RISCV] Use whole register load/store for generic load/store.
In vector v0.10, there are whole vector register load/store
instructions. I suggest to use the whole register load/store
instructions for generic load/store for scalable vector types. It could
save up vset{i}vl{i} for these load/store.

For fractional LMUL, I keep to use vle{eew}.v/vse{eew}.v instructions to
load/store partial vector registers.

Differential Revision: https://reviews.llvm.org/D95853
2021-02-09 15:52:04 +08:00
Zakk Chen
1473b00cf8 [Docs] Fix Typo 2021-02-08 23:45:32 -08:00
Matthias Springer
b6910fd31d [MLIR][AVX512] Add integration test for vp2intersect
Differential Revision: https://reviews.llvm.org/D96306
2021-02-09 16:43:37 +09:00
Fangrui Song
b799289911 [test] Drop redundant REQUIRES: x86-registered-target 2021-02-08 23:36:37 -08:00
Fangrui Song
b48aea43d0 [test] Add REQUIRES: x86-registered-target to DebugInfo/Symbolize/ELF llvm-mc tests 2021-02-08 23:34:41 -08:00
Douglas Yung
4c23e42fe5 Mark 4 tests added in 6d766c8bf9 as requiring an x86 backend as they fail when it is not present.
This should fix buildbot failures like http://lab.llvm.org:8011/#/builders/107/builds/4469
2021-02-08 22:47:14 -08:00