Commit Graph

411835 Commits

Author SHA1 Message Date
Jonas Devlieghere 10ea731699 [dsymutil] Don't print timestamp warning if we have no timestamp
If we have no timestamp (0), don't print the corresponding warning. The
binary holder already successfully ignores these cases, but the warning
for swift interface files was lacking it.

rdar://86036385

Differential revision: https://reviews.llvm.org/D117333
2022-01-19 21:51:58 -08:00
Johannes Doerfert 6f2ee1ca5e [OpenMP][AMDGPU] Optimize the linked in math libraries
Once we linked in math files, potentially even if we link in only other
"system libraries", we want to optimize the code again. This is not only
reasonable but also helps to hide various problems with the missing
attribute annotations in the math libraries.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D116906
2022-01-19 23:36:36 -06:00
Jim Lin 216ac31dd7 [M68k][NFC] Rename Bt(BT) to Btst(BTST)
It seems that implementation of Bt refered from x86.
In M68k, Bt(BT) should be renamed to Btst(BTST).

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D117534
2022-01-20 12:45:02 +08:00
Johannes Doerfert b0789a1b12 [OpenMP] Avoid costly shadow map traversals whenever possible
In the OpenMC app we saw `omp target update` spending an awful lot of
time in the shadow map traversal without ever doing any update there.
There are two cases that allow us to avoid the traversal completely.
The simplest thing is that small updates cannot (reasonably) contain
an attached pointer part. The other case requires to track in the
mapping table if an entry might contain an attached pointer as part.
Given that we have a single location shadow map entries are created,
the latter is actually fairly easy as well.

Differential Revision: https://reviews.llvm.org/D113124
2022-01-19 22:14:41 -06:00
Johannes Doerfert 1e447d03e2 [OpenMP] Introduce an environment variable to disable atomic map clauses
Atomic handling of map clauses was introduced to comply with the OpenMP
standard (see D104418). However, many apps won't need this feature which
can be costly in certain situations. To allow for applications to
opt-out we now introduce the `LIBOMPTARGET_MAP_FORCE_ATOMIC` environment
flag that voids the atomicity guarantee of the standard for map clauses
again, shifting the burden to the user.

This patch also de-duplicates the code that introduces the events used
to enforce atomicity as a cleanup.

Differential Revision: https://reviews.llvm.org/D117627
2022-01-19 22:14:41 -06:00
Heejin Ahn eb675e972d [WebAssembly] Support Wasm EH + Wasm SjLj
D108960 added support for SjLj using Wasm EH instructions, which we call
Wasm SjLj going forward. (We call the old SjLj Emscripten SjLj) But it
did not support using Wasm EH and Wasm SjLj together. So far users of
Wasm EH had to use Wasm EH with Emscripten SjLj, which had a certain
limitation and it suffered from bigger code size increases as well.

This enables using Wasm EH and Wasm SjLj together.
1. This redirects `catchswitch` and `cleanupret` that unwind to caller
   to `catch.dispatch.longjmp` BB, which is a `catchswitch` BB that
   handles longjmps.
2. D108960 converted all longjmpable `call`s to `invokes` that unwind to
   `catch.dispatch.longjmp`. This CL checks if the `call` is embedded
   within another `catchpad`, and if so, makes it unwind to its nearest
   parent's unwind destination, rather than `catch.dispatch.longjmp`.
   This is necessary to preserve the scoping structure.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D117610
2022-01-19 20:13:54 -08:00
Fangrui Song 03909c4400 [ELF] Remove StringRefZ
StringRefZ does not improve performance. Non-local symbols always have eagerly
computed nameSize. Most local symbols's lengths will be updated in either:

* shouldKeepInSymtab
* SymbolTableBaseSection::addSymbol

Its benefit is offsetted by strlen in every call site (sums up to 5KiB code in a
release x86-64 build), so using StringRefZ may be slower.

In a -s link (uncommon) there is minor speedup, like ~0.3% for clang and chrome.

