Johannes Doerfert [Sun, 10 Jul 2022 20:01:38 +0000 (15:01 -0500)]
[Intrinsics] Add `nocallback` to the memset/cpy/move intrinsics
These were forgotten when D118680 was applied. Similar to D125937.
Differential Revision: https://reviews.llvm.org/D129516
Ye Luo [Fri, 22 Jul 2022 02:58:15 +0000 (21:58 -0500)]
Revert "[OpenMP][OMPD] GDB plugin code to leverage libompd to provide debugging"
This reverts commit
51d3f421f48f7c888c37a13be049a4ca8b61436e.
Ye Luo [Fri, 22 Jul 2022 02:57:57 +0000 (21:57 -0500)]
Revert "Fixing build bot failure due to python-pip unavailability."
This reverts commit
9dc0d6aaa1e27b97e5d163f2590cf24b769a0c36.
Johannes Doerfert [Fri, 22 Jul 2022 00:29:18 +0000 (19:29 -0500)]
[OpenMP][FIX] Ensure thread and team state are defined properly
The namespaces were missing causing the symbols to have "C" mangling.
To avoid this in the future we qualify the names now fully.
Johannes Doerfert [Sun, 10 Jul 2022 19:59:01 +0000 (14:59 -0500)]
[Attributor][NFC] Remove unnecessary overwritten methods
Fangrui Song [Fri, 22 Jul 2022 02:41:24 +0000 (19:41 -0700)]
[Driver][test] Remove unused "-o %t.s" from frame-pointer*.c
Fangrui Song [Fri, 22 Jul 2022 02:37:56 +0000 (19:37 -0700)]
[LoongArch] Support load/store of dso_local PIC global values
lowerGlobalAddress added by D128427 can be used for PIC. The actual condition is
that the global value needs to be dso_local (a dso_preemptable one needs GOT
indirection).
load-store.ll has UB due to out-of-bounds load/store. Fix the UB in the variable
test and add an array test. Note: NOPIC array index is currently wrong.
Reviewed By: wangleiat
Differential Revision: https://reviews.llvm.org/D129977
Fangrui Song [Fri, 22 Jul 2022 01:41:28 +0000 (18:41 -0700)]
[verify-uselistorder] Hide unrelated options
Chenbing Zheng [Fri, 22 Jul 2022 01:24:24 +0000 (09:24 +0800)]
[InstCombine] remove useless ‘InstCombiner::’. nfc
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D130220
Fangrui Song [Fri, 22 Jul 2022 01:08:33 +0000 (18:08 -0700)]
[sanstats] Hide unrelated options
Fangrui Song [Fri, 22 Jul 2022 01:00:30 +0000 (18:00 -0700)]
[sancov] --help: hide unrelated options
Volodymyr Sapsai [Tue, 19 Jul 2022 21:27:02 +0000 (14:27 -0700)]
[modules] Replace `-Wauto-import` with `-Rmodule-include-translation`.
Diagnostic for `-Wauto-import` shouldn't be a warning because it doesn't
represent a potential problem in code that should be fixed. And the
emitted fix-it is likely to trigger `-Watimport-in-framework-header`
which makes it challenging to have a warning-free codebase. But it is
still useful to see how include directives are translated into modular
imports and which module a header belongs to, that's why keep it as a remark.
Keep `-Wauto-import` for now to allow a gradual migration for codebases
using `-Wno-auto-import`, e.g., `-Weverything -Wno-auto-import`.
rdar://
79594287
Differential Revision: https://reviews.llvm.org/D130138
Slava Gurevich [Thu, 21 Jul 2022 22:04:04 +0000 (15:04 -0700)]
[LLDB][Reliability] Fix accessing invalid iterator
Using invalidated vector iterator is at best a UB and could crash depending on STL implementation.
Fixing via minimal changes to preserve the existing code style.
Coverity warning 1454828 (scan.coverity.com)
Differential Revision: https://reviews.llvm.org/D130312
Phoebe Wang [Thu, 21 Jul 2022 23:56:29 +0000 (07:56 +0800)]
[X86][FP16] Do not split FP64->FP16 to FP64->FP32->FP16
Truncation from double to half is not always identical to truncating to float first and then to half. https://godbolt.org/z/56s9517hd
On the other hand, expanding to float and then to double is always identical to expanding to double directly. https://godbolt.org/z/Ye8vbYPnY
Reviewed By: RKSimon, skan
Differential Revision: https://reviews.llvm.org/D130151
Ryan Prichard [Thu, 21 Jul 2022 20:09:48 +0000 (13:09 -0700)]
[Frontend] Correct values of ATOMIC_*_LOCK_FREE to match builtin
Correct the logic used to set `ATOMIC_*_LOCK_FREE` preprocessor macros not
to rely on the ABI alignment of types. Instead, just assume all those
types are aligned correctly by default since clang uses safe alignment
for `_Atomic` types even if the underlying types are aligned to a lower
boundary by default.
For example, the `long long` and `double` types on x86 are aligned to
32-bit boundary by default. However, `_Atomic long long` and `_Atomic
double` are aligned to 64-bit boundary, therefore satisfying
the requirements of lock-free atomic operations.
This fixes PR #19355 by correcting the value of
`__GCC_ATOMIC_LLONG_LOCK_FREE` on x86, and therefore also fixing
the assumption made in libc++ tests. This also fixes PR #30581 by
applying a consistent logic between the functions used to implement
both interfaces.
Reviewed By: hfinkel, efriedma
Differential Revision: https://reviews.llvm.org/D28213
Ryan Prichard [Thu, 21 Jul 2022 20:09:39 +0000 (13:09 -0700)]
[CUDA] Ignore __CLANG_ATOMIC_LLONG_LOCK_FREE on i386
The default host CPU for an i386 triple is typically at least an i586,
which has cmpxchg8b (Clang feature, "cx8"). Therefore,
`__CLANG_ATOMIC_LLONG_LOCK_FREE` is 2 on the host, but the value should
be 1 for the device.
Also, grep for `__CLANG_ATOMIC_*` instead of `__GCC_ATOMIC_*`. The CLANG
macros are always emitted, but the GCC macros are omitted for the
*-windows-msvc targets. The `__GCC_HAVE_SYNC_COMPARE_AND_SWAP` macro
always has GCC in its name, not CLANG, however.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D127465
Ilia Diachkov [Wed, 20 Jul 2022 15:48:16 +0000 (18:48 +0300)]
[SPIRV] add SPIRVPrepareFunctions pass and update other passes
The patch adds SPIRVPrepareFunctions pass, which modifies function
signatures containing aggregate arguments and/or return values before
IR translation. Information about the original signatures is stored in
metadata. It is used during call lowering to restore correct SPIR-V types
of function arguments and return values. This pass also substitutes some
llvm intrinsic calls to function calls, generating the necessary functions
in the module, as the SPIRV translator does.
The patch also includes changes in other modules, fixing errors and
enabling many SPIR-V features that were omitted earlier. And 15 LIT tests
are also added to demonstrate the new functionality.
Differential Revision: https://reviews.llvm.org/D129730
Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
Nick Desaulniers [Fri, 22 Jul 2022 00:10:53 +0000 (17:10 -0700)]
precommit update_mir_test_checks run for D130316 NFC
Philip Reames [Thu, 21 Jul 2022 21:40:20 +0000 (14:40 -0700)]
[LV] Fix a conceptual mistake around meaning of uniform in isPredicatedInst
This code confuses LV's "Uniform" and LVL/LAI's "Uniform". Despite the
common name, these are different.
* LVs notion means that only the first lane *of each unrolled part* is
required. That is, lanes within a single unroll factor are considered
uniform. This allows e.g. widenable memory ops to be considered
uses of uniform computations.
* LVL and LAI's notion refers to all lanes across all unrollings.
IsUniformMem is in turn defined in terms of LAI's notion. Thus a
UniformMemOpmeans is a memory operation with a loop invariant address.
This means the same address is accessed in every iteration.
The tweaked piece of code was trying to match a uniform mem op (i.e.
fully loop invariant address), but instead checked for LV's notion of
uniformity. In theory, this meant with UF > 1, we could speculate
a load which wasn't safe to execute.
This ends up being mostly silent in current code as it is nearly
impossible to create the case where this difference is visible. The
closest I've come in the test case from 54cb87, but even then, the
incorrect result is only visible in the vplan debug output; before this
change we sink the unsafely speculated load back into the user's predicate
blocks before emitting IR. Both before and after IR are correct so the
differences aren't "interesting".
The other test changes are uninteresting. They're cases where LV's uniform
analysis is slightly weaker than SCEV isLoopInvariant.
Philip Reames [Thu, 21 Jul 2022 22:27:33 +0000 (15:27 -0700)]
[LV] Add a load focused version of the r45679 test
This a reproducer for bug in predicated instruction handling. The final result code is correct, but the reasoning by which we get there isn't.
Craig Topper [Thu, 21 Jul 2022 21:23:30 +0000 (14:23 -0700)]
[RISCV] Add sext.b/h and zext.b/h/w to RISCVInstrInfo::foldMemoryOperandImpl.
We can always fold zext.b since it is just andi. The others require
Zba/Zbb.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D130302
Alexander Shaposhnikov [Thu, 21 Jul 2022 21:29:39 +0000 (21:29 +0000)]
[GlobalOpt] Enable evaluation of atomic loads
Relax the check to allow evaluation of atomic loads
(but still skip volatile loads).
Test plan:
1/ ninja check-llvm check-clang
2/ Bootstrapped LLVM/Clang pass tests
Differential revision: https://reviews.llvm.org/D130211
LLVM GN Syncbot [Thu, 21 Jul 2022 21:26:59 +0000 (21:26 +0000)]
[gn build] Port
1d057a6d4306
Augusto Noronha [Thu, 21 Jul 2022 21:19:20 +0000 (14:19 -0700)]
Revert "[libc++] Use uninitialized algorithms for vector"
This reverts commit
23cf42e706fbc2a939ce1470da16599b42258aea.
LLVM GN Syncbot [Thu, 21 Jul 2022 20:54:39 +0000 (20:54 +0000)]
[gn build] Port
1dad6247d275
Daniel Thornburgh [Thu, 21 Jul 2022 20:52:15 +0000 (13:52 -0700)]
Fix use after free in MarkupFilter.cpp
Chi Chun Chen [Thu, 21 Jul 2022 20:50:22 +0000 (15:50 -0500)]
[OpenMP][NFC] Claim iterators in 'map' clause and motion clauses
Joseph Huber [Thu, 21 Jul 2022 19:29:58 +0000 (15:29 -0400)]
[Libomptarget] Stop testing CPU offloading with LTO
Summary:
Some of the buildbots don't find the libraries because they don't build
for the GPU. Although it should always be there it's unclear why these
buildbots are having problemsd. LTO is only interesting on the GPU and
these tests take extra time anyway so I'm just going to disable them for
now.
Teresa Johnson [Wed, 29 Jun 2022 20:25:58 +0000 (13:25 -0700)]
[MemProf] Add memprof metadata related analysis utilities
Adds a number of utilities that are used to help create and update
memprof related metadata. These will be used during profile matching
and annotation, as well as by the inliner when updating the metadata.
Also adds unit tests for the utilities.
See also related RFCs:
RFC: Sanitizer-based Heap Profiler [1]
RFC: A binary serialization format for MemProf [2]
RFC: IR metadata format for MemProf [3]
(Note that the IR metadata format has changed from the RFC during
implementation, as described in the preceeding patch adding the basic
metadata and verification support.)
Depends on D128141.
Differential Revision: https://reviews.llvm.org/D128854
Sam McCall [Tue, 19 Jul 2022 08:54:52 +0000 (10:54 +0200)]
[pseudo] Key guards by RuleID, add guards to literals (and 0).
After this, NUMERIC_CONSTANT and strings should parse only one way.
There are 8 types of literals, and 24 valid (literal, TokenKind) pairs.
This means adding 8 new named guards (or 24, if we want to assert the token).
It seems fairly clear to me at this point that the guard names are unneccesary
indirection: the guards are in fact coupled to the rule signature.
(Also add the zero guard I forgot in the previous patch.)
Differential Revision: https://reviews.llvm.org/D130066
Ziqing Luo [Thu, 21 Jul 2022 20:20:19 +0000 (13:20 -0700)]
[ASTMatchers] Adding a new matcher for callee declarations of Obj-C
message expressions
For an Obj-C message expression `[o m]`, the adding matcher will match
the declaration of the method `m`. This commit overloads the existing
`callee` ASTMatcher, which originally was only for C/C++ nodes but
also applies to Obj-C messages now.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D129398
Siva Chandra Reddy [Wed, 20 Jul 2022 21:02:53 +0000 (21:02 +0000)]
[libc] Add a convenience class and function for integer to string conversion.
Printf's integer converter has been modified to use the new converter. In
future, it will be used to implement other parts of the libc.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D130227
Martin Storsjö [Wed, 20 Jul 2022 10:39:33 +0000 (13:39 +0300)]
[MinGW] Don't currently set visibility=hidden when building for MinGW
If we build the Target libraries with -fvisibility=hidden, then
LLVM_EXTERNAL_VISIBILITY must also be able to override it back
to default visibility.
Currently, the LLVM_EXTERNAL_VISIBILITY define is a no-op for
mingw targets, thus set CMAKE_CXX_VISIBILITY_PRESET correspondingly.
This unbreaks the mingw dylib build, if the compiler actually
takes hidden visiblity into account (e.g. after D130121).
(Later, once hidden visiblity can be used for MinGW targets, we
can make LLVM_EXTERNAL_VISIBILITY and LLVM_LIBRARY_VISIBILITY expand
to actual attributes, and reverse this commit.)
Differential Revision: https://reviews.llvm.org/D130200
Philip Reames [Thu, 21 Jul 2022 19:52:48 +0000 (12:52 -0700)]
[LV][SVE] Autogen a test for ease of update
Jacques Pienaar [Thu, 21 Jul 2022 19:58:19 +0000 (12:58 -0700)]
[mlir] Explicitly mark dialect prefixing
Missed previously and needed to flip the default. Most of these just
flipped to _Raw to retain existing state/keep this small except for TOSA
dialect which got flipped to _Both as no further change was needed..
Augie Fackler [Thu, 21 Jul 2022 19:07:05 +0000 (15:07 -0400)]
[bazel] add headers now required after
17e4c217b663
Augie Fackler [Wed, 20 Jul 2022 16:24:36 +0000 (12:24 -0400)]
BuildLibCalls: move inference of freeing memory later
This probably should have been part of D123089, but the effects of it
don't show up until we start removing functions from the table in
D130107. Oops.
Differential Revision: https://reviews.llvm.org/D130184
Augie Fackler [Fri, 1 Apr 2022 02:33:13 +0000 (22:33 -0400)]
MemoryBuiltins: accept non-TLI funcs with attribs as allocator funcs
This allows us to accept annotations from out-of-tree languages (the
example test is derived from Rust) so they can enjoy the benefits of
LLVM's optimizations without requiring LLVM to have language-specific
knowledge.
Differential Revision: https://reviews.llvm.org/D123091
Augie Fackler [Wed, 30 Mar 2022 18:14:53 +0000 (14:14 -0400)]
MemoryBuiltins: start using properties of functions
Prior to this change, we relied on the hard-coded list for all of the
information performed by MemoryBuiltins. With this change, we're able to
start relying on properites of functions described in attributes, which
opens the door to out-of-tree compilers being able to describe their
allocator functions to LLVM's optimizer logic without having to register
their implementation details with LLVM.
Differential Revision: https://reviews.llvm.org/D123090
Sanjay Patel [Thu, 21 Jul 2022 19:07:06 +0000 (15:07 -0400)]
[PatternMatch][InstCombine] match a vector with constant expression element(s) as a constant expression
The InstCombine test is reduced from issue #56601. Without the more
liberal match for ConstantExpr, we try to rearrange constants in
Negator forever.
Alternatively, we could adjust the definition of m_ImmConstant to be
more conservative, but that's probably a larger patch, and I don't
see any downside to changing m_ConstantExpr. We never capture and
modify a ConstantExpr; transforms just want to avoid it.
Differential Revision: https://reviews.llvm.org/D130286
Sanjay Patel [Thu, 21 Jul 2022 15:52:23 +0000 (11:52 -0400)]
[PatternMatch] add tests for constant expression matcher; NFC
Arthur Eubanks [Wed, 9 Feb 2022 22:18:14 +0000 (14:18 -0800)]
[LoopAccessAnalysis] Simplify D119047
No need to add checks for every type per pointer that we couldn't create
a check for the first time around, just the types that weren't
successful.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D119376
Philip Reames [Thu, 21 Jul 2022 19:02:17 +0000 (12:02 -0700)]
[RISCV][LV] Split coverage of uniform load with outside use
Turns out this has a large effect of tail folding, so split out a single test to cover that case and remove it from the others.
John Ericson [Sat, 11 Jun 2022 06:11:59 +0000 (06:11 +0000)]
[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore
First of all, `LLVM_TOOLS_INSTALL_DIR` put there breaks our NixOS
builds, because `LLVM_TOOLS_INSTALL_DIR` defined the same as
`CMAKE_INSTALL_BINDIR` becomes an *absolute* path, and then when
downstream projects try to install there too this breaks because our
builds always install to fresh directories for isolation's sake.
Second of all, note that `LLVM_TOOLS_INSTALL_DIR` stands out against the
other specially crafted `LLVM_CONFIG_*` variables substituted in
`llvm/cmake/modules/LLVMConfig.cmake.in`.
@beanz added it in
d0e1c2a550ef348aae036d0fe78cab6f038c420c to fix a
dangling reference in `AddLLVM`, but I am suspicious of how this
variable doesn't follow the pattern.
Those other ones are carefully made to be build-time vs install-time
variables depending on which `LLVMConfig.cmake` is being generated, are
carefully made relative as appropriate, etc. etc. For my NixOS use-case
they are also fine because they are never used as downstream install
variables, only for reading not writing.
To avoid the problems I face, and restore symmetry, I deleted the
exported and arranged to have many `${project}_TOOLS_INSTALL_DIR`s.
`AddLLVM` now instead expects each project to define its own, and they
do so based on `CMAKE_INSTALL_BINDIR`. `LLVMConfig` still exports
`LLVM_TOOLS_BINARY_DIR` which is the location for the tools defined in
the usual way, matching the other remaining exported variables.
For the `AddLLVM` changes, I tried to copy the existing pattern of
internal vs non-internal or for LLVM vs for downstream function/macro
names, but it would good to confirm I did that correctly.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D117977
Jacques Pienaar [Thu, 21 Jul 2022 19:03:07 +0000 (12:03 -0700)]
[mlir] Flip dialects to _Prefixed
At least two weeks passed since flipped to _Both. Made some additional
NFC changes in .td files that were not converted earlier.
Daniel Thornburgh [Thu, 21 Jul 2022 19:00:15 +0000 (12:00 -0700)]
[NFC] Fix compiler warning in MarkupFilter
Slava Zakharin [Thu, 14 Jul 2022 23:50:41 +0000 (16:50 -0700)]
[flang] Run algebraic simplification optimization pass.
Try 2 to merge
4fbd1d6c872e8228f23a6e13914222af40ca6461.
Flang algebraic simplification pass will run algebraic simplification
rewrite patterns for Math/Complex/etc. dialects. It is enabled
under opt-for-speed optimization levels (i.e. for O1/O2/O3; Os/Oz will not
enable it).
With this change the FIR/MLIR optimization pipeline becomes affected
by the -O* optimization level switches. Until now these switches
only affected the middle-end and back-end.
Differential Revision: https://reviews.llvm.org/D130035
George Petterson [Thu, 21 Jul 2022 18:36:47 +0000 (14:36 -0400)]
Adding a new variant of DepthwiseConv2D
This is the same as the existing multiplier-1 variant of DepthwiseConv2D, but in PyTorch dim order.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D128575
Daniel Thornburgh [Fri, 10 Jun 2022 23:11:36 +0000 (16:11 -0700)]
[Symbolizer] Implement contextual symbolizer markup elements.
This change implements the contextual symbolizer markup elements: reset,
module, and mmap. These provide information about the runtime context of
the binary necessary to resolve addresses to symbolic values.
Summary information is printed to the output about this context.
Multiple mmap elements for the same module line are coalesced together.
The standard requires that such elements occur on their own lines to
allow for this; accordingly, anything after a contextual element on a
line is silently discarded.
Implementing this cleanly requires that the filter drive the parser;
this allows skipped sections to avoid being parsed. This also makes the
filter quite a bit easier to use, at the cost of some unused
flexibility.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D129519
Zequan Wu [Thu, 21 Jul 2022 17:18:16 +0000 (10:18 -0700)]
[llvm-cov] Improve error message by printing the object file name that produces error
If error occurs on constructing coverage info for one of the object files, it prints the name of the object file, so that users know which one is the cause of error.
Differential Revision: https://reviews.llvm.org/D130196
Zequan Wu [Wed, 20 Jul 2022 23:08:25 +0000 (16:08 -0700)]
[SemaCXX] Set promotion type for enum if its type is promotable to integer type even if it has no definition.
EnumDecl's promotion type is set either to the parsed type or calculated type
after completing its definition. When it's bool type and has no definition,
its promotion type is bool which is not allowed by clang.
Fixes #56560.
Differential Revision: https://reviews.llvm.org/D130210
Philip Reames [Thu, 21 Jul 2022 18:07:40 +0000 (11:07 -0700)]
{RISCV][LV] Add tail folding coverage of uniform load store cases
Philip Reames [Thu, 21 Jul 2022 18:04:23 +0000 (11:04 -0700)]
{RISCV][LV] Add a test for uniform store of a loop varying value
Anubhab Ghosh [Thu, 21 Jul 2022 17:58:10 +0000 (23:28 +0530)]
[NFC] Empty commit to test commit access
Jez Ng [Thu, 21 Jul 2022 17:58:15 +0000 (13:58 -0400)]
[lld-macho] Fix LOH parsing segfault
`advanceSubsection()` didn't account for the possibility that a section
could have no subsections.
Reviewed By: #lld-macho, thakis, BertalanD
Differential Revision: https://reviews.llvm.org/D130288
Javed Absar [Thu, 21 Jul 2022 14:47:27 +0000 (15:47 +0100)]
Fix type in documentation
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D130274
Philip Reames [Thu, 21 Jul 2022 17:38:25 +0000 (10:38 -0700)]
{RISCV][LV] Split out and expand tests for uniform loads and stores
Johannes Doerfert [Tue, 12 Jul 2022 02:42:16 +0000 (21:42 -0500)]
[CUDA][FIX] Make shfl[_sync] for unsigned long long non-recursive
A copy-paste error caused UB in the definition of the unsigned long long
versions of the shfl intrinsics. Reported and diagnosed by @trws.
Differential Revision: https://reviews.llvm.org/D129536
Johannes Doerfert [Mon, 18 Jul 2022 20:44:02 +0000 (15:44 -0500)]
[OpenMP] Introduce more fine-grained control over the thread state use
We can help optimizations by making sure we use the team state whenever
it is clear there is no thread state. To this end we introduce a new
state flag (`state::HasThreadState`) and explicit control for the
`state::ValueRAII` helpers, including a dedicated "assert equal".
Differential Revision: https://reviews.llvm.org/D130113
Johannes Doerfert [Wed, 13 Jul 2022 16:01:54 +0000 (11:01 -0500)]
[OpenMP] Use Undef instead of null as pointer for inactive lanes
Our conditional writes in the runtime look like this:
```
if (active)
*ptr = value;
```
In the RAII we need to assign `ptr` which comes from a lookup call.
If a thread that is not the main thread calls lookup with the intention
to write the pointer, we'll create a new thread state. As such, we need
to avoid calling lookup for inactive threads. We used to use `nullptr`
as their `ptr` value but that can cause pessimistic reasoning. We now
use `undef` instead.
Differential Revision: https://reviews.llvm.org/D130114
Johannes Doerfert [Tue, 19 Jul 2022 19:22:23 +0000 (14:22 -0500)]
[OpenMP] Expose the state in the header to allow non-lto optimizations
We used to inline the `lookup` calls such that the runtime had "known"
access offsets when it was shipped. With the new static library build it
doesn't as the lookup is an indirection we cannot look through. This
should help us optimize the code better until we can do LTO for the
runtime again.
Differential Revision: https://reviews.llvm.org/D130111
Joseph Huber [Fri, 10 Jun 2022 13:37:21 +0000 (09:37 -0400)]
[Libomptarget] Add checks for CUDA subarchitecture using new info
This patch extends the `is_valid_binary` routine to also check if the
binary's architecture string matches the one parsed from the runtime.
This should allow us to only use the binary whose compute capability
matches, allowing us to support basic multi-architecture binaries for
CUDA.
Depends on D127432
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D127505
Joseph Huber [Fri, 10 Jun 2022 19:16:15 +0000 (15:16 -0400)]
[Libomptarget] Add support for offloading binaries in libomptarget
The previous path changed the linker wrapper to embed the offloading
binary format inside the target image instead. This will allow us to
more generically bundle metadata with these images, such as requires
clauses or the target architecture it was compiled for.
I wasn't sure how to handle this best, so I introduced a new type that
replaces the old `__tgt_device_image` struct that we can expand inside
the runtime library. I made the new `__tgt_device_binary` struct pretty
much the same for now. In the future we could change this struct to
pretty much be the `OffloadBinary` class in the future.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D127432
Joseph Huber [Wed, 8 Jun 2022 13:38:41 +0000 (09:38 -0400)]
[LinkerWrapper] Embed OffloadBinaries for OpenMP offloading images
The OpenMP offloading runtine currently uses an array of linked
offloading images. One downside to this is that we cannot know the
architecture or triple associated with the given image. In this patch,
instead of embedding the image itself, we embed an offloading binary
instead. This binary is simply a binary format that wraps around the
original linked image to provide some additional metadata. This will
allow us to support offloading to multiple architecture, or performing
future JIT compilation inside of the runtime, more clearly.
Additionally, these can be placed at a special section such that the
supported architectures can be identified using objdump with the support
from D126904. This needs to be stored in a new section name
`.llvm.offloading.images` because the `.llvm.offloading` section
implicitly uses the `SHF_EXCLUDE` flag and will always be stripped.
This patch does not contain the necessary code to parse these in
libomptarget.
Depends on D127246
Reviewed By: saiislam
Differential Revision: https://reviews.llvm.org/D127304
Pengxuan Zheng [Wed, 20 Jul 2022 21:08:25 +0000 (14:08 -0700)]
[llvm-lib] Ignore /VERBOSE flag
Ignore the flag for now, but we can start using it for verbose output if needed.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D130202
Jakub Kuderski [Thu, 21 Jul 2022 17:02:45 +0000 (13:02 -0400)]
[mlir][spirv] Rename spv.GLSL ops to spv.GL. NFC.
This is to improve consistency within the SPIR-V dialect and make these ops a bit shorter.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D130280
Louis Dionne [Thu, 21 Jul 2022 16:48:14 +0000 (12:48 -0400)]
[libc++] Reorganize release notes
In particular, create sections for deprecations and removals, and also
for announcing upcoming deprecations/removals.
Abraham Corea Diaz [Thu, 21 Jul 2022 16:50:43 +0000 (16:50 +0000)]
[clang] Add -fdiagnostics-format=sarif option for future SARIF output
Adds `sarif` option to the existing `-fdiagnostics-format` flag
for intended future work with SARIF diagnostics. Currently issues a warning
against the use of diagnostics in SARIF mode, then defaults to clang style for
diagnostics.
Reviewed By: cjdb, denik, aaron.ballman
Differential Revision: https://reviews.llvm.org/D129886
Louis Dionne [Thu, 21 Jul 2022 14:55:06 +0000 (10:55 -0400)]
[libc++][NFC] Fix weird unicode character in release notes
Tarun Prabhu [Thu, 21 Jul 2022 16:39:54 +0000 (10:39 -0600)]
[flang] Lower F08 merge_bits intrinsic.
Lower F08 merge_bits intrinsic.
Differential Revision: https://reviews.llvm.org/D129779
Christopher Bate [Thu, 21 Jul 2022 15:26:46 +0000 (09:26 -0600)]
[mlir][linalg] Add tile_size option to `structured.tile_to_foreach_thread_op`
This change modifies `structured.tile_to_foreach_thread_op` so that
it accepts either `tile_sizes` or `num_threads` parameters. If
`tile_sizes` are specified, then the number of threads required is
derived the tile sizes rather than the other way around. In both cases,
more aggressive folding of loop parameters is enabled during the
transformation, allowing for the potential elimination of `affine.min`
and `affine.max` operations in the static shape case when calculating
the final adjusted tile size.
Differential Revision: https://reviews.llvm.org/D130139
Tarun Prabhu [Thu, 21 Jul 2022 16:26:56 +0000 (10:26 -0600)]
[flang][NFC] Test folding of F08 merge_bits intrinsic.
Test compile-time folding of the F2008 merge_bits intrinsic.
Differential Revision: https://reviews.llvm.org/D129780
Jorge Gorbe Moya [Thu, 21 Jul 2022 16:19:19 +0000 (09:19 -0700)]
[lldb][NFCI] Refactor regex filtering logic in CommandObjectTypeFormatterList
Extract a bit of copy/pasted regex filtering logic into a separate
function and simplify it a little bit.
Differential Revision: https://reviews.llvm.org/D130219
David Sherwood [Tue, 12 Jul 2022 11:03:39 +0000 (12:03 +0100)]
[AArch64] Add target hook for preferPredicateOverEpilogue
This patch adds the AArch64 hook for preferPredicateOverEpilogue,
which currently returns true if SVE is enabled and one of the
following conditions (non-exhaustive) is met:
1. The "sve-tail-folding" option is set to "all", or
2. The "sve-tail-folding" option is set to "all+noreductions"
and the loop does not contain reductions,
3. The "sve-tail-folding" option is set to "all+norecurrences"
and the loop has no first-order recurrences.
Currently the default option is "disabled", but this will be
changed in a later patch.
I've added new tests to show the options behave as expected here:
Transforms/LoopVectorize/AArch64/sve-tail-folding-option.ll
Differential Revision: https://reviews.llvm.org/D129560
Kadir Cetinkaya [Thu, 21 Jul 2022 10:41:00 +0000 (12:41 +0200)]
[clangd] Refactor forwarding call detection logic
Differential Revision: https://reviews.llvm.org/D130261
Kadir Cetinkaya [Thu, 21 Jul 2022 08:20:00 +0000 (10:20 +0200)]
[clangd] Mention whether compile flags were inferred in check mode
That way when looking at logs it's clear whether diagnostics are a
result of compile flags mismatch.
Differential Revision: https://reviews.llvm.org/D130228
Mark de Wever [Thu, 21 Jul 2022 15:31:45 +0000 (17:31 +0200)]
[libc++][format] Adhere to clang-tidy style.
D126971 broke the CI due to recent changes in the clang-tidy settings.
This fixes them.
Joe Nash [Wed, 20 Jul 2022 19:42:57 +0000 (15:42 -0400)]
[AMDGPU] NFC. Auto-generate test for vcclo
Michał Górny [Mon, 18 Jul 2022 15:54:31 +0000 (17:54 +0200)]
[lldb] [gdb-remote] Fix process ID after following forked child
Update the process ID after handling fork/vfork to ensure that
the process plugin reports the correct PID immediately.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D130037
Joseph Huber [Thu, 21 Jul 2022 13:34:58 +0000 (09:34 -0400)]
[Libomptarget] Build the device library even if the sm list is empty
We previously had some logic that stopped us from building the device runtime if
there were no NVPTX architectures provided. This is incorrect because we could
have AMDGPU libraries. Even if the lists are empty we should be able to attempt
to build these and get dummy output. THis wilil make it much easier for our
tooling which expects certain libraries. If the user wishes to disable the
library entirely they should use `-DLIBOMPTARGET_BUILD_DEVICERTL_BCLIB=OFF"
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D130266
Phoebe Wang [Thu, 21 Jul 2022 14:53:23 +0000 (22:53 +0800)]
[X86] Remove cfi directives and duplicated check in tests. NFC
Pavel Labath [Thu, 21 Jul 2022 14:51:54 +0000 (16:51 +0200)]
[lldb/test] Fix flakyness in TestNonStop.test_stdio
The test was assuming that the output will come in two messages. The
truth is that it will come in **at least** two messages.
Alex Zinenko [Thu, 21 Jul 2022 14:00:37 +0000 (14:00 +0000)]
[mlir][python] Fix issues with block argument slices
The type extraction helper function for block argument and op result
list objects was ignoring the slice entirely. So was the slice addition.
Both are caused by a misleading naming convention to implement slices
via CRTP. Make the convention more explicit and hide the helper
functions so users have harder time calling them directly.
Closes #56540.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D130271
David Sherwood [Tue, 12 Jul 2022 12:38:45 +0000 (13:38 +0100)]
[NFC][LoopVectorize] Explicitly disable tail-folding on some SVE tests
This patch is in preparation for enabling vectorisation with tail-folding
by default for SVE targets. Once we do that many existing tests will
break that depend upon having normal unpredicated vector loops. For
all such tests I have added the flag:
-prefer-predicate-over-epilogue=scalar-epilogue
Differential Revision: https://reviews.llvm.org/D129137
Graham Hunter [Thu, 21 Jul 2022 13:24:58 +0000 (14:24 +0100)]
[LAA] Precommit add/sub tests for forked pointers
Adds new tests for add and sub instructions before reaching a select.
Also adds tests using different bit widths for memory, including
non-power-of-two integers.
Nicolas Vasilache [Thu, 21 Jul 2022 13:44:43 +0000 (06:44 -0700)]
[mlir][Linalg] Add a Transform dialect NavigationOp op to match a list of ops or an interface.
This operation is a NavigationOp that simplifies the writing of transform IR.
Since there is no way of refering to an interface by name, the current implementation uses
an EnumAttr and depends on the interfaces it supports.
In the future, it would be worthwhile to remove this dependence and generalize.
Differential Revision: https://reviews.llvm.org/D130267
Ivan Kosarev [Thu, 21 Jul 2022 13:56:25 +0000 (14:56 +0100)]
[AMDGPU][MC][NFC] Refine SMEM load definitions.
Reviewed By: dp
Differential Revision: https://reviews.llvm.org/D130009
Ivan Kosarev [Thu, 21 Jul 2022 13:25:09 +0000 (14:25 +0100)]
[AMDGPU][NFC] Validate G_MERGE_VALUES as we match zero-extended 32-bit scalars.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D130001
Jez Ng [Thu, 21 Jul 2022 13:44:01 +0000 (09:44 -0400)]
[lld-macho] Fix assertion when two symbols at same addr have unwind info
If there are multiple symbols at the same address, our unwind info
implementation assumes that we always register unwind entries to a
single canonical symbol.
This assumption was violated by the `registerEhFrame` code.
Fixes #56570.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D130208
Erich Keane [Thu, 21 Jul 2022 13:39:22 +0000 (06:39 -0700)]
Revert "Rewording the "static_assert" to static assertion"
Looks like we again are going to have problems with libcxx tests that
are overly specific in their dependency on clang's diagnostics.
This reverts commit
6542cb55a3eb115b1c3592514590a19987ffc498.
Daniel Bertalan [Thu, 21 Jul 2022 09:26:09 +0000 (11:26 +0200)]
[lld-macho][NFC] Remove redundant StringRef construction
It's only used in one branch, so we were unnecessarily calculating the
length of many symbol names.
Tiny speedup when linking chromium_framework on my M1 Mac mini:
x before.txt
+ after.txt
N Min Max Median Avg Stddev
x 10 3.9917109 4.0418 4.0318099 4.0203902 0.
021459873
+ 10 3.944725 4.053988 3.9708955 3.9825602 0.
037257609
Difference at 95.0% confidence
-0.03783 +/- 0.0285663
-0.940953% +/- 0.710536%
(Student's t, pooled s = 0.0304028)
Differential Revision: https://reviews.llvm.org/D130234
Muhammad Usman Shahid [Thu, 21 Jul 2022 13:32:54 +0000 (06:32 -0700)]
Rewording the "static_assert" to static assertion
This patch is basically the rewording of the static assert statement's
output(error) on screen after failing. Failing a _Static_assert in C
should not report that static_assert failed. It’d probably be better to
reword the diagnostic to be more like GCC and say “static assertion”
failed in both C and C++.
consider a c file having code
_Static_assert(0, "oh no!");
In clang the output is like:
<source>:1:1: error: static_assert failed: oh no!
_Static_assert(0, "oh no!");
^ ~
1 error generated.
Compiler returned: 1
Thus here the "static_assert" is not much good, it will be better to
reword it to the "static assertion failed" to more generic. as the gcc
prints as:
<source>:1:1: error: static assertion failed: "oh no!"
1 | _Static_assert(0, "oh no!");
| ^~~~~~~~~~~~~~
Compiler returned: 1
The above can also be seen here. This patch is about rewording
the static_assert to static assertion.
Differential Revision: https://reviews.llvm.org/D129048
Joseph Huber [Thu, 21 Jul 2022 13:25:43 +0000 (09:25 -0400)]
[Binary] Hard-code the alignment of the offloading binary
Summary:
We previously used `alignof` to get the necessary alignment of the
binary header. However this was different on 32-bit platforms and caused
a few tests to fail because of it. This patch just changes this to be a
hard-coded constant of 8.
Jay Foad [Wed, 20 Jul 2022 12:45:27 +0000 (13:45 +0100)]
[AMDGPU] Pre-sink IR input for some tests
Edit the IR input for some codegen tests to simulate what the IR code
sinking pass would do to it. This makes the tests immune to the presence
or absence of the code sinking pass in the codegen pass pipeline, which
does not belong there.
Differential Revision: https://reviews.llvm.org/D130169
Michael Buch [Thu, 21 Jul 2022 00:04:03 +0000 (01:04 +0100)]
[LLDB][ClangExpression] Fix initialization of static enum alias members
`IntegerLiteral::Create` operates on integer types. For that reason
when we parse DWARF into an AST, when we encounter a constant
initialized enum member variable, we try to determine the underlying
integer type before creating the `IntegerLiteral`. However, we
currently don't desugar the type and for enum typedefs
`dyn_cast<EnumType>` fails. In debug builds this triggers following
assert:
```
Assertion failed: (type->isIntegerType() && "Illegal type in IntegerLiteral"), function IntegerLiteral, file Expr.cpp, line 892
```
This patch turns the `dyn_cast<EnumType>` into a `getAs<EnumType>`
which `dyn_cast`s the canonical type, allowing us to get to the
underlying integer type.
**Testing**
* API test
* Manual repro is fixed
Differential Revision: https://reviews.llvm.org/D130213
Michael Buch [Sun, 17 Jul 2022 11:16:39 +0000 (12:16 +0100)]
[LLDB][DataFormatter] Add support for std::__map_const_iterator
This patch adds support for formatting `std::map::const_iterator`.
It's just a matter of adding `const_` to the existing regex.
**Testing**
* Added test case to existing API tests
Differential Revision: https://reviews.llvm.org/D129962
Matt Arsenault [Thu, 21 Jul 2022 00:30:12 +0000 (20:30 -0400)]
AMDGPU: Refine user-sgpr-init16-bug
It only applies to gfx1100 and gfx1102, and for wave32.
Nikita Popov [Thu, 21 Jul 2022 12:54:16 +0000 (14:54 +0200)]
[MemoryBuiltins] Add getReallocatedOperand() function (NFC)
Replace the value-accepting isReallocLikeFn() overload with a
getReallocatedOperand() function, which returns which operand is
the one being reallocated. Currently, this is always the first one,
but once allockind(realloc) is respected, the reallocated operand
will be determined by the allocptr parameter attribute.
Nikita Popov [Thu, 21 Jul 2022 12:42:08 +0000 (14:42 +0200)]
[MemoryBuiltins] Remove isFreeCall() function (NFC)
Remove isFreeCall() in favor of getFreedOperand(). Replace the
two remaining uses with a getFreedOperand() != nullptr check, as
they only care that something is getting freed. (The usage in DSE
is correct as such. The allocator-related checks in CFLGraph look
rather questionable in general.)
Nikita Popov [Thu, 21 Jul 2022 12:33:55 +0000 (14:33 +0200)]
[InstCombine] Use getFreedOperand() (NFC)
Use getFreedOperand() instead of isFreeCall() to remove the
implicit assumption that any pointer operand to a free function
is the operand being freed. This won't actually matter until we
handle allockind(free).