Adrian Prantl [Thu, 29 Jul 2021 22:14:22 +0000 (15:14 -0700)]
Simplify testcase to use v instead of p (NFC)
Mark Leair [Thu, 29 Jul 2021 22:03:30 +0000 (15:03 -0700)]
Fix unit test checks for the scalar cases of all/any intrinsics. I
accidentally used int64 when they should have been int32. This lead to
a Windows build unit test error (Linux did not catch the problem).
Differential Revision: https://reviews.llvm.org/D107107
David Green [Thu, 29 Jul 2021 22:00:35 +0000 (23:00 +0100)]
[ARM] Define a couple more ssub indexes. NFC
Same as
91bd3ad128f7b3b28bd98242e9a5df214eb04eea, this doesn't really
change anything but gives the registers better names than the ones
tablegen would define. And fills in the missing gaps.
Mitch Phillips [Thu, 29 Jul 2021 21:52:33 +0000 (14:52 -0700)]
[GWP-ASan] Add version header.
Adds magic version header to AllocatorState. This can be used by
out-of-process crash handlers, like Crashpad on Fuchsia, to do offline
reconstruction of GWP-ASan crash metadata.
Crashpad on Fuchsia is intending on dumping the AllocationMetadata pool
and the AllocatorState directly into the minidump. Then, using the
version number, they can unpack the data on serverside using a versioned
unpack tool.
Also add some asserts to make sure the version number gets bumped if the
internal structs get changed.
Reviewed By: eugenis, mcgrathr
Differential Revision: https://reviews.llvm.org/D106690
Yi Zhang [Sun, 25 Jul 2021 01:38:02 +0000 (21:38 -0400)]
[mlir][linalg] Fix pad tensor cast folding with changed type
`PadTensorOp` has verification logic to make sure
result dim must be static if all the padding values are static.
Cast folding might add more static information for the src operand
of `PadTensorOp` which might change a valid operation to be invalid.
Change the canonicalizing pattern to fix this.
Fangrui Song [Thu, 29 Jul 2021 21:46:53 +0000 (14:46 -0700)]
[ELF] Add -Bsymbolic-non-weak-functions
This option is a subset of -Bsymbolic-functions. It applies to STB_GLOBAL
STT_FUNC definitions.
The address of a vague linkage function (STB_WEAK STT_FUNC, e.g. an inline
function, a template instantiation) seen by a -Bsymbolic-functions linked
shared object may be different from the address seen from outside the shared
object. Such cases are uncommon. (ELF/Mach-O programs may use
`-fvisibility-inlines-hidden` to break such pointer equality. On Windows,
correct dllexport and dllimport are needed to make pointer equality work.
Windows link.exe enables /OPT:ICF by default so different inline functions may
have the same address.)
```
// a.cc -> a.o -> a.so (-Bsymbolic-functions)
inline void f() {}
void *g() { return (void *)&f; }
// b.cc -> b.o -> exe
// The address is different!
inline void f() {}
```
-Bsymbolic-non-weak-functions is a safer (C++ conforming) subset of
-Bsymbolic-functions, which can make such programs work.
Implementations usually emit a vague linkage definition in a COMDAT group. We
could detect the group (with more code) but I feel that we should just check
STB_WEAK for simplicity. A weak definition will thus serve as an escape hatch
for rare cases when users want interposition on definitions.
GNU ld feature request: https://sourceware.org/bugzilla/show_bug.cgi?id=27871
Longer write-up: https://maskray.me/blog/2021-05-16-elf-interposition-and-bsymbolic
If Linux distributions migrate to protected non-vague-linkage external linkage
functions by default, the linker option can still be handy because it allows
rapid experiment without recompilation. Protected function addresses currently
have deep issues in GNU ld.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D102570
Leonard Chan [Wed, 28 Jul 2021 18:09:22 +0000 (11:09 -0700)]
[compiler-rt][hwasan] Check for SANITIZER_POSIX before including sanitizer_posix.h
Rather than throwing an error. This way we can still use files like
hwasan_dynamic_shadow.cpp for other platforms without leading to a
preprocessor error.
Differential Revision: https://reviews.llvm.org/D106979
Alex Langford [Tue, 29 Jun 2021 23:43:37 +0000 (16:43 -0700)]
[lldb] Remove CPlusPlusLanguage from Mangled
The only remaining plugin dependency in Mangled is CPlusPlusLanguage which it
uses to extract information from C++ mangled names. The static function
GetDemangledNameWithoutArguments is written specifically for C++, so it
would make sense for this specific functionality to live in a
C++-related plugin. In order to keep this functionality in Mangled
without maintaining this dependency, I added
`Language::GetDemangledFunctionNameWithoutArguments`.
Differential Revision: https://reviews.llvm.org/D105215
Amara Emerson [Thu, 29 Jul 2021 19:18:45 +0000 (12:18 -0700)]
[GlobalISel] Use GMergeLikeOp to simplify a combine. NFC.
Lei Zhang [Thu, 29 Jul 2021 20:22:46 +0000 (16:22 -0400)]
[mlir] NFC: split MemRef to SPIR-V conversion into their own files
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D107094
Lei Zhang [Thu, 29 Jul 2021 20:21:43 +0000 (16:21 -0400)]
[mlir] NFC: split Math to SPIR-V conversion into their own files
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D107093
Lei Zhang [Thu, 29 Jul 2021 20:21:26 +0000 (16:21 -0400)]
[mlir] Fix CMake option for enabling SPIR-V CPU runner
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D107092
Omar Emara [Thu, 29 Jul 2021 20:28:22 +0000 (13:28 -0700)]
[LLDB][GUI] Add Environment Variable Field
This patch adds an environment variable field. This is usually used as
the basic type of a List field. This is needed to create the process
launch form.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D106999
Omar Emara [Thu, 29 Jul 2021 20:27:22 +0000 (13:27 -0700)]
[LLDB][GUI] Add Create Target form
This patch adds a Create Target form for the LLDB GUI. Additionally, an
Arch Field was introduced to input an arch and the file and directory
fields now have a required property.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D106192
Alexander Yermolovich [Thu, 29 Jul 2021 20:14:10 +0000 (13:14 -0700)]
[DWARF] Refactor test to remove relocations for DWO
The way this test generates object file results in relocation sections for .dwo sections. This is not legal. Re-wrote it to avoid those relocation sections.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D107012
Mark Leair [Thu, 29 Jul 2021 20:05:08 +0000 (13:05 -0700)]
Fix runtime internal error with certain intrinsics that can take a scalar
result descriptor (e.g., maxloc, minloc, maxval, minval, all, any, count,
parity, findloc, etc.)
Also add a scalar case for these intrinsic unit tests.
Differential Revision: https://reviews.llvm.org/D106820
Andy Kaylor [Thu, 29 Jul 2021 18:42:06 +0000 (11:42 -0700)]
Fixing an infinite loop problem in InstCombine
Patch by Mohammad Fawaz
This issues started happening after
https://github.com/llvm/llvm-project/commit/
b373b5990d5991a920c421b21a352e4ccf4c4993
Basically, if the memcpy is volatile, the collectUsers() function should
return false, just like we do for volatile loads.
Differential Revision: https://reviews.llvm.org/D106950
Anjan Kumar [Thu, 29 Jul 2021 19:40:25 +0000 (19:40 +0000)]
Revert "[AIX] Pass the -b option to linker on AIX"
This reverts commit
109954410c34434a181f5eb48cbd14f4122101c7.
Christopher Di Bella [Tue, 27 Jul 2021 15:36:03 +0000 (15:36 +0000)]
Revert "Revert "[clang][pp] adds '#pragma include_instead'""
Includes regression test for problem noted by @hans.
This reverts commit
973de7185606a21fd5e9d5e8c014fbf898c0e72f.
Differential Revision: https://reviews.llvm.org/D106898
Terry Wilmarth [Thu, 15 Jul 2021 15:28:47 +0000 (10:28 -0500)]
[OpenMP] libomp: Add new experimental barrier: two-level distributed barrier
Two-level distributed barrier is a new experimental barrier designed
for Intel hardware that has better performance in some cases than the
default hyper barrier.
This barrier is designed to handle fine granularity parallelism where
barriers are used frequently with little compute and memory access
between barriers. There is no need to use it for codes with few
barriers and large granularity compute, or memory intensive
applications, as little difference will be seen between this barrier
and the default hyper barrier. This barrier is designed to work
optimally with a fixed number of threads, and has a significant setup
time, so should NOT be used in situations where the number of threads
in a team is varied frequently.
The two-level distributed barrier is off by default -- hyper barrier
is used by default. To use this barrier, you must set all barrier
patterns to use this type, because it will not work with other barrier
patterns. Thus, to turn it on, the following settings are required:
KMP_FORKJOIN_BARRIER_PATTERN=dist,dist
KMP_PLAIN_BARRIER_PATTERN=dist,dist
KMP_REDUCTION_BARRIER_PATTERN=dist,dist
Branching factors (set with KMP_FORKJOIN_BARRIER, KMP_PLAIN_BARRIER,
and KMP_REDUCTION_BARRIER) are ignored by the two-level distributed
barrier.
Patch fixed for ITTNotify disabled builds and non-x86 builds
Co-authored-by: Jonathan Peyton <jonathan.l.peyton@intel.com>
Co-authored-by: Vladislav Vinogradov <vlad.vinogradov@intel.com>
Differential Revision: https://reviews.llvm.org/D103121
Sander de Smalen [Thu, 29 Jul 2021 16:34:01 +0000 (17:34 +0100)]
[InstSimplify] Don't assume parent function when simplifying llvm.vscale.
D106850 introduced a simplification for llvm.vscale by looking at the
surrounding function's vscale_range attributes. The call that's being
simplified may not yet have been inserted into the IR. This happens for
example during function cloning.
This patch fixes the issue by checking if the instruction is in a
parent basic block.
Stella Laurenzo [Thu, 29 Jul 2021 19:06:22 +0000 (19:06 +0000)]
[MLIR][python] Export CAPI headers.
* Adds source targets (not included in the full set that downstreams use by default) to bundle mlir-c/ headers into the mlir/_mlir_libs/include directory.
* Adds a minimal entry point to get include and library directories.
* Used by npcomp to export a full CAPI (which is then used by the Torch extension to link npcomp).
Reviewed By: mikeurbach
Differential Revision: https://reviews.llvm.org/D107090
Amara Emerson [Thu, 29 Jul 2021 19:03:34 +0000 (12:03 -0700)]
[GlobalISel] Add GPtrAdd and use it in some combines.
bakhtiyar [Thu, 29 Jul 2021 18:47:08 +0000 (11:47 -0700)]
Refactor AsyncToAsyncRuntime pass to boost understandability.
Depends On D106730
Reviewed By: ezhulenev
Differential Revision: https://reviews.llvm.org/D106731
Frederic Cambus [Tue, 27 Jul 2021 12:36:13 +0000 (14:36 +0200)]
[clang] Fix a typo in the manual page: s/contraint/constraint.
While there, update hardcoded Clang version from 3.5 to 13.
Differential Revision: https://reviews.llvm.org/D106867
Frederic Cambus [Fri, 23 Jul 2021 13:34:03 +0000 (15:34 +0200)]
[clang] Fix typos in Options.td and regen ClangCommandLineReference.rst.
Differential Revision: https://reviews.llvm.org/D106664
Ahmed S. Taei [Wed, 28 Jul 2021 00:35:22 +0000 (00:35 +0000)]
Rorder mmt4d iteration domain
Move tile iterators to outer most dim
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D107003
Vy Nguyen [Thu, 29 Jul 2021 05:07:22 +0000 (01:07 -0400)]
[lld-macho] Change personalities entry type to Ptr to avoid overflowing uint32
PR51262
Differential Revision: https://reviews.llvm.org/D107035
Alexey Bataev [Thu, 29 Jul 2021 18:19:56 +0000 (11:19 -0700)]
[SLP][NFC]Add a test for split loads, NFC.
Louis Dionne [Thu, 29 Jul 2021 18:17:04 +0000 (14:17 -0400)]
[libc++][NFC] Make private header generation CMake comment more consistent
Anjan Kumar [Thu, 29 Jul 2021 18:14:41 +0000 (18:14 +0000)]
[AIX] Pass the -b option to linker on AIX
Parse the -b option in the driver and pass it to the linker if the target OS is AIX. This will establish compatibility with the other AIX compilers.
Reviewed By: Zarko Todorovski
Differential Revision: https://reviews.llvm.org/D106688
Stella Stamenova [Thu, 29 Jul 2021 17:48:57 +0000 (10:48 -0700)]
Revert "[lldb] Assert filecache and live memory match on debug under a setting"
This reverts commit
77e9d10f0fbfe04a14e6ce61753376dd78e0c2f0.
This change broke the Windows LLDB bot:
https://lab.llvm.org/buildbot/#/builders/83/builds/8784/steps/7/logs/stdio
Chris Bieneman [Thu, 29 Jul 2021 17:45:56 +0000 (12:45 -0500)]
Fixing broken docs build
Need an empty line after the code-block directive.
Chris Bieneman [Sat, 24 Jul 2021 00:43:45 +0000 (19:43 -0500)]
Support macro deprecation #pragma clang deprecated
This patch adds `#pragma clang deprecated` to enable deprecation of
preprocessor macros.
The macro must be defined before `#pragma clang deprecated`. When
deprecating a macro a custom message may be optionally provided.
Warnings are emitted at the use site of a deprecated macro, and can be
controlled via the `-Wdeprecated` warning group.
This patch takes some rough inspiration and a few lines of code from
https://reviews.llvm.org/D67935.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106732
Arthur Eubanks [Thu, 29 Jul 2021 17:37:28 +0000 (10:37 -0700)]
[gn build] Manually add file
Since bot is broken
Alfonso Gregory [Thu, 29 Jul 2021 17:10:37 +0000 (10:10 -0700)]
[Support] Remove LLVM_ATTRIBUTE_NORETURN
Code should use C++11 [[noreturn]] or C11 _Noreturn instead.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D106899
Fangrui Song [Thu, 29 Jul 2021 16:59:44 +0000 (09:59 -0700)]
Replace LLVM_ATTRIBUTE_NORETURN with C++11 [[noreturn]]. NFC
[[noreturn]] can be used since Oct 2016 when the minimum compiler requirement was bumped to GCC 4.8/MSVC 2015.
Fangrui Song [Thu, 29 Jul 2021 16:57:10 +0000 (09:57 -0700)]
[lldb] Fix FunctionDecl::Create after D102343
Melanie Blower [Thu, 29 Jul 2021 16:41:48 +0000 (12:41 -0400)]
[clang][patch] Remove erroneous run line committed in D102343
Dawid Jurczak [Mon, 5 Jul 2021 09:42:17 +0000 (11:42 +0200)]
[DSE] Transform memset + malloc --> calloc (PR25892)
After this change DSE can eliminate malloc + memset and emit calloc.
It's https://reviews.llvm.org/D101440 follow-up.
Differential Revision: https://reviews.llvm.org/D103009
Melanie Blower [Thu, 29 Jul 2021 16:02:20 +0000 (12:02 -0400)]
[clang][patch][FPEnv] Make initialization of C++ globals strictfp aware
@kpn pointed out that the global variable initialization functions didn't
have the "strictfp" metadata set correctly, and @rjmccall said that there
was buggy code in SetFPModel and StartFunction, this patch is to solve
those problems. When Sema creates a FunctionDecl, it sets the
FunctionDeclBits.UsesFPIntrin to "true" if the lexical FP settings
(i.e. a combination of command line options and #pragma float_control
settings) correspond to ConstrainedFP mode. That bit is used when CodeGen
starts codegen for a llvm function, and it translates into the
"strictfp" function attribute. See bugs.llvm.org/show_bug.cgi?id=44571
Reviewed By: Aaron Ballman
Differential Revision: https://reviews.llvm.org/D102343
Joachim Protze [Thu, 29 Jul 2021 15:54:01 +0000 (17:54 +0200)]
[OpenMP][Tools][Tests][NFC] Address flaky archer tests
Adding more concurrent threads significantly increases the
chance that the data race can be observed during testing.
Jessica Clarke [Thu, 29 Jul 2021 15:53:27 +0000 (16:53 +0100)]
Handle subregs and superregs in callee-saved register mask
If a target lists both a subreg and a superreg in a callee-saved
register mask, the prolog will spill both aliasing registers. Instead,
don't spill the subreg if a superreg is being spilled. This case is hit by the
PowerPC SPE code, as well as a modified RISC-V backend for CHERI I maintain out
of tree.
Reviewed By: jhibbits
Differential Revision: https://reviews.llvm.org/D73170
bakhtiyar [Wed, 28 Jul 2021 22:25:00 +0000 (15:25 -0700)]
Add an escape-hatch for conversion of funcs with blocking awaits to coroutines.
Currently TFRT does not support top-level coroutines, so this functionality will allow to have a single blocking await at the top level until TFRT implements the necessary functionality.
Reviewed By: ezhulenev
Differential Revision: https://reviews.llvm.org/D106730
Tobias Gysi [Thu, 29 Jul 2021 15:03:36 +0000 (15:03 +0000)]
[mlir][linalg] Format bufferization debug print outs (NFC).
Change the formatting of the debug print outs to elide unnecessary information.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D106661
Dmitry Vyukov [Thu, 29 Jul 2021 11:50:29 +0000 (13:50 +0200)]
tsan: introduce LazyInitialize
We call non-inlinable Initialize from all interceptors/syscalls,
but most of the time runtime is already initialized and this just
introduces unnecessary overhead.
Add LazyInitialize that (1) inlinable, (2) does nothing if
.preinit_array is enabled (expected case on Linux).
Depends on D107071.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107072
Dmitry Vyukov [Thu, 29 Jul 2021 11:33:07 +0000 (13:33 +0200)]
tsan: s/CHECK/DCHECK/ in tsan_interface_java.cpp
We are very paranoid with CHECKs in all Java entry points.
These CHECKs were added along with Java support.
At that point it wasn't clear what exactly to expect from JVM part
and if JVM part is correct or not. Thus CHECK paranoia.
These CHECKs never fired in practice, but we pay runtime cost
in every entry point all the time.
Replace CHECKs with DCHECKs.
Depends on D107069.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107071
Dmitry Vyukov [Thu, 29 Jul 2021 11:30:16 +0000 (13:30 +0200)]
tsan: restore Initialize call in Java entry points
We used to call Initialize in every Java point.
That was removed in
6563bb53b5 ("tsan: don't use caller/current PC in Java interfaces").
The intention was to add a single Initialize to __tsan_java_init instead.
Do that.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107069
Jez Ng [Thu, 29 Jul 2021 15:05:14 +0000 (11:05 -0400)]
[lld-macho][nfc] Simplify common-symbol-coalescing test
Jez Ng [Thu, 29 Jul 2021 15:06:40 +0000 (11:06 -0400)]
[lld-macho] Support common symbols in bitcode (but differently from ld64)
ld64 seems to handle common symbols in bitcode rather
bizarrely. They follow entirely different precedence rules from their
non-bitcode counterparts. I initially tried to emulate ld64 in D106597,
but I'm not sure the extra complexity is worth it, especially given that
common symbols are not, well, very common.
This diff accords common bitcode symbols the same precedence as regular
common symbols, just as we treat all other pairs of bitcode and
non-bitcode symbol types. The tests document ld64's behavior in detail,
just in case we want to revisit this.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D107027
Dmitry Vyukov [Thu, 29 Jul 2021 09:12:40 +0000 (11:12 +0200)]
tsan: add intrusive doubly-linked list
Add intrusive doubly-linked list container template, IList.
It will be used in the new tsan runtime.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107050
Rosie Sumpter [Thu, 29 Jul 2021 14:50:30 +0000 (15:50 +0100)]
Revert "[LoopFlatten] Fix missed LoopFlatten opportunity"
This reverts commit
2df8bf9339e43de63d8d28e07182e1d6d7ffb843.
Reverting because it causes an assertion failure.
Kai Luo [Thu, 29 Jul 2021 14:48:30 +0000 (14:48 +0000)]
[PowerPC] Fix return type of XL compat CAS
`__compare_and_swap*` should return `i32` rather than `i1`.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D107077
Dmitry Vyukov [Thu, 29 Jul 2021 10:54:34 +0000 (12:54 +0200)]
tsan: add another test for atomics
Add a test where atomic-release happens while
another thread spins calling load-acquire.
This can expose some interesting interleavings
of release and acquire.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107055
Guillaume Chatelet [Fri, 23 Jul 2021 09:28:51 +0000 (09:28 +0000)]
[libc] rewrite aarch64 memcmp implementation
This patch is simply rearranging the code layout so it's easier to understand.
Differential Revision: https://reviews.llvm.org/D106641
Kim-Anh Tran [Thu, 29 Jul 2021 13:30:25 +0000 (15:30 +0200)]
[DWARF5] Only fallback to manual index if no entry was found
If we succeed at gathering global variables for a compile
unit, there is no need to fallback to generating a manual index.
Reviewed By: jankratochvil
Differential Revision: https://reviews.llvm.org/D106355
Kazu Hirata [Thu, 29 Jul 2021 14:14:37 +0000 (07:14 -0700)]
[CodeGen] Remove getPseudoProbeAttribute and addPseudoProbeAttribute (NFC)
The last uses of these functions were removed on Jun 17, 2021 in
commit
bd52495518808bdbf24f4d8e9e20774d6d2e3333.
Jessica Clarke [Thu, 29 Jul 2021 14:13:58 +0000 (15:13 +0100)]
[ELF] Align the first section of a PT_TLS even if its type is SHT_NOBITS
This is somewhat of a repeat of D66658 but for sections in PT_TLS
segments. Although such sections don't need to be aligned such that
address and offset are congruent modulo the page size, they do need
to be congruent modulo the segment alignment, otherwise the
whole PT_TLS will be unaligned. We therefore use the normal calculation
to determine the section's address within the PT_LOAD rather than
bailing out early due to being SHT_NOBITS.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D106987
Jessica Clarke [Thu, 29 Jul 2021 14:13:51 +0000 (15:13 +0100)]
[ELF] Add two new tests showing broken .tbss alignment if first in PT_TLS
This is a similar problem to D66658, where we are too aggressive in not
aligning NOBITS sections, and the tests are based on the ones added for
that fix. If a .tbss section is first in a PT_TLS segment (i.e. there is
no .tdata section) then, although it doesn't need to be aligned such
that address and offset are congruent modulo the page size, they do need
to be congruent modulo the segment alignment, otherwise the whole PT_TLS
will be unaligned.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D106986
Jamie Schmeiser [Thu, 29 Jul 2021 13:59:24 +0000 (09:59 -0400)]
Set TargetCPUName for AIX to default to pwr7.
Summary:
Set the TargetCPUName for AIX to default to pwr7, removing the setting
of it based on the major/minor of the OS version, which previously
set it to pwr4 for AIX 7.1 and earlier. The old code would also set it to
pwr4 when the OS version was not specified and with the change, it will
default it to pwr7 in all cases.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By:hubert.reinterpretcast (Hubert Tong)
Differential Revision: https://reviews.llvm.org/D107063
Jon Chesterfield [Thu, 29 Jul 2021 13:42:32 +0000 (14:42 +0100)]
[libomptarget][amdgpu] Update printed plugin name
Augusto Noronha [Tue, 27 Jul 2021 12:22:12 +0000 (09:22 -0300)]
[lldb] Assert filecache and live memory match on debug under a setting
Sanjay Patel [Thu, 29 Jul 2021 12:47:15 +0000 (08:47 -0400)]
[DAGCombiner] don't try to partially reduce add-with-overflow ops
This transform was added with D58874, but there were no tests for overflow ops.
We need to change this one way or another because it can crash as shown in:
https://llvm.org/PR51238
Note that if there are no uses of an overflow op's bool overflow result, we
reduce it to a regular math op, so we continue to fold that case either way.
If we have uses of both the math and the overflow bool, then we are likely
not saving anything by creating an independent sub instruction as seen in
the test diffs here.
This patch makes the behavior in SDAG consistent with what we do in
instcombine AFAICT.
Differential Revision: https://reviews.llvm.org/D106983
Stefan Gränitz [Mon, 28 Jun 2021 14:58:58 +0000 (16:58 +0200)]
[Orc][examples] Adopt ExecutorProcessControl API and re-enable LLJITWithRemoteDebugging
The API change originated from D104694. The LLJITWithRemoteDebugging example and the test for it were disabled while it was in the works.
Sanjay Patel [Wed, 28 Jul 2021 18:53:47 +0000 (14:53 -0400)]
[AArch64][x86] add tests for add-with-overflow folds; NFC
There's a generic combine for these, but no test coverage.
It's not clear if this is actually a good fold.
The combine was added with D58874, but it has a bug that
can cause crashing ( https://llvm.org/PR51238 ).
Andrew Savonichev [Wed, 9 Jun 2021 09:27:34 +0000 (12:27 +0300)]
[MCA] Use LSU for the in-order pipeline
Load/Store unit is used to enforce order of loads and stores if they
alias (controlled by --noalias=false option).
Fixes PR50483 - [MCA] In-order pipeline doesn't track memory
load/store dependencies.
Differential Revision: https://reviews.llvm.org/D103955
Bradley Smith [Tue, 27 Jul 2021 13:45:58 +0000 (13:45 +0000)]
[AArch64][SVE] Fix incorrect mask type when lowering fixed type SVE gather/scatter
An incorrect mask type when lowering an SVE gather/scatter was causing
a codegen fault which manifested as the incorrect predicate size being
used for an SVE gather/scatter, (e.g.. p0.b rather than p0.d).
Fixes PR51182.
Differential Revision: https://reviews.llvm.org/D106943
Sebastian Neubauer [Thu, 29 Jul 2021 10:55:34 +0000 (12:55 +0200)]
[Utils] Do not remove comments in llc test script
When checking if two prefixes can be merged for a function,
update_llc_test_checks.py removed IR comments before comparing
llc outputs of different RUN lines.
This means, if one RUN line emited lines starting with ';' and another
RUN line emited the same lines except the ones starting with ';', both
RUNs would be merged (if they share a prefix).
However, CHECK-NEXT lines check the comments, otherwise they fail, so
the script should not merge RUNs if they contain different comments.
Differential Revision: https://reviews.llvm.org/D101312
Jesse Towner [Thu, 29 Jul 2021 11:01:19 +0000 (07:01 -0400)]
bugprone-forwarding-reference-overload: support non-type template parameters
Many concepts emulation libraries, such as the one found in Range v3, tend to
use non-type template parameters for the enable_if type expression, due to
their versatility in template functions and constructors containing variadic
template parameter packs.
Unfortunately the bugprone-forwarding-reference-overload check does not
handle non-type template parameters, as was first noted in this bug report:
https://bugs.llvm.org/show_bug.cgi?id=38081
This patch fixes this long standing issue and allows for the check to be suppressed
with the use of a non-type template parameter containing enable_if or enable_if_t in
the type expression, so long as it has a default literal value.
Jeremy Morse [Thu, 29 Jul 2021 10:45:50 +0000 (11:45 +0100)]
Follow-up to D105207, only salvage affine SCEVs to avoid a crash
SCEVToIterCountExpr only expects to be fed affine expressions, but
DbgRewriteSalvageableDVIs is feeding it non-affine induction variables.
Following this up with an obvious fix, will add test coverage too if
this avoids D105207 being reverted.
Dmitry Vyukov [Thu, 29 Jul 2021 08:26:50 +0000 (10:26 +0200)]
tsan: store ThreadRegistry in Context by value
It's unclear why we allocate ThreadRegistry separately,
I assume it's some historical leftover.
Embed ThreadRegistry into Context.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107045
Dmitry Vyukov [Thu, 29 Jul 2021 07:44:48 +0000 (09:44 +0200)]
sanitizer_common: remove BlockingMutex and RWMutex
Remove the legacy typedefs and use Mutex/Lock types directly.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107043
Dmitry Vyukov [Thu, 29 Jul 2021 10:01:52 +0000 (12:01 +0200)]
tsan: rename deadlock detector Mutex to UserMutex
It conflicts with sanitizer_common Mutex.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D107053
Andrzej Warzynski [Tue, 27 Jul 2021 13:09:56 +0000 (14:09 +0100)]
[flang][driver] Forward `-fopenmp`/`-fopenacc` to the host compiler
This patch only modifies `flang` - the bash wrapper script.
`-fopenmp`/`-fopenacc` are required to enable the OpenMP/OpenACC
extension in the frontend and to make sure that the required libraries
are linked when generating the final binary. This patch makes sure that
`-fopnemp`/`-fopenacc` is used for both unparsing and the code
generation (via the host compiler).
Differential Revision: https://reviews.llvm.org/D106871
Cullen Rhodes [Thu, 29 Jul 2021 09:49:08 +0000 (09:49 +0000)]
[AArch64][AsmParser] NFC: Parser.getTok() -> getTok()
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D106949
Amara Emerson [Thu, 29 Jul 2021 09:07:27 +0000 (02:07 -0700)]
[AArch64][GlobalISel] More widenToNextPow2 changes, this time for arithmetic/bitwise ops.
Kirill Bobyrev [Thu, 29 Jul 2021 09:37:10 +0000 (11:37 +0200)]
NFC: Change quotes from Unicode to ASCII
This was causing some problems for Python scripts that we have.
Context: https://reviews.llvm.org/D106792
David Spickett [Mon, 12 Apr 2021 14:40:32 +0000 (15:40 +0100)]
[lldb][AArch64] Annotate synchronous tag faults
In the latest Linux kernels synchronous tag faults
include the tag bits in their address.
This change adds logical and allocation tags to the
description of synchronous tag faults.
(asynchronous faults have no address)
Process 1626 stopped
* thread #1, name = 'a.out', stop reason = signal SIGSEGV: sync tag check fault (fault address: 0x900fffff7ff9010 logical tag: 0x9 allocation tag: 0x0)
This extends the existing description and will
show as much as it can on the rare occasion something
fails.
This change supports AArch64 MTE only but other
architectures could be added by extending the
switch at the start of AnnotateSyncTagCheckFault.
The rest of the function is generic code.
Tests have been added for synchronous and asynchronous
MTE faults.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D105178
Mirko Brkusanin [Wed, 28 Jul 2021 16:23:50 +0000 (18:23 +0200)]
[AMDGPU][GlobalISel] Insert an and with exec before s_cbranch_vccnz if necessary
While v_cmp will AND inactive lanes with 0, that is not the case for logical
operations.
This fixes a Vulkan CTS test that would hang otherwise.
Differential Revision: https://reviews.llvm.org/D105709
Benjamin Kramer [Thu, 29 Jul 2021 09:10:07 +0000 (11:10 +0200)]
[mlir] Put back virtual ~ConversionTarget(), some users started relying on it
Benjamin Kramer [Mon, 26 Jul 2021 11:37:41 +0000 (13:37 +0200)]
[mlir] Remove the default isDynamicallyLegal hook
This is redundant with the callback variant and untested. Also remove
the callback-less methods for adding a dynamically legal op, as they
are no longer useful.
Differential Revision: https://reviews.llvm.org/D106786
Tomasz Kamiński [Thu, 29 Jul 2021 08:55:24 +0000 (10:55 +0200)]
Fix FindZ3.cmake to support static libraries and Windows
Use absolute path to link z3 to allow builds both on windows and linux
since the library name is platform dependent for Z3 (libz3 on Windows
and z3 on Linux) and MSVC does not recognized -L and -l options.
Fix CMAKE_CROSSCOMPILING that does not work correctly since it uses
Z3_BUILD_VERSION instead of Z3_BUILD_NUMBER
Fix building with the static version of z3 library (supersedes D80227).
- Build the Z3 version detection code as C++, since the static
library brings in libstdc++ symbols
- Detect threading support and link against threading, in the
(likely) case Z3 was built with threads
Exposed compilation error from building a program that is used to detect
z3 version in the warning message, to simplify troubleshooting.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D106131
Rosie Sumpter [Fri, 2 Jul 2021 09:52:35 +0000 (10:52 +0100)]
[LoopFlatten] Fix missed LoopFlatten opportunity
When the trip count of the inner loop is a constant, the InstCombine
pass now causes the transformation e.g. imcp ult i32 %inc, tripcount ->
icmp ult %j, tripcount-step (where %j is the inner loop induction
variable and %inc is add %j, step), which is now accounted for when
identifying the trip count of the loop. This is also an acceptable use
of %j (provided the step is 1) so is ignored as long as the compare
that it's used in is also the condition of the inner branch.
Differential Revision: https://reviews.llvm.org/D105802
Fraser Cormack [Wed, 28 Jul 2021 14:20:49 +0000 (15:20 +0100)]
[RISCV] Optimize floating-point "dominant value" BUILD_VECTORs
This patch aims to improve the performance of BUILD_VECTORs which are
identified as containing a dominant element. Given that most
floating-point constants themselves require a load from the constant
pool, it was possible for the optimization to actually increase the
number of individual loads on small vectors. The exception is the zero
constant -- +0.0 -- which can be materialized efficiently.
While this optimization could do with a proper cost model to weigh the
benfits of a single vector load vs. the manipulation of individual
elements -- even for integer vectors which often require several
instructions to materialize -- without a concrete RVV implementation to
work with any heuristic is likely to be both more obtuse and inaccurate.
Until then, this patch fixes at least one known obvious deficiency.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D106963
Fraser Cormack [Wed, 28 Jul 2021 14:14:39 +0000 (15:14 +0100)]
[RISCV] Add test case showing suboptimal BUILD_VECTOR lowering
The second test case added here was pointed out to me by @craig.topper
and shows how we "optimize" a two-element BUILD_VECTOR from being one
load from the constant pool to two loads from the constant pool.
The first test case shows that since materialization for the
floating-point +0.0 value is cheap and doesn't involve a load, the
optimization is more clearly beneficial here.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D106962
Diana Picus [Wed, 28 Jul 2021 09:15:58 +0000 (11:15 +0200)]
test-release.sh: Kill python2
Don't prefer python2's virtualenv when setting up the test-suite.
Always use python3 instead, since that's what we support everywhere else
anyway.
Differential Revision: https://reviews.llvm.org/D106941
Björn Schäpers [Sun, 25 Jul 2021 20:42:25 +0000 (22:42 +0200)]
[clang-format] Fix aligning with linebreaks #2
This amends
c5243c63cda3c740d6e9c7e501f6518c21688da3 to fix formatting
continued function calls with BinPacking = false.
Differential Revision: https://reviews.llvm.org/D106773
Mark de Wever [Thu, 29 Jul 2021 05:54:48 +0000 (07:54 +0200)]
[libcxx][doc] Update the build documentation.
These are the hunks of
D106770 [libc++][doc] Update the release notes
that are relevant for main.
Jun Ma [Thu, 29 Jul 2021 05:23:02 +0000 (13:23 +0800)]
[NFC][InstSimplify] Use more intuitive variable names.
Dmitry Vyukov [Wed, 28 Jul 2021 11:40:21 +0000 (13:40 +0200)]
tsan: switch from SSE3 to SSE4.2
Switch x86_64 requirement for optimized code from SSE3 to SSE4.2.
The new tsan runtime will need few instructions that are only
supported by SSE4:
_mm_max_epu32
_mm_extract_epi8
_mm_insert_epi32
SSE3 was introcued in 2004 and SSE4 in 2006:
https://en.wikipedia.org/wiki/SSE3
https://en.wikipedia.org/wiki/SSE4
We are still providing non-optimized C++ version of the code,
so either way it's possible to build tsan runtime for any CPU.
But for Go this will bump strict requirement for -race because
Go contains prebuilt versions and these will be built with -msse4.2.
But requiring a CPU produced at least in 2006 looks reasonable for
a debugging tool (more reasonable than disabling optimizations
for everybody).
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D106948
Dmitry Vyukov [Wed, 28 Jul 2021 18:38:53 +0000 (20:38 +0200)]
tsan: remove /**/ at the of multi-line macros
Prefer code readability over writeability.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D106982
Dmitry Vyukov [Thu, 29 Jul 2021 05:44:13 +0000 (07:44 +0200)]
tsan: fix java_symbolization test
We reliably remove bottom libc-guts frames only on linux/glibc.
Some bots failed on this test showing other bottom frames:
.annobin_libc_start.c libc-start.c (libc.so.6+0x249f4)
generic_start_main.isra.0 libc-start.c (libc.so.6+0x45b0c)
We can't reliably remove all of possible bottom frames.
So remove the assertion for that.
Differential Revision: https://reviews.llvm.org/D107037
Arthur O'Dwyer [Thu, 29 Jul 2021 05:34:31 +0000 (01:34 -0400)]
[libc++] Remove excess whitespace in synopsis comment. NFCI.
Freddy Ye [Thu, 29 Jul 2021 05:27:40 +0000 (13:27 +0800)]
[NFC][X86] add missing tests in clang/test/CodeGen/attr-target-mv.c
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D106849
Mehdi Amini [Thu, 29 Jul 2021 05:01:04 +0000 (05:01 +0000)]
Implement recursive support into OperationEquivalence::isEquivalentTo()
This allows to use OperationEquivalence to track structural comparison for equality
between two operations.
Differential Revision: https://reviews.llvm.org/D106422
Mehdi Amini [Thu, 29 Jul 2021 04:58:25 +0000 (04:58 +0000)]
Add `all_of_zip` to STLExtras
This takes two ranges and invokes a predicate on the element-wise pair in the
ranges. It returns true if all the pairs are matching the predicate and the ranges
have the same size.
It is useful with containers that aren't random iterator where we can't check the
sizes in O(1).
Differential Revision: https://reviews.llvm.org/D106605
Nathan Chancellor [Thu, 29 Jul 2021 04:56:23 +0000 (21:56 -0700)]
[test] Fix tools/gold/X86/comdat-nodeduplicate.ll on non-X86 hosts
When running this test on an aarch64 machine, it fails:
```
/usr/bin/ld.gold: error: .../test/tools/gold/X86/Output/comdat-nodeduplicate.ll.tmp/ab.lto.o: incompatible target
```
Specify the elf_x86_64 emulation as all of the other gold plugin tests
do.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D107020
Alfonso Gregory [Thu, 29 Jul 2021 04:40:47 +0000 (04:40 +0000)]
[libc][NFC] Add noreturn and constexpr qualifiers where appropriate
These functions make it clear to the compiler and user what the intended
behavior is so llvm can make them go as fast as possible.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D106807
Tom Stellard [Thu, 29 Jul 2021 04:06:14 +0000 (21:06 -0700)]
libcang: Add missing function to libclang.map
This function is marked with CINDEX_LINKAGE, but was never added to the
export list / linker script.
Reviewed By: jrtc27
Differential Revision: https://reviews.llvm.org/D106974
Michael Kruse [Thu, 29 Jul 2021 03:01:14 +0000 (22:01 -0500)]
[Preprocessor] -E -P: Ensure newline after 8 skipped lines.
The implementation of -fminimize-whitespace (D104601) revised the logic
when to emit newlines. There was no case to handle when more than
8 lines were skippped in -P (DisableLineMarkers) mode and instead fell
through the case intended for -fminimize-whitespace, i.e. emit nothing.
This patch will emit one newline in this case.
The newline logic is slightly reorganized. The `-P -fminimize-whitespace`
case is handled explicitly and emitting at least one newline is the new
fallback case. The choice between emitting a line marker or up to
7 empty lines is now a choice only with enabled line markers. The up to
8 newlines likely are fewer characters than a line directive, but
in -P mode this had the paradoxic effect that it would print up to
7 empty lines, but none at all if more than 8 lines had to be skipped.
Now with DisableLineMarkers, we don't consider printing empty lines
(just start a new line) which matches gcc's behavior.
The line-directive-output-mincol.c test is replaced with a more
comprehensive test skip-empty-lines.c also testing the more than
8 skipped lines behaviour with all flag combinations.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106924