Geoffrey Martin-Noble [Thu, 29 Jul 2021 01:39:51 +0000 (18:39 -0700)]
[Bazel] Derive targets from file presence as in CMake build
This makes the logic used to determine if targets have the given
features the same as is used in CMake. Incidentally, it enables these
features for the targets added in https://reviews.llvm.org/D106921
which were missing because this was previously a hardcoded list.
Reviewed By: chandlerc
Differential Revision: https://reviews.llvm.org/D107019
Mark Schimmel [Fri, 30 Jul 2021 00:51:47 +0000 (17:51 -0700)]
[ARC] Add norm/normh instructions with disassembly tests
Add disassembler support for the NORM and NORMH instructions. These instructions
only exist when the ARC processor is configured with the "norm" extension.
fferential Revision: https://reviews.llvm.org/D107118
Stella Laurenzo [Thu, 29 Jul 2021 22:23:32 +0000 (22:23 +0000)]
[MLIR][python] Disable SONAME on extensions.
* Broken out of https://reviews.llvm.org/D106419
* Otherwise, same named modules will conflict with each other.
Differential Revision: https://reviews.llvm.org/D107113
Ben Shi [Thu, 29 Jul 2021 12:39:54 +0000 (20:39 +0800)]
Optimize mul in the zba extension with SH*ADD
This patch does the following optimization of mul with a constant.
(mul x, 11) -> (SH1ADD (SH2ADD x, x), x)
(mul x, 19) -> (SH1ADD (SH3ADD x, x), x)
(mul x, 13) -> (SH2ADD (SH1ADD x, x), x)
(mul x, 21) -> (SH2ADD (SH2ADD x, x), x)
(mul x, 37) -> (SH2ADD (SH3ADD x, x), x)
(mul x, 25) -> (SH3ADD (SH1ADD x, x), x)
(mul x, 41) -> (SH3ADD (SH2ADD x, x), x)
(mul x, 73) -> (SH3ADD (SH3ADD x, x), x)
(mul x, 27) -> (SH1ADD (SH3ADD x, x), (SH3ADD x, x))
(mul x, 45) -> (SH2ADD (SH3ADD x, x), (SH3ADD x, x))
(mul x, 81) -> (SH3ADD (SH3ADD x, x), (SH3ADD x, x))
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D107065
Ben Shi [Thu, 29 Jul 2021 11:48:09 +0000 (19:48 +0800)]
[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D107064
Matt Jacobson [Fri, 30 Jul 2021 00:22:53 +0000 (08:22 +0800)]
[AVR][clang] Pass '--start-group' and '--end-group' options to avr-ld
Reviewed By: Ben Shi
Differential Revision: https://reviews.llvm.org/D106854
Amara Emerson [Fri, 30 Jul 2021 00:07:19 +0000 (17:07 -0700)]
[GlobalISel] Refactor the unmerge artifact value finder code.
I moved the code that tries to combine away each unmerge def into a method in
ArtifactValueFinder class itself. This removes a logically messy lambda and
makes it easier to use the value-finder in more places in future.
Shoaib Meenai [Thu, 29 Jul 2021 23:46:38 +0000 (16:46 -0700)]
[compiler-rt] Fix COMPILER_RT_OS_DIR for Android
Android has its own CMAKE_SYSTEM_NAME, but the OS is Linux (Android
target triples look like aarch64-none-linux-android21). The driver will
therefore search for compiler-rt libraries in the "linux" directory and
not the "android" directory, so the default placement of Android
compiler-rt libraries was incorrect. You could fix it by specifying
COMPILER_RT_OS_DIR manually, but it also makes sense to fix the default,
to save others from having to discover and fix the issue for themselves.
Thomas Johnson [Thu, 29 Jul 2021 22:25:48 +0000 (22:25 +0000)]
[ARC] Add additional mov immediate instruction formats with a fix for u6 decoding
Differential Revision: https://reviews.llvm.org/D107088
Joseph Huber [Thu, 29 Jul 2021 19:27:58 +0000 (15:27 -0400)]
[OpenMP] Adding flags for disabling the following optimizations: Deglobalization SPMDization State machine rewrites Folding
This work provides four flags to disable four different sets of OpenMP optimizations. These flags take effect in llvm/lib/Transforms/IPO/OpenMPOpt.cpp and include the following:
- openmp-opt-disable-deglobalization: Defaults to false, adding this flag sets the variable DisableOpenMPOptDeglobalization to true. This prevents AA registration for HeapToStack and HeapToShared.
- openmp-opt-disable-spmdization: Defaults to false, adding this flag sets the variable DisableOpenMPOptSPMDization to true. This indicates a pessimistic fixpoint in changeToSPMDMode.
- openmp-opt-disable-folding: Defaults to false, adding this flag sets the variable DisableOpenMPOptFolding to true. This indicates a pessimistic fixpoint in the attributor init for AAFoldRuntimeCall.
- openmp-opt-disable-state-machine-rewrite: Defaults to false, adding this flag sets the variable DisableOpenMPOptStateMachineRewrite to true. This first prevents changes to the state machine in rewriteDeviceCodeStateMachine by returning before changes are made, and if a custom state machine is built in buildCustomStateMachine, stops by returning a pessimistic fixpoint.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D106802
Adrian Prantl [Thu, 29 Jul 2021 23:23:00 +0000 (16:23 -0700)]
Make testcase more robust against codegen changes
Adrian Prantl [Thu, 29 Jul 2021 23:21:33 +0000 (16:21 -0700)]
Fix typo
Sanjay Patel [Thu, 29 Jul 2021 21:30:42 +0000 (17:30 -0400)]
[InstCombine] add tests for vector cmp-bitcast; NFC
Adrian Prantl [Wed, 30 Jun 2021 22:40:45 +0000 (15:40 -0700)]
GlobalISel/AArch64: don't optimize away redundant branches at -O0
This patch prevents GlobalISel from optimizing out redundant branch
instructions when compiling without optimizations.
The motivating example is code like the following common pattern in
Swift, where users expect to be able to set a breakpoint on the early
exit:
public func f(b: Bool) {
guard b else {
return // I would like to set a breakpoint here.
}
...
}
The patch modifies two places in GlobalISEL: The first one is in
IRTranslator.cpp where the removal of redundant branches is made
conditional on the optimization level. The second one is in
AArch64InstructionSelector.cpp where an -O0 *only* optimization is
being removed.
Disabling these optimizations increases code size at -O0 by
~8%. However, doing so improves debuggability, and debug builds are
the primary reason why developers compile without optimizations. We
thus concluded that this is the right trade-off.
rdar://
79515454
This tenatively reapplies the patch without modifications, the LLDB
test that has blocked this from landing previously has since been
modified to hopefully no longer be sensitive to this change.
Differential Revision: https://reviews.llvm.org/D105238
Amy Zhuang [Thu, 29 Jul 2021 22:39:49 +0000 (15:39 -0700)]
[mlir] Set insertion point of vector constant to the top of the vectorized loop body
When we vectorize a scalar constant, the vector constant is inserted before its
first user if the scalar constant is defined outside the loops to be vectorized.
It is possible that the vector constant does not dominate all its users. To fix
the problem, we find the innermost vectorized loop that encloses that first user
and insert the vector constant at the top of the loop body.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D106609
George Burgess IV [Thu, 29 Jul 2021 22:25:48 +0000 (22:25 +0000)]
security: highlight phab accounts; recommend phab for nominations
This commit contains two mildly separate concepts.
First, sending out reviews for things like this is a bit of a
complicated endeavor, since the reviewer list is relatively long, and I
generally rely on prior CLs in this area to find an authoritative list.
Life's quite a bit easier if phab usernames are readily available on the
doc. So part 1 is making those available.
Second, it seems to me that, at the moment, Phabricator makes the most
sense for membership changes (incl. security group nominations). My
reasoning for this is detailed in the diff, and to some extent in
comment #1 of this bug
<https://bugs.chromium.org/p/llvm/issues/detail?id=12#c1>. This change
adds prose to recommend the use of Phabricator for nominations as a
result.
Differential Revision: https://reviews.llvm.org/D106917
Rob Suderman [Thu, 29 Jul 2021 21:38:30 +0000 (14:38 -0700)]
[mlir][tosa] Fix tosa.reshape failures due to implicit broadcasting
Make broadcastable needs the output shape to determine whether the operation
includes additional broadcasting. Include some canonicalizations for TOSA
to remove unneeded reshape.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D106846
Stella Laurenzo [Thu, 29 Jul 2021 20:34:23 +0000 (20:34 +0000)]
[MLIR][Python] Use DEST_PREFIX when installing.
Differential Revision: https://reviews.llvm.org/D107100
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