Simon Pilgrim [Thu, 3 Mar 2022 12:07:48 +0000 (12:07 +0000)]
[X86][XOP] Tidyup VPHADD/VPHSUB unary horizontal ops default schedule class
Based off Agner and AMD SoG tables, the XOP VPHADD/VPHSUB unary horizontal ops are as fast as basic arithmetic ops, not the slower SSSE3 binary horizontal add/sub ops. This also matches what the bdver2 model already lists.
Noticed while investigating reduction add optimizations.
Sam Parker [Thu, 3 Mar 2022 11:47:02 +0000 (11:47 +0000)]
[NFC] TypePromotion test
Martin Storsjö [Sat, 26 Feb 2022 22:16:24 +0000 (00:16 +0200)]
Reapply [lit] Read command stdout/stderr as text on Windows
This takes care of normalizing newlines back to single LF instead
of CRLF.
Fix up a couple tests that accidentally pass binary data to stdout.
Differential Revision: https://reviews.llvm.org/D120623
Martin Storsjö [Tue, 22 Feb 2022 11:23:53 +0000 (13:23 +0200)]
[libcxx] [test] Fix get/put long_double_ru_RU on Glibc, FreeBSD and Windows
Note, reducing ios.width() in put_long_double instead of using variable
padding, when using a variable width symbol. Some of those tests didn't
actually trigger any padding in the existing form, with a longer
currency symbol; reduce the width so there's no actual padding with the
slightly shorter currency symbol either.
The tests for the international currency symbol use the same amount of
padding on all platforms, so they still exercise the padding properly.
Differential Revision: https://reviews.llvm.org/D120317
David Green [Thu, 3 Mar 2022 11:17:24 +0000 (11:17 +0000)]
[AArch64] Update costs for some fp16 converts
This updates the costs for FP16 converts, as some of them were pretty
high.
Differential Revision: https://reviews.llvm.org/D120771
Matthias Springer [Thu, 3 Mar 2022 10:50:32 +0000 (19:50 +0900)]
[mlir][linalg][bufferize] Migrate --linalg-bufferize to BufferizableOpInterface-based bufferization
This commit deletes the old dialect conversion-based bufferization patterns, which are now obsolete.
Differential Revision: https://reviews.llvm.org/D120883
David Green [Thu, 3 Mar 2022 10:42:57 +0000 (10:42 +0000)]
[AArch64] Vector shifts cost 1
The costs of vector shifts was 2 as opposed to 1, as the nodes are
marked custom. Fix this like the others and mark the nodes as cheap.
Differential Revision: https://reviews.llvm.org/D120773
LLVM GN Syncbot [Thu, 3 Mar 2022 10:33:40 +0000 (10:33 +0000)]
[gn build] Port
8bcbfb50e8ea
Simon Moll [Thu, 3 Mar 2022 10:31:42 +0000 (11:31 +0100)]
[VP] Introducing VectorBuilder, the VP intrinsic builder
VectorBuilder wraps around an IRBuilder and
VectorBuilder::createVectorInstructions emits VP intrinsics as if they
were regular instructions.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D105283
Andrzej Warzynski [Thu, 3 Mar 2022 10:24:35 +0000 (10:24 +0000)]
Revert "[mlir] Add extensible dialects"
This reverts commit
dbe9f0914fcfd8444fd9656821af0f1a34a27e7a.
The flang-x86_64-windows buildbot has been failing since this has been merged:
* https://lab.llvm.org/buildbot/#/builders/172/builds/9124
Similar failure was reported by the pre-commit CI.
Kristóf Umann [Fri, 4 Feb 2022 14:40:26 +0000 (15:40 +0100)]
[analyzer] Improve NoOwnershipChangeVisitor's understanding of deallocators
The problem with leak bug reports is that the most interesting event in the code
is likely the one that did not happen -- lack of ownership change and lack of
deallocation, which is often present within the same function that the analyzer
inlined anyway, but not on the path of execution on which the bug occured. We
struggle to understand that a function was responsible for freeing the memory,
but failed.
D105819 added a new visitor to improve memory leak bug reports. In addition to
inspecting the ExplodedNodes of the bug pat, the visitor tries to guess whether
the function was supposed to free memory, but failed to. Initially (in D108753),
this was done by checking whether a CXXDeleteExpr is present in the function. If
so, we assume that the function was at least party responsible, and prevent the
analyzer from pruning bug report notes in it. This patch improves this heuristic
by recognizing all deallocator functions that MallocChecker itself recognizes,
by reusing MallocChecker::isFreeingCall.
Differential Revision: https://reviews.llvm.org/D118880
Nikita Popov [Thu, 3 Mar 2022 10:05:31 +0000 (11:05 +0100)]
[InstCombine] Support opaque pointers in callee bitcast fold
To make this actually trigger, we also need to check whether the
function types differ, which is a hidden cast under opaque pointers.
The transform is somewhat less relevant there because it is
primarily about pointer bitcasts, but it can also happen with other
bit- or pointer-castable types.
Byval handling is easier with opaque pointers because there is no
need to adjust the byval type, we only need to make sure that it's
still a pointer.
David Spickett [Thu, 3 Mar 2022 10:04:07 +0000 (10:04 +0000)]
[lldb] Correct case in description of breakpoint --on-catch/throw
Somehow we ended up with catcH/throW.
Nikita Popov [Thu, 3 Mar 2022 09:49:00 +0000 (10:49 +0100)]
[InstCombine] Remove unnecessary byval check in callee cast fold
The logic for handling this was fixed in
8d7f118ab2b9e51d6cf2811291e319b4d977eb8c, but the check for byval
on the callee was retained. This resulted in a weird situation
where the transform would work depending on whether the byval
was only on the call or on both the call and the function.
Nikita Popov [Thu, 3 Mar 2022 09:47:19 +0000 (10:47 +0100)]
[InstCombine] Add callee bitcast test with byval on callee (NFC)
Same as the existing test, but the callee also has a byval
attribute.
Cullen Rhodes [Thu, 3 Mar 2022 09:20:22 +0000 (09:20 +0000)]
[AArch64] Allow copying of SVE registers in Streaming SVE
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D118562
Cullen Rhodes [Thu, 3 Mar 2022 09:20:13 +0000 (09:20 +0000)]
[AArch64] Add legal types for Streaming SVE
The compiler currently crashes for scalable types when compiling with
+sme, e.g.
define <vscale x 4 x i32> @foo(<vscale x 4 x i32> %a) {
ret <vscale x 4 x i32> %a
}
since it doesn't know how to legalize the types. SME implies a subset of
SVE (+streaming-sve), the hasSVE predication in the backend needs
extending to consider types/operations that are legal in Streaming SVE.
This is the first patch adding legal types <-> register classes. Before
making the change +sve(2) was temporarily replaced with +sme in all the
intrinsics tests to see what failed, and again after making the change.
For all the tests that passed after adding the legal types another RUN
line has been added for +streaming-sve. More patches to follow.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D118561
Haojian Wu [Mon, 28 Feb 2022 09:25:59 +0000 (10:25 +0100)]
[AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl.
Previously, we didin't build a DeclRefExpr which refers to an invalid declaration.
In this patch, we handle this case by building an empty RecoveryExpr,
which will preserve more broken code (AST parent nodes that contain the
RecoveryExpr is preserved in the AST).
Differential Revision: https://reviews.llvm.org/D120812
Nikita Popov [Thu, 3 Mar 2022 09:28:09 +0000 (10:28 +0100)]
[Scalarizer] Avoid pointer element type accesses
Pass through the load/store type to the Scatterer instead.
serge-sans-paille [Thu, 3 Mar 2022 09:19:10 +0000 (10:19 +0100)]
Add missing include under -DEXPENSIVE_CHECKS
This is a follow-up to
59630917d6cc7c4a273f617f92bf6190ee2992e1
Jean Perier [Thu, 3 Mar 2022 09:14:08 +0000 (10:14 +0100)]
[flang] Generate PDT runtime type info in the type definition scope
This patches modifies PDT runtime type info generation so that it is
easier to handle derived type descriptor in lowering. It changes three
aspects:
1. The symbol name suffix of runtime type info for PDT instantiation is
changed from a serial number unrelated to the types to an encoding of
the instantiated KIND parameters.
2. New runtime type info is not created for each instantiation of PDT without
KIND parameters (only length parameters). Instead, the runtime type
info of the type definition is always used. It is updated to contain
the component descriptions.
3. Runtime type info of PDT instantiation is now always generated in the
scope where the type is defined. If several PDT type instantiation
are made in different scope with the same kind parameters, they will
use the same runtime type info.
Rational of the change:
In lowering, derived type descriptors are not mapped when instantiating derived
type objects. They are mapped later when symbol knowledge is not available anymore.
This mapping is based on the FIR representation of derived types. For
PDT, the FIR type information does not allow deducing the instantiation
scope, it only allows retrieving the type name, the type _definition_
scope, and the kind parameter values. Therefore, in order to be able to
retrieve the derived type descriptor from a FIR type, the derived type
descriptor must be generated in the definition scope and must reflect
the kind parameters. This justifies the need for changes 1. and 3.
above (suffix and scope change). Changes 2. comes from the fact that
all runtime type info of type without kind parameters can be generated
from the type definition, and that because of the suffix change, the
symbol name for type definition and type instantiation are the same.
Although this change is first motivated by how lowering handles derived
types, I believe it is also an improvement from a functional point of
view since this change will allow reducing the number of generated
runtime type info for PDTs, since redundant information (different
instantiations with same kind parameters) will only be generated once.
Differential Revision: https://reviews.llvm.org/D120801
Jean Perier [Thu, 3 Mar 2022 09:11:19 +0000 (10:11 +0100)]
[flang] Handle optional TARGET associate in ASSOCIATED runtime
The TARGET argument of ASSOCIATED may be dynamically optional, in which
case ASSOCIATED(POINTER, TARGET) is equal to ASSOCIATED(TARGET).
Make the runtime argument a pointer so that it can detect and handle
arguments that are dynamically optional.
Also fix the runtime to check if TARGET base address is not null and if
its element size is not null to match the requirement of ASSOCIATED
regarding TARGET:
- if TARGET is an object: true iff [..] TARGET is not a zerosized storage sequence
- if TARGET is a POINTER: true iff [..] POINTER and TARGET are associated
Not that ASSOCIATED will also returns false if TARGET is an unallocated allocatable.
This is not described in the standard, but is a unanimous behaviour of
existing compilers.
Differential Revision: https://reviews.llvm.org/D120835
Jean Perier [Thu, 3 Mar 2022 09:07:34 +0000 (10:07 +0100)]
[flang] Support PDT type descriptors in codegen
This change updates the mapping of derived types and type descriptor
object names to support kind parametrized derived types (PDT).
It moves the custom name mapping to the internal name utility.
To improve robustness and error reporting, type descriptors are also now
required to be generated in all compilation unit that manipulates
derived types. The previous codegen relied on the fact that descriptors
not defined in the current FIR module were available externally. Errors
with missing type descriptors were only caught at link time.
This patch makes derived type definition mandatory, except if the
derived types are expected to not have derived type descriptors (builtin
types), or if the newly added debug switch `--ignore-missing-type-desc`
is set. In those cases, a null pointer is used as type descriptor
pointer. The debug switch intends to help testing FIR to LLVM passes
without having to bother providing type descriptor data structures that
are normally built by the front-end.
Differential Revision: https://reviews.llvm.org/D120804
Nikita Popov [Thu, 3 Mar 2022 08:59:06 +0000 (09:59 +0100)]
[llvm-stress] Support opaque pointers
With opaque pointers, generate the load/store type independently
of the pointer type.
Nikita Popov [Thu, 3 Mar 2022 08:40:28 +0000 (09:40 +0100)]
[DSE] Drop redundant WalkerStepLimit adjustment
There is a general WalkerStepLimit adjustment higher up in the
loop, and I don't see any reason why this particular case would
need additional adjustment. Furthermore, this could underflow.
jacquesguan [Mon, 21 Feb 2022 08:13:44 +0000 (16:13 +0800)]
[RISCV] Fold store of vmv.f.s to a vse with VL=1.
This patch support the FP part of D109482.
Differential Revision: https://reviews.llvm.org/D120235
Martin Storsjö [Wed, 19 Jan 2022 10:38:15 +0000 (10:38 +0000)]
[libcxx] [test] Fix the collate compare test for Glibc, Windows and FreeBSD
The old expected behaviour was specific to Apple platforms,
while Glibc, Windows and FreeBSD collate differently (ignoring
case). Make the old tested behaviour a special case for Apple
platforms, and make the default case the one used by the other
three.
In clang-cl/DLL configurations, the test is hit by
https://llvm.org/PR41018 (making the test fail to link).
Differential Revision: https://reviews.llvm.org/D120797
Martin Storsjö [Wed, 2 Mar 2022 10:33:31 +0000 (12:33 +0200)]
[LLD] [COFF] Order .debug_* sections at the end, to avoid leaving gaps if stripped
So far, we sort all discardable sections at the end, with only some
extra logic to make sure that the .reloc section is at the start
of that group of sections. But if there are other discardable
sections, other than .reloc, they must also be ordered before
.debug_* sections, to avoid leaving gaps if the executable is
stripped.
(Stripping executables doesn't remove all discardable sections,
only the ones named .debug_*).
Rust binaries seem to include a .rmeta section, which is marked
discardable. This fixes stripping such binaries if built with
dwarf debug info included.
This fixes issues observed in MSYS2 in
https://github.com/msys2/MINGW-packages/pull/10555.
Differential Revision: https://reviews.llvm.org/D120805
Peixin-Qiao [Thu, 3 Mar 2022 07:21:44 +0000 (15:21 +0800)]
[MLIR] Fix afterIP for dynamic worksharing-loop after collaping loops
The loopInfos gets invalidated after collapsing nested loops. Use the
saved afterIP since the returned afterIP by applyDynamicWorkshareLoop
may be not valid.
Reviewed By: shraiysh
Differential Revision: https://reviews.llvm.org/D120294
serge-sans-paille [Wed, 2 Mar 2022 15:38:19 +0000 (16:38 +0100)]
Cleanup includes: Transform/Scalar
Estimated impact on preprocessor output line:
before:
1062981579
after:
1062494547
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120817
serge-sans-paille [Tue, 1 Mar 2022 20:01:59 +0000 (21:01 +0100)]
Revert "Add missing include under EXPENSIVE_CHECK"
This reverts commit
eeaca53df7a030862bd1160950a6264aeb605cc6.
It's a duplicate of
https://reviews.llvm.org/rG50874a188b94a25827963956887b878d3701509a
Jonas Devlieghere [Thu, 3 Mar 2022 06:40:04 +0000 (22:40 -0800)]
[lldb] Update the CI docs
Remove the reproducer bot and the fedora bot.
Jonas Devlieghere [Thu, 3 Mar 2022 06:33:38 +0000 (22:33 -0800)]
[lldb] Update TestBasicEntryValues.py for `image lookup` output
Update TestBasicEntryValues.py for
15983c28aa81 which changes the output
for `image lookup -v`. This should fix the debian and macos build bots.
Danila Malyutin [Thu, 10 Feb 2022 14:31:03 +0000 (17:31 +0300)]
[Support][AArch64] Detect a few more host CPU features on AArch64
Add detecton for lse, sve and sve2 on linux
Differential Revision: https://reviews.llvm.org/D119435
Dominic Chen [Wed, 2 Mar 2022 06:54:59 +0000 (22:54 -0800)]
[lldb] Fix python errors in gdbremote.py
Fix exceptions encountered while debugging gdb protocol
Differential Revision: https://reviews.llvm.org/D120792
Kai Luo [Thu, 3 Mar 2022 02:08:22 +0000 (10:08 +0800)]
[PowerPC][atomics] Precommit test cases for i128 cmpxchg. NFC.
David Blaikie [Thu, 3 Mar 2022 02:05:11 +0000 (02:05 +0000)]
More bazel fixes.
Jonas Devlieghere [Thu, 3 Mar 2022 00:41:46 +0000 (16:41 -0800)]
[lldb] Skip check for the lldb prompt in TestIOHandlerProcessSTDIO
The check for the prompt isn't essential for this test. The check fail
on the lldb-arm-ubuntu because of what appears to be a missing space
after the prompt. Rather than disabling the test, let's see if we can
get it to pass without it.
David Blaikie [Thu, 3 Mar 2022 00:18:54 +0000 (00:18 +0000)]
More attempts at bazel fix
Peter Klausler [Thu, 24 Feb 2022 00:36:39 +0000 (16:36 -0800)]
[flang] Remove bogus messages for actual/dummy procedure argument compatibility
Add new IsCompatibleWith() member functions to many classes in evaluate::characteristics
that apply more nuanced compatibility checking for function results, dummy
arguments, and procedure interfaces than the previous tests for complete
equivalence. Use IsCompatibleWith() in semantics for call checking.
Differential Revision: https://reviews.llvm.org/D120844
Jonas Devlieghere [Wed, 2 Mar 2022 23:56:43 +0000 (15:56 -0800)]
[lldb] Update error messages in TestMemoryHistory.py
Update TestMemoryHistory.py for
daba82362228b4aa460c26079c028ebf832066fd
which changes the CommandObject & Disassemble error messages .
Jonas Devlieghere [Wed, 2 Mar 2022 23:38:02 +0000 (15:38 -0800)]
[lldb] Devirtualize IOHandler::{IsActive,SetIsDone,GetIsDone} (NFC)
There are no implementations overriding these methods.
Differential revision: https://reviews.llvm.org/D120766
Jonas Devlieghere [Wed, 2 Mar 2022 19:59:55 +0000 (11:59 -0800)]
[lldb] Avoid data race in IOHandlerProcessSTDIO
This patch fixes a data race in IOHandlerProcessSTDIO. The race is
happens between the main thread and the event handling thread. The main
thread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when an
event comes in that makes us pop the process IO handler which involves
cancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The latter
calls SetIsDone(true) which modifies m_is_done. At the same time, we
have the main thread reading the variable through GetIsDone().
This patch avoids the race by using a mutex to synchronize the two
threads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method,
we obtain the lock before changing the value of m_is_done. On the main
thread, in IOHandlerProcessSTDIO::Run(), we obtain the lock before
reading the value of m_is_done. Additionally, we delay calling SetIsDone
until after the loop exists, to avoid a potential race between the two
writes.
Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688):
#0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84)
#1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec)
#2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8)
#3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c)
#4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c)
#5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr<lldb_private::Event> const&) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc)
#6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0)
#7 std::__1::__function::__func<lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator<lldb_private::Debugger::StartEventHandlerThread()::$_2>, void* ()>::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8)
#8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac)
#9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544)
Previous read of size 1 at 0x00010b66bb68 by main thread:
#0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8)
#1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c)
#2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c)
#3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478)
#4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604)
#5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294)
#6 main Driver.cpp:853 (lldb:arm64+0x100007344)
Differential revision: https://reviews.llvm.org/D120762
Stanislav Mekhanoshin [Wed, 2 Mar 2022 23:35:08 +0000 (15:35 -0800)]
[AMDGPU] Removed XFAIL from hsa-gfx940-v3.s. NFC.
Handling of big endian was fixed in D88858.
Aakanksha [Wed, 2 Mar 2022 23:23:40 +0000 (23:23 +0000)]
[AMDGPU] Add gfx1036 target
Differential Revision: https://reviews.llvm.org/D120846
Peter Klausler [Fri, 18 Feb 2022 18:17:04 +0000 (10:17 -0800)]
[flang] Extend ProvenanceRange::Suffix() to handle crash case
Suffix() can be called from AllSources::IntersectionWithSourceFiles()
when a contiguous range of source provenance overlaps a macro expansion.
It skips over the macro expansion and recurses on the remainder of
the range, which might end with a bit that does overlap with a
source file. However, in the case where the original range is
entirely within the expanded macro, Suffix() crashes when called
with a skip offset greater than the size of the range.
Rather than add logic around this and other calls to Suffix() to
avoid passing an out-of-range skip, it's better to accommodate it
in Suffix() and return an empty result.
Differential Revision: https://reviews.llvm.org/D120843
Peter Klausler [Wed, 2 Mar 2022 22:04:02 +0000 (14:04 -0800)]
[flang] Avoid bogus warning from MSVC build
And expand common::BitSet from 64 to 128 maximum elements.
Differential Revision: https://reviews.llvm.org/D120848
Stanislav Mekhanoshin [Wed, 2 Mar 2022 22:36:58 +0000 (14:36 -0800)]
[AMDGPU] Fix 3 tests with expensive checks. NFC.
Image instructions are now not available for all targets anymore,
so a generic target cannot use it.
Arthur O'Dwyer [Wed, 2 Mar 2022 22:39:31 +0000 (17:39 -0500)]
[libc++] Preliminary cleanups to ranges::iter_move. NFC.
This is just getting some non-functional cleanups out of the way
prior to the meat of the change in D120417.
Zequan Wu [Wed, 2 Mar 2022 22:20:08 +0000 (14:20 -0800)]
[LLDB] Add error message when using --show-variable-ranges without -v
Stanislav Mekhanoshin [Tue, 1 Mar 2022 20:43:35 +0000 (12:43 -0800)]
[AMDGPU] gfx940 removes all image instructions
Differential Revision: https://reviews.llvm.org/D120763
Stanislav Mekhanoshin [Mon, 28 Feb 2022 22:20:12 +0000 (14:20 -0800)]
[AMDGPU] Add gfx940 target
This is target definition only.
Differential Revision: https://reviews.llvm.org/D120688
David Blaikie [Wed, 2 Mar 2022 21:45:25 +0000 (21:45 +0000)]
Zequan Wu [Wed, 16 Feb 2022 19:18:54 +0000 (11:18 -0800)]
[LLDB] Dump valid ranges of variables
This allows `image lookup -a ... -v` to print variables only if the given
address is covered by the valid ranges of the variables. Since variables created
in dwarf plugin always has empty scope range, print the variable if it has
empty scope.
Differential Revision: https://reviews.llvm.org/D119963
Sanjay Patel [Wed, 2 Mar 2022 20:03:35 +0000 (15:03 -0500)]
[SDAG] refactor foldSetCCWithRotate; NFC
There are more potential optimizations to make here,
so rearrange to make it easier to append those.
Sanjay Patel [Wed, 2 Mar 2022 19:49:05 +0000 (14:49 -0500)]
[x86] add nounwind attribute to test; NFC
This will avoid some noise in case the register allocation changes.
Pavel Labath [Wed, 2 Mar 2022 20:12:49 +0000 (21:12 +0100)]
[lldb] Explicitly declare the default constructor in PlatformAndroidRemoteGDBServer
MSVC does not seem to like the inheriting constructor.
Martin Storsjö [Tue, 18 Jan 2022 10:48:12 +0000 (10:48 +0000)]
[libcxx] [test] Fix en_US money locale formatting tests on Windows
In the en_US locale on Windows, negative currency amounts is formatted
as "($0.01)" instead of "-$0.01".
Adjust the test references accordingly, making these tests pass.
Differential Revision: https://reviews.llvm.org/D120798
River Riddle [Tue, 1 Mar 2022 21:30:14 +0000 (13:30 -0800)]
[mlir][SPIRV] Split up StandardToSPIRV now that the Standard dialect is gone
StandardToSPIRV currently contains an assortment of patterns converting from
different dialects to SPIRV. This commit splits up StandardToSPIRV into separate
conversions for each of the dialects involved (some of which already exist).
Differential Revision: https://reviews.llvm.org/D120767
spupyrev [Mon, 31 Jan 2022 17:59:45 +0000 (09:59 -0800)]
[CSSPGO] Even flow distribution
Differential Revision: https://reviews.llvm.org/D118640
Peter Klausler [Fri, 18 Feb 2022 22:58:12 +0000 (14:58 -0800)]
[flang] Accommodate module subprograms defined in the same module
The symbol table, name resolution, and semantic checks for module
subprograms -- esp. for MODULE FUNCTION and MODULE SUBROUTINE, but
also MODULE PROCEDURE -- essentially assumed that the subprogram
would be defined in a submodule of the (sub)module containing its
interface. However, it is conforming to instead declare a module
subprogram in the *same* (sub)module as its interface, and we need
to handle that case.
Since this case involves two symbols in the same scope with the same
name, the symbol table details for subprograms have been extended
with a pointer to the original module interface, rather than relying
on searching in scopes.
Differential Revision: https://reviews.llvm.org/D120839
Krzysztof Parzyszek [Wed, 2 Mar 2022 18:02:52 +0000 (10:02 -0800)]
[Hexagon] Recognize "access size" for dcfetch
Dcfetch doesn't really have an access size, but the immediate
offset is scaled as for an 8-byte access, so treat it as such.
Mathieu Fehr [Wed, 2 Mar 2022 20:17:06 +0000 (12:17 -0800)]
[mlir] Add extensible dialects
Add support for extensible dialects, which are dialects that can be
extended at runtime with new operations and types.
These operations and types cannot at the moment implement traits
or interfaces.
Differential Revision: https://reviews.llvm.org/D104554
Peter Klausler [Fri, 18 Feb 2022 01:22:09 +0000 (17:22 -0800)]
[flang] Catch READ/WRITE on direct-access file without REC=
A data transfer statement must have REC= in its control list
if (and only if) the unit was opened with ACCESS='DIRECT'.
The runtime wasn't catching this error, but was just silently
advancing to the next record as if the access were sequential.
Differential Revision: https://reviews.llvm.org/D120838
natashaknk [Mon, 28 Feb 2022 23:49:50 +0000 (15:49 -0800)]
[tosa][mlir] Add support for dynamic width/height for Conv2D inputs in tosa-to-linalg
Infers output shape for dynamic width/height inputs.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D119977
Peter Klausler [Thu, 17 Feb 2022 23:32:06 +0000 (15:32 -0800)]
[flang] Honor RECL= in list-directed/namelist output
Advancement to new output lines was taking fixed-sized direct-access
and internal character array element lengths into account, but not
RECL= settings from OPEN statements.
Differential Revision: https://reviews.llvm.org/D120837
Craig Topper [Wed, 2 Mar 2022 18:55:18 +0000 (10:55 -0800)]
[RISCV] More correctly ignore Zfinx register classes in getRegForInlineAsmConstraint.
Until Zfinx is supported in CodeGen we need to convert all Zfinx
register classes to GPR.
Remove the zfinx-types.ll test which didn't test anything meaningful
since -mattr=zfinx isn't implemented completely in llc.
Follow up to D93298.
Tong Zhang [Wed, 2 Mar 2022 19:18:54 +0000 (11:18 -0800)]
[clang][CGStmt] fix crash on invalid asm statement
Clang is crashing on the following statement
char var[9];
__asm__ ("" : "=r" (var) : "0" (var));
This is similar to existing test: crbug_999160_regtest
The issue happens when EmitAsmStmt is trying to convert input to match
output type length. However, that is not guaranteed to be successful all the
time and if the statement itself is invalid like having an array type in
the example, we should give a regular error message here instead of
using assert().
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D120596
Jason Molenda [Wed, 2 Mar 2022 19:17:01 +0000 (11:17 -0800)]
Refine error msgs from CommandObject & Disassemble
Make it clearer for end users why a command cannot be used
when a process is not stopped, etc.
Differential Revision: https://reviews.llvm.org/D120594
Vladislav Khmelevsky [Tue, 25 Jan 2022 00:22:47 +0000 (03:22 +0300)]
[BOLT] Enable PLT analysis for aarch64
This patch enables PLT analysis for aarch64. It is used by the static
relocations in order to provide final symbol address of PLT entry for some
instructions like ADRP.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D118088
Stella Laurenzo [Wed, 2 Mar 2022 19:13:46 +0000 (11:13 -0800)]
Revert "[cmake] Prefix gtest and gtest_main with "llvm_"."
lldb buildbot failure. will investigate and roll forward.
This reverts commit
9f37775472b45986b0ecce5243bd6ce119e5bd69.
Douglas Yung [Wed, 2 Mar 2022 19:11:52 +0000 (11:11 -0800)]
Add "REQUIRES: x86" to test as it calls llc with an x86_64 triple.
Peter Klausler [Wed, 16 Feb 2022 01:04:30 +0000 (17:04 -0800)]
[flang] Fix result type of "procedure(abs) :: f"
Name resolution was properly probing the table of unrestricted
specific intrinsics to find "abs", but failing to capture the
result type and save it in the created symbol table entry.
Differential Revision: https://reviews.llvm.org/D120749
Valentin Clement [Wed, 2 Mar 2022 17:31:12 +0000 (18:31 +0100)]
[flang] Lower more cases of assignments on allocatable variables
This patch enables the lowering of various allocatable assignements
for character type and numeric types.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120819
Reviewed By: PeteSteinfeld, schweitz
Differential Revision: https://reviews.llvm.org/D120820
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Stella Laurenzo [Wed, 2 Mar 2022 18:17:05 +0000 (10:17 -0800)]
[cmake] Prefix gtest and gtest_main with "llvm_".
The upstream project ships CMake rules for building vanilla gtest/gmock which conflict with the names chosen by LLVM. Since LLVM's build rules here are quite specific to LLVM, prefixing them to avoid collision is the right thing (i.e. there does not appear to be a path to letting someone *replace* LLVM's googletest with one they bring, so co-existence should be the goal).
This allows LLVM to be included with testing enabled within projects that themselves have a dependency on an official gtest release.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D120789
Philip Reames [Wed, 2 Mar 2022 18:40:10 +0000 (10:40 -0800)]
Reapply "[SLP] Schedule only sub-graph of vectorizable instructions""
Root issue which triggered the revert was fixed in 689bab. No changes in the reapplied patch.
Original commit message follows:
SLP currently schedules all instructions within a scheduling window which stretches from the first instr
uction potentially vectorized to the last. This window can include a very large number of unrelated instruct
ions which are not being considered for vectorization. This change switches the code to only schedule the su
b-graph consisting of the instructions being vectorized and their transitive users.
This has the effect of greatly reducing the amount of work performed in large basic blocks, and thus greatly improves compile time on degenerate examples. To understand the effects, I added some statistics (not planned for upstream contribution). Here's an illustration from my motivating example:
Before this patch:
704357 SLP - Number of calcDeps actions
699021 SLP - Number of schedule calls
5598 SLP - Number of ReSchedule actions
59 SLP - Number of ReScheduleOnFail actions
10084 SLP - Number of schedule resets
8523 SLP - Number of vector instructions generated
After this patch:
102895 SLP - Number of calcDeps actions
161916 SLP - Number of schedule calls
5637 SLP - Number of ReSchedule actions
55 SLP - Number of ReScheduleOnFail actions
10083 SLP - Number of schedule resets
8403 SLP - Number of vector instructions generated
I do want to highlight that there is a small difference in number of generated vector instructions. This example is hitting the bailout due to maximum window size, and the change in scheduling is slightly perturbing when and how we hit it. This can be seen in the RescheduleOnFail counter change. Given that, I think we can safely ignore.
The downside of this change can be seen in the large test diff. We group all vectorizable instructions together at the bottom of the scheduling region. This means that vector instructions can move quite far from their original point in code. While maybe undesirable, I don't see this as being a major problem as this pass is not intended to be a general scheduling pass.
For context, it's worth noting that the pre-scheduling that SLP does while building the vector tree is exactly the sub-graph scheduling implemented by this patch.
Differential Revision: https://reviews.llvm.org/D118538
Louis Dionne [Wed, 2 Mar 2022 18:28:34 +0000 (13:28 -0500)]
[NFC] Fix typo in CMake comment
Philip Reames [Wed, 2 Mar 2022 17:58:26 +0000 (09:58 -0800)]
[SLP] Don't try to vectorize allocas
While a collection of allocas are technically vectorizeable - by forming a wider alloca - this was not a transform SLP actually knows how to do. Instead, we were forming a bundle with missing dependencies, and then relying on the scheduling code to preserve program order if multiple instructions were scheduleable at once. I haven't been able to write a test case, but I'm 99% sure this was wrong in some edge case.
The unknown op case was flowing down the shufflevector path. This did result in some splat handling being lost with this change, but the same lack of splat handling is visible in a whole bunch of simple examples for the gather path. I didn't consider this interesting to fix given how narrow the splat of allocas case is.
David Green [Wed, 2 Mar 2022 18:07:14 +0000 (18:07 +0000)]
[AArch64] Add some fp16 conversion cost tests. NFC
Joseph Huber [Wed, 2 Mar 2022 17:38:29 +0000 (12:38 -0500)]
[OpenMP] Handle sysroot option in offloading linker wrapper
Summary:
This patch correctly handles the `--sysroot=` option when passed to the
linker wrapper. This allows users to correctly find libraries that may
contain offloading code if using this option.
William S. Moses [Wed, 2 Mar 2022 17:40:21 +0000 (12:40 -0500)]
[MLIR] Use Datalayout defaults when importing LLVM
LLVM defines several default datalayouts for integer and floating point types that are not being considered when importing into MLIR. This patch remedies this.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D120832
Craig Topper [Wed, 2 Mar 2022 18:00:11 +0000 (10:00 -0800)]
Revert "[LegalizeTypes][VP] Add splitting and widening support for VP_FNEG."
This reverts commit
ac93f95861268c058d3f3bffd447a594a793c6b3.
Committed by accident.
Stephen Long [Wed, 2 Mar 2022 17:55:35 +0000 (09:55 -0800)]
[LoopPeel] Add EXPENSIVE_CHECKS ifdef guard around domtree verify call
The verify call was taking 50% of the compile time in our internal LLVM
fork when trying to unroll many loops.
Differential Revision: https://reviews.llvm.org/D113028
Craig Topper [Wed, 2 Mar 2022 17:47:24 +0000 (09:47 -0800)]
[SelectionDAG][RISCV] Emit a canonical sign bit test from ExpandIntRes_ABS.
Instead of emitting 0 > Hi, emit Hi < 0. If Hi needs to be expanded again
this will allow the special case for sign bit tests in ExpandIntOp_SETCC
to trigger.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D120761
Craig Topper [Wed, 2 Mar 2022 17:42:43 +0000 (09:42 -0800)]
[RISCV] Don't combine ROTR ((GREV x, 24), 16)->(GREV x, 8) on RV64.
This miscompile was introduced in D119527.
This was a special pattern for rotate+bswap on RV32. It doesn't
work for RV64 since the rotate needs to be half the bitwidth. The
equivalent pattern for RV64 is ROTR ((GREV x, 56), 32) so match
that instead.
This could be generalized further as noted in the new FIXME.
Reviewed By: Chenbing.Zheng
Differential Revision: https://reviews.llvm.org/D120686
Craig Topper [Wed, 2 Mar 2022 00:10:22 +0000 (16:10 -0800)]
[LegalizeTypes][VP] Add splitting and widening support for VP_FNEG.
Differential Revision: https://reviews.llvm.org/D120785
William S. Moses [Tue, 1 Mar 2022 22:02:14 +0000 (17:02 -0500)]
[MLIR][OpenMP] Place alloca scope within wsloop in scf.parallel to omp lowering
https://reviews.llvm.org/D120423 replaced the use of stacksave/restore with memref.alloca_scope, but kept the save/restore at the same location. This PR places the allocation scope within the wsloop, thus keeping the same allocation scope as the original scf.parallel (e.g. no longer over stack allocating).
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D120772
Philip Reames [Wed, 2 Mar 2022 17:42:00 +0000 (09:42 -0800)]
[slp] Add tests for cause of D118538 revert
Nikolas Klauser [Wed, 2 Mar 2022 17:40:39 +0000 (18:40 +0100)]
[libc++] Check clang-tidy version
Reviewed By: ldionne, #libc
Spies: libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D120087
Sander de Smalen [Wed, 2 Mar 2022 16:03:33 +0000 (16:03 +0000)]
[AArch64][SME] Don't infer -neon from +streaming-sve.
In Streaming SVE mode full NEON is not available, even though this is
implied from armv8-a. LLVM previously inferred that NEON needed to be
disabled when setting +streaming-sve, but there is no need to infer
this from +streaming-sve, because we can explicitly disable NEON using
LLVM's attribute mechanism. This is specifically relevant because
+streaming-sve is not a user-facing feature, but rather an LLVM internal
feature.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D120809
Simon Pilgrim [Wed, 2 Mar 2022 17:29:11 +0000 (17:29 +0000)]
[X86] Enable v32i16 FSHL/FSHR support
Now that we've improved splat detection we no longer see regressions in the funnel-shift-by-splat-amount test cases
William S. Moses [Sat, 26 Feb 2022 19:40:51 +0000 (14:40 -0500)]
[MLIR][Arith] Canonicalize cmpi of extui/extsi
Canonicalize cmpi(eq, ext a, ext b) and cmpi(ne, ext a, ext b)
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D120620
Valentin Clement [Wed, 2 Mar 2022 17:26:13 +0000 (18:26 +0100)]
[flang] Handle module in lowering pass
This patch enables the lowering of basic modules and functions/subroutines
in modules.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D120819
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Arthur O'Dwyer [Wed, 2 Mar 2022 17:15:19 +0000 (12:15 -0500)]
[libc++] Add missing std:: qualification to __synth_three_way.
This might be unobservable, since __synth_three_way is only ever
called as a result of using an (ADL) operator on std::pair or std::tuple.
Valentin Clement [Wed, 2 Mar 2022 17:02:41 +0000 (18:02 +0100)]
[flang] Lower inquire statement
This patch adds the lowering of the `inquire` statement.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120822
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D120823
Co-authored-by: Jean Perier <jperier@nvidia.com>
Valentin Clement [Wed, 2 Mar 2022 16:58:38 +0000 (17:58 +0100)]
[flang] Lower basic IO file statements
This patches adds lowering for couple of basic io statements such as `flush`,
`endfile`, `backspace` and `rewind`
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120821
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D120822
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
William S. Moses [Mon, 28 Feb 2022 14:57:35 +0000 (09:57 -0500)]
[MLIR][Arith] Add constant folder for left shift
Add constant folder for left shift
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D120661
Akira Hatanaka [Wed, 2 Mar 2022 16:55:42 +0000 (08:55 -0800)]
[NFC][Clang][OpaquePtr] Remove the call to Address::deprecated in
CreatePointerBitCastOrAddrSpaceCast
Differential Revision: https://reviews.llvm.org/D120757
Valentin Clement [Wed, 2 Mar 2022 16:55:10 +0000 (17:55 +0100)]
[flang] Lower IO open and close statements
This patch adds the lowering of open and close statements
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D120821
Co-authored-by: Jean Perier <jperier@nvidia.com>
Marek Kurdej [Wed, 2 Mar 2022 08:35:07 +0000 (09:35 +0100)]
[clang-format] Recognize "if consteval".
Fixes https://github.com/llvm/llvm-project/issues/54140.
Reviewed By: MyDeveloperDay, JohelEGP
Differential Revision: https://reviews.llvm.org/D120806