Reviewed By: alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D117644
2022-01-19 20:09:41 -08:00
River Riddle e39dae85f1 [mlir] Fix GCC5 build broken by improper name redefinition 2022-01-19 19:24:12 -08:00
Luo, Yuanke 5dea7a865e Combine to vpdpbusd when operand is constant and small enough.
Differential Revision: https://reviews.llvm.org/D116363
2022-01-20 11:10:49 +08:00
Ben Shi 94173dc24c [AVR] Generate ELPM for loading byte/word from extended program memory
Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D116493
2022-01-20 02:53:10 +00:00
Ben Shi c1dd607463 [AVR][MC] Generate section '.progmemX.data' for extended flash banks
Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D115987
2022-01-20 02:53:10 +00:00
Hsiangkai Wang 34570f4faf [RISCV] Add a test to show the bug in the RA caused by reserved BP.
The bug is reported in https://github.com/llvm/llvm-project/issues/53016.

Authored-by: Kito Cheng <kito.cheng@sifive.com>

Differential Revision: https://reviews.llvm.org/D117738
2022-01-20 02:37:29 +00:00
Nico Weber 70002a7a62 [gn build] (manually) port 30c17e70a4 2022-01-19 21:15:31 -05:00
minglotus-6 e95ad93e6e [llvm-dis] Add an option `dump-thinlto-index-only` in llvm-dis to read ThinLTO minimized code only. 2022-01-19 18:07:50 -08:00
Mircea Trofin 30c17e70a4 [MLGO] Don't run the 'release' mode tests in non-autogenerated cases 2022-01-19 17:59:06 -08:00
Adrian Tong b6a7ae2c5d Optimize shift and accumulate pattern in AArch64.
AArch64 supports unsigned shift right and accumulate. In case we see a
unsigned shift right followed by an OR. We could turn them into a USRA
instruction, given the operands of the OR has no common bits.

Differential Revision: https://reviews.llvm.org/D114405
2022-01-20 01:57:40 +00:00
Craig Topper 02d9a4d56d [LoopPeel] Pass TripCount to computePeelCount by value instead of by reference. NFC
The TripCount is not modified by the function so it doesn't need
to be passed by reference. Verified by passing it as const reference
before changing to value.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D117735
2022-01-19 17:54:45 -08:00
Peter Klausler 78649a8499 [flang] Accept INDEX(..., BACK=array)
The intrinsic table entry for INDEX mistakenly required
the optional BACK= argument to be scalar, but it's an
elemental intrinsic that can accept a conforming array.

Differential Revision: https://reviews.llvm.org/D117700
2022-01-19 17:37:24 -08:00
Peter Klausler bddfb81a31 [flang] Accept sparse argument keyword names for MAX/MIN
Accept any keyword argument names of the form "An" for
values of n >= 3 in calls to the intrinsic functions MAX, MIN,
and their variants, so long as "n" has no leading zero and
all the keywords are distinct.  Previously, f18 was needlessly
requiring the names to be contiguous.  When synthesizing keywords
to characterize the procedure's interface, don't conflict with
the program's keywords.

Differential Revision: https://reviews.llvm.org/D117701
2022-01-19 17:36:24 -08:00
River Riddle e084679f96 [mlir] Make locations required when adding/creating block arguments
BlockArguments gained the ability to have locations attached a while ago, but they
have always been optional. This goes against the core tenant of MLIR where location
information is a requirement, so this commit updates the API to require locations.

Fixes #53279

Differential Revision: https://reviews.llvm.org/D117633
2022-01-19 17:35:35 -08:00
Mohammed Nurul Hoque 21c79be5d7 [RISCV] Add patterns to MIR sign-extension removal pass.
This patch adds a few instruction patterns that generate sign-extended values or propagate them, adding to the pass introduced in https://reviews.llvm.org/D116397

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D117465
2022-01-19 17:33:58 -08:00
Peter Klausler 028477758d [flang] Accept BOZ literals for some actual arguments
Consistent with previously documented policy, in which
BOZ literals are accepted in non-standard-conforming circumstances
where they can be converted to an unambiguous known numeric type,
allow BOZ literals to be passed as an actual argument in a reference
to a procedure whose explicit interface has a corresponding dummy
argument with a numeric type to which the BOZ literal may be
converted.  Improve error messages associated with BOZ literal
actual arguments, too: don't emit multiple errors.

Differential Revision: https://reviews.llvm.org/D117698
2022-01-19 17:28:21 -08:00
Peter Klausler 2985d5623c [flang] Improve error message (initialized variable in pure subprogram)
When variable with the SAVE attribute appears in a pure subprogram,
emit a more specialized error message if the SAVE attribute was acquired
from static initialization.

Differential Revision: https://reviews.llvm.org/D117699
2022-01-19 17:27:31 -08:00
Joseph Huber 28d718602a [OpenMP] Expand short verisions of OpenMP offloading triples
The OpenMP offloading libraries are built with fixed triples and linked
in during compile time. This would cause un-helpful errors if the user
passed in the wrong expansion of the triple used for the bitcode
library. because we only support these triples for OpenMP offloading we
can normalize them to the full verion used in the bitcode library.

Reviewed By: jdoerfert, JonChesterfield

Differential Revision: https://reviews.llvm.org/D117634
2022-01-19 20:26:37 -05:00
Hsiangkai Wang d93ffa1b37 [docs] Fix typo in the example code in ProgrammersManual.
Differential Revision: https://reviews.llvm.org/D117665
2022-01-20 01:25:49 +00:00
Hsiangkai Wang 70cef70b13 [docs] Put define DEBUG_TYPE after include directives.
Differential Revision: https://reviews.llvm.org/D117666
2022-01-20 01:18:35 +00:00
Craig Topper 1507786c22 [LoopPeeling] Fix stale comments. NFC
These comments were not updated when PeelingPreferences split from
UnrollingPreferences.
2022-01-19 17:00:12 -08:00
Alexandre Ganea aba5b91b69 Re-land [CodeView] Add full repro to LF_BUILDINFO record
This patch writes the full -cc1 command into the resulting .OBJ, like MSVC does. This allows for external tools (Recode, Live++) to rebuild a source file without any external dependency but the .OBJ itself (other than the compiler) and without knowledge of the build system.

The LF_BUILDINFO record stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the source, and the full CC1 command line. The stored command line is self-standing (does not depend on the environment). In the same way, MSVC doesn't exactly store the provided command-line, but an expanded version (a somehow equivalent of CC1) which is also self-standing.

For more information see PR36198 and D43002.

Differential Revision: https://reviews.llvm.org/D80833
2022-01-19 19:44:37 -05:00
Johannes Doerfert dd75a6b2ae [DWARF][FIX] Try not to crash for nvptx with missing debug information
This prevents crashes in the OpenMP offload pipeline as not everything
is properly annotated with debug information, e.g., the runtimes we link
in. While we might want to have them annotated, it seems to be generally
useful to gracefully handle missing debug info rather than crashing.

TODO: A test is missing and can hopefully be distilled prior to landing.

This fixes #51079.

Differential Revision: https://reviews.llvm.org/D116959
2022-01-19 18:40:13 -06:00
Johannes Doerfert b4a7559844 [OpenMP][FIX] Replace ICVs only with values valid at the getter position
While we might know the value if an ICV at a getter position it is not
always clear that we can simply use it. Verify the value is valid first
to avoid invalid IR.

Fixes #53300.
2022-01-19 18:40:13 -06:00
Jez Ng ef95d45138 [lld-macho] Mention string literal deduplication as a difference from ld64
Reviewed By: keith

Differential Revision: https://reviews.llvm.org/D117250
2022-01-19 16:30:52 -08:00
Siva Chandra Reddy 10ed3c9d2c [libc] Move type definitions to their own self contained header files.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D117282
2022-01-20 00:13:32 +00:00
Dominik Grewe 1e09f0a972 Preserve function argument locations.
Previously the optional locations of function arguments were dropped in
`parseFunctionArgumentList`. This CL adds another output argument to the
function through which they are now returned. The values are then plumbed
through as an array of optional locations in the various places.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D117604
2022-01-20 00:01:12 +00:00
River Riddle d75c3e8396 [mlir] Don't print `// no predecessors` on entry blocks
Entry blocks can never have predecessors, so this is unnecessary.

Fixes #53287

Differential Revision: https://reviews.llvm.org/D117713
2022-01-19 15:57:58 -08:00
Lang Hames fabbe8d5fd [ORC] Fix typo in comment. 2022-01-20 10:55:31 +11:00
Mehdi Amini 4b12f4b2b1 Fix crash in MLIR opaque attribute parser
An assertion is triggered when the dialect is malformed.

Differential Revision: https://reviews.llvm.org/D117709
2022-01-19 23:35:48 +00:00
Adrian Prantl 24bc072edb Fix modules build by moving implementation into .cpp file 2022-01-19 15:33:59 -08:00
Konstantina c7b71acef2 [AMDGPU][NFC] Add autogenerated tests for vgpr-tuple-allocation.ll
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D117692
2022-01-19 15:06:16 -08:00
Richard 058d212379 [clang-tidy] Use literal block instead of code block (NFC)
I used a C++ code block in check documentation to show example
output from clang-tidy, but since the example output isn't
kosher C++, sphinx didn't like that when it went to syntax
highlight the block.  So switch to a literal block instead
and forego any highlighting.

Fixes build error
<https://lab.llvm.org/buildbot/#/builders/115/builds/21145>
2022-01-19 15:23:48 -07:00
Jonas Devlieghere 742bfb3581 [lldb] Fix LLDB_FULL_VERSION_STRING
Currently LLDB_FULL_VERSION_STRING is set to "LLDB_VERSION_STRING"
rather than the content of the CMake variable with that name.
2022-01-19 14:20:22 -08:00
Siva Chandra Reddy 75d2fcb03f [libc] Add a naming rule for global constants.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D117645
2022-01-19 22:11:16 +00:00
Jon Chesterfield ce8f365884 [openmp] Always pass valid triple to openmp-targets when using newRTL
Previously, we sometimes pass fopenmp-targets=nvptx64-nvidia-cuda-newRTL

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D117715
2022-01-19 22:07:22 +00:00
John Ericson 429a717ea5 [cmake] Move HandleOutOfTreeLLVM to common cmake utils
This is better than libunwind and libcxxabi fishing it out of libcxx's
module directory.

It is done in prepartion for a better version of D117537 which deduplicates
CMake logic instead of just renaming to avoid a name clash.

Reviewed By: phosek, #libunwind, #libc_abi, Ericson2314

Differential Revision: https://reviews.llvm.org/D117617
2022-01-19 22:05:23 +00:00
Luís Marques a767ae2c5c [RISCV] Fix incomplete asm statement parsing
For instructions without operands, the final `AsmToken::EndOfStatement`
wasn't being consumed. In the context of inline assembly, the resulting
empty statements would cause extraneous empty lines to be emitted. Fix
the issue by consuming the `EndOfStatement` token.

Differential Revision: https://reviews.llvm.org/D117565
2022-01-19 21:56:21 +00:00
Eli Friedman 86cdff0e21 [OpenMPOpt] Use SetVector to store list of kernels.
Fixes test failures on reverse-iteration buildbot.
2022-01-19 13:55:32 -08:00
Luís Marques 771613295d [docs][lli] Fix lli rst docs formatting
Differential Revision: https://reviews.llvm.org/D109092
2022-01-19 21:54:15 +00:00
Keith Smiley 3f38dc5c04 [lld-macho] Silence XAR deprecation warning
If you're building this on macOS 12.x+ this produces a deprecation
warning. I'm not sure what this means for the bitcode format going
forward, but it seems safe to silence for now.

Do we need to worry about GCC for this?

Differential Revision: https://reviews.llvm.org/D117718
2022-01-19 13:51:55 -08:00
Keith Smiley 67090e3446 [lld-macho] Implement -noall_load
This flag is the default, so in ld64 it is not implemented, but it can
be useful to negate previous -all_load arguments. Specifically if your
build system has some global linker flags, that you may want to negate
for specific links. We use something like this today to make sure some
C++ symbols are automatically discovered for all links, which passing
-all_load hides.

Differential Revision: https://reviews.llvm.org/D117629
2022-01-19 13:12:18 -08:00
Mehdi Amini e7ab36f191 Change elided large constant syntax to make it more explicit
When the printer is requested to elide large constant, we emit an opaque
attribute instead. This patch fills the dialect name with
"elided_large_const" instead of "_" to remove some user confusion when
they later try to consume it.

Differential Revision: https://reviews.llvm.org/D117711
2022-01-19 20:41:42 +00:00
Fangrui Song 5bd38a2826 [ELF] Fix split-stack caller with hidden non-split-stack callee
Fix a regression after aabe901d57 (`[ELF] Remove
one redundant computeBinding`): isLocal() does not indicate that the symbol is
originally local. For simplicity, just drop this optimization.
2022-01-19 12:25:01 -08:00