Commit Graph

398811 Commits

Author SHA1 Message Date
Pavel Labath b03126768a [lldb] Remove PluginInterface::GetPluginVersion
In all these years, we haven't found a use for this function (it has
zero callers). Lets just remove the boilerplate.

Differential Revision: https://reviews.llvm.org/D109600
2021-09-13 10:29:00 +02:00
Max Kazantsev 7e337d8ba2 [Test] Add more sophisticated tests for switch UB opt
Optimizer is being too smart with existing tests, and the transform
gets concealed by following transforms.
2021-09-13 15:28:23 +07:00
Jim Lin f29336104d [RISCV] Rename prefix `FeatureExt*` to `FeatureStdExt*` for all sub-extension
Rename prefix `FeatureExt*` to `FeatureStdExt*` for all sub-extension for consistency

Reviewed By: HsiangKai, asb

Differential Revision: https://reviews.llvm.org/D108187
2021-09-13 16:24:15 +08:00
Esme-Yi ea81898d0f [XCOFF] Fix the program abortion issue in XCOFFObjectFile::getSectionContents.
Summary: Use std::move(E) to avoid `Program aborted due to an unhandled Error`

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D109567
2021-09-13 07:54:33 +00:00
Simon Pilgrim 65ad09da0e [X86][SLM] Fix DIVPD/DIVPS/RCPPS/RSQRTPS/SQRTPD/SQRTPS/DPPD/DPPS uops, latency and throughput
The packed variants of the instructions had been modelled as the same as the scalar variants.

Reported during a run of llvm-exegesis on a cheap SLM box and matches what Agner / InstLatX64 report as well.
2021-09-13 08:36:43 +01:00
Simon Pilgrim 6d970e83fa [InstCombine] Add PR51784 test cases 2021-09-13 08:36:43 +01:00
Raphael Isemann 4b2e38d940 [lldb][NFC] Cleanup EditlineHistory 2021-09-13 09:30:31 +02:00
luxufan ff6069b891 [JITLink] Add initial native TLS support to ELFNix platform
This patch use the same way as the https://reviews.llvm.org/rGfe1fa43f16beac1506a2e73a9f7b3c81179744eb to handle the thread local variable.

It allocates 2 * pointerSize space in GOT to represent the thread key and data address. Instead of using the _tls_get_addr function, I customed a function __orc_rt_elfnix_tls_get_addr to get the address of thread local varible. Currently, this is a wip patch, only one TLS relocation R_X86_64_TLSGD is supported and I need to add the corresponding test cases.

To allocate the TLS  descriptor in GOT, I need to get the edge kind information in PerGraphGOTAndPLTStubBuilder, So I add a `Edge::Kind K` argument in some functions in PerGraphGOTAndPLTStubBuilder.h. If it is not suitable, I can think further to solve this problem.

Differential Revision: https://reviews.llvm.org/D109293
2021-09-13 14:35:49 +08:00
Mathieu Fehr 802bf02a73 [mlir] Allows to query traits from types and attributes
Types and attributes now have a `hasTrait` function that allow users to check
if a type defines a trait.
Also, AbstractType and AbstractAttribute has now a `hasTraitFn` field to carry
the implementation of the `hasTrait` function of the concrete type or attribute.
This patch also adds the remaining functions to access type and attribute traits
in TableGen.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D105202
2021-09-13 06:26:45 +00:00
Mehdi Amini 7fb2394a4f Add sanity check in MLIR ODS to catch case where an arguments/results/regions/successors names overlap
This is making a tablegen crash with a more friendly error.

Differential Revision: https://reviews.llvm.org/D109474
2021-09-13 06:21:25 +00:00
Jan Kratochvil ff94f60240 [lldb] [testsuite] Fix false failures on "\n" regex match
Regex is matching a binary so it needs `re.DOTALL`.
vFile:fstat packet data ATTACHMENT is not hex-encoded but it is only
escaped.

It is difficult to reproduce, it came from buildbot:
  https://lab.llvm.org/staging/#/builders/16/builds/10597

******************** TEST 'lldb-api :: tools/lldb-server/TestGdbRemotePlatformFile.py' FAILED ********************
FAIL: test_platform_file_fstat_llgs (TestGdbRemotePlatformFile.TestGdbRemotePlatformFile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 52, in test_method
    return attrvalue(self)
  File "lldb/test/API/tools/lldb-server/TestGdbRemotePlatformFile.py", line 259, in test_platform_file_fstat
    context = self.expect_gdbremote_sequence()
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py", line 621, in expect_gdbremote_sequence
    return expect_lldb_gdbserver_replay(
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 198, in expect_lldb_gdbserver_replay
    context = sequence_entry.assert_match(
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 479, in assert_match
    return self._assert_regex_match(asserter, actual_packet, context)
  File "lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py", line 446, in _assert_regex_match
    asserter.fail(
AssertionError: regex '^\$F([0-9a-fA-F]+);(.*)#[0-9a-fA-F]{2}$' failed to match against content '$F40;^@^@^@ ^@
^C<8d>^@^@<81><80>^@^@^@^A^@^@^CX^@^@^CX^@^@^@^@^@^@^@^@^@^@^@^W^@^@^@^@^@^@^P^@^@^@^@^@^@^@^@
a=XXa=XXa=XX#6b'
2021-09-13 07:35:12 +02:00
Vignesh Balasubramanian 939154125b [OpenMP] [OMPD] OPENMP_INSTALL_LIBDIR is set for the install dir
OPENMP_INSTALL_LIBDIR is set to the installation path of shared and static
libompd.This should avoid the mixing of 32 and 64 bit on same path in
multi-lib set-up.

Reviewed By: @mceier
Differential Revision: https://reviews.llvm.org/D109352
2021-09-13 10:25:50 +05:30
Tom Praschan 5a85f9b1d4 Add semantic token modifier for non-const reference parameter
See https://github.com/clangd/clangd/issues/839

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D108320
2021-09-13 00:51:09 -04:00
Arthur Eubanks 6a92ab07cb [NFC][CoroSplit] Directly use Function::getFunctionType() 2021-09-12 21:34:19 -07:00
Max Kazantsev d9ca444835 [IndVars] Break backedge and replace PHIs if loop exits on 1st iteration
Implement TODO in optimizeLoopExits. Now if we have proved that some loop exit
is taken on 1st iteration, we make all branches in the following exiting blocks
always branch out of the loop and their conditions simplified away.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D108910
Reviewed By: lebedev.ri
2021-09-13 11:30:55 +07:00
Max Kazantsev 5a6dfb27ca [IndVars] Replace PHIs if loop exits on 1st iteration
This is a part of D108910.
We replace all loop PHIs with values coming from the loop preheader if
we proved that backedge is never taken.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D109596
Reviewed By: lebedev.ri
2021-09-13 10:50:33 +07:00
Arthur Eubanks d48a3f9f75 [NFC] Directly use OpenMPIRBuilder::Ident instead of IdentPtr->getPointerElementType() 2021-09-12 20:45:44 -07:00
Ahsan Saghir 203cd01b54 [PowerPC] [NFC] Add Big-Endian checks for existing MMA tests
This patch adds Big-Endian checks for the existing MMA test cases.
It also changes the target for these test cases to pwr10.

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D109126
2021-09-12 20:39:27 -05:00
Kuter Dinel 9a193bdc81 [Attributor][FIX] AACallEdges, fix propagation error.
This patch fixes a error made in 2cc6f7c8e1. That patch
added a call site position but there was a small error with the way
the presence of a unknown call edge was being propagated from call site
to function. This patch fixes that error. This error was effecting some
AMDGPU tests.
2021-09-13 03:45:26 +03:00
Arthur Eubanks f94a118a6e [NFC] Avoid using pointee types in PPCISelLowering
A cmpxchg's new value type is the same as the pointer operand's pointee type.
2021-09-12 17:37:35 -07:00
Craig Topper 283879793d [RISCV] Initial support .insn directive for the assembler.
This allows for a custom encoding to be emitted. It can also be
used with inline assembly to allow the custom instruction to be
register allocated like other instructions.

I initially started from SystemZ's implementation, but some of
the formats allow operands to be specified in multiple ways so I
had to add support for matching different operand class lists for
the same format. That implementation is a simplified version of
what is emitted by tablegen for regular instructions.

I've left out the compressed formats. And I haven't supported the
named opcodes like LUI or OP_IMM_32. Those can be added in future
patches.

Documentation can be found here https://sourceware.org/binutils/docs-2.37/as/RISC_002dV_002dFormats.html

Reviewed By: jrtc27, MaskRay

Differential Revision: https://reviews.llvm.org/D108602
2021-09-12 15:56:12 -07:00
Kuter Dinel 66a0b3464c [Attributor] AAFunctionReachability, Handle CallBase Reachability.
This patch makes it possible to query callbase reachability
(Can a callbase reach a function Fn transitively).
The patch moves the reachability query handling logic to a member class,
this class will have more users within the AA once we add other function
reachability queries.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D106402
2021-09-13 01:35:44 +03:00
Kuter Dinel 2cc6f7c8e1 [Attributor] Create a call site position for AACalledges
This patch adds a call site position for AACallEdges, this
allows us to ask questions about which functions a specific
`CallBase` might call.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D106208
2021-09-13 01:17:05 +03:00
Usman Nadeem fb7fbe4314 [NFC][SVE] Precommit tests for adr instruction
Change-Id: I8148481a5ce3b721113327cc9b684f091cae5a8d
2021-09-12 15:06:28 -07:00
Florian Hahn 368af7558e
[VPlan] Fix crash caused by not updating all users properly.
Users of VPValues are managed in a vector, so we need to be more
careful when iterating over users while updating them. For now, just
copy them.

Fixes 51798.
2021-09-12 18:10:53 +01:00
Nikita Popov 4189e5fe12 [CGP] Support opaque pointers in address mode fold
Rather than inspecting the pointer element type, use the access
type of the load/store/atomicrmw/cmpxchg.

In the process of doing this, simplify the logic by storing the
address + type in MemoryUses, rather than an Instruction + Operand
pair (which was then used to fetch the address).
2021-09-12 17:43:37 +02:00
Kazu Hirata 8e86c0e4f4 [Scalar] Use make_early_inc_range (NFC) 2021-09-12 08:17:18 -07:00
Sanjay Patel 3a126134d3 [InstCombine] remove casts from splat-a-bit pattern
https://alive2.llvm.org/ce/z/_AivbM

This case seems clear since we can reduce instruction count
and avoid an intermediate type change, but we might want to
use mask-and-compare for other sequences.

Currently, we can generate more instructions on some related
patterns by trying to use bit-hacks instead of mask+cmp, so
something is not behaving as expected.
2021-09-12 09:18:14 -04:00
Sam Clegg b78c85a44a [WebAssembly] Convert to new "dylink.0" section format
This format is based on sub-sections (like the "linking" and "name"
sections) and is therefore easier to extend going forward.

spec change: https://github.com/WebAssembly/tool-conventions/pull/170
binaryen change: https://github.com/WebAssembly/binaryen/pull/4141
wabt change:  https://github.com/WebAssembly/wabt/pull/1707
emscripten change: https://github.com/emscripten-core/emscripten/pull/15019

Differential Revision: https://reviews.llvm.org/D109595
2021-09-12 05:30:38 -07:00
David Green d338e535ec [AArch64] Regenerate some test checks. NFC
This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.
2021-09-12 12:13:29 +01:00
Kiran Chandramohan 187d9f8cd9 [OpenMP][MLIR] Add a conversion pattern for the master op
The conversion pattern is particularly useful for conversion of
block arguments in the master op.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D109610
2021-09-12 10:13:40 +00:00
Mara Sophie Grosch 339c734042 [Clang][AVR] Fix definitions on AVR target
Fix definitions for MCUs xmega16a4u and xmega128a4u to match avr-libc

Differential Revision: https://reviews.llvm.org/D109653
2021-09-12 11:00:59 +02:00
Lang Hames a539a847c9 [ORC] Temporarily remove the lljit-with-remote-debugging test.
This is broken now that llvm-jitlink-executor uses SimpleRemoteEPC.

The example will be updated to use SimpleRemoteEPC in a future commit.
2021-09-12 18:52:30 +10:00
Lang Hames b64fc0af9a [ORC] Add bootstrap symbols to ExecutorProcessControl.
Bootstrap symbols are symbols whose addresses may be required to bootstrap
the rest of the JIT. The bootstrap symbols map generalizes the existing
JITDispatchInfo class provide an arbitrary map of symbol names to addresses.

The JITDispatchInfo class will be replaced by bootstrap symbols with reserved
names in upcoming commits.
2021-09-12 18:49:43 +10:00
Lang Hames e339303776 [ORC] Add OrcTargetProcess dependency on LLVM_PTHREAD_LIB 2021-09-12 18:17:06 +10:00
Lang Hames 698a598cf7 [ORC] Add OrcShared dependency on LLVM_PTHREAD_LIB 2021-09-12 16:02:02 +10:00
Lang Hames d193d23795 [ORC] Fix missing std::move 2021-09-12 15:27:19 +10:00
Lang Hames d11a0c5d91 [ORC] Fix out-of-range comparison errors. 2021-09-12 14:48:05 +10:00
Lang Hames fcf4e25be5 [ORC] Fix missing '&' in definition of deleted move-assignment. 2021-09-12 14:48:04 +10:00
LLVM GN Syncbot d06691481d [gn build] Port bb72f07380 2021-09-12 04:32:13 +00:00
Lang Hames bb72f07380 Re-apply bb27e45643 and 5629afea91 with fixes.
This reapplies bb27e45643 (SimpleRemoteEPC
support) and 2269a941a4 (#include <mutex>
fix) with further fixes to support building with LLVM_ENABLE_THREADS=Off.
2021-09-12 14:23:22 +10:00
Kazu Hirata 15e9575fb5 [Vectorize] Fix "unused variable" warnings 2021-09-11 12:06:43 -07:00
Arthur O'Dwyer 2b4cad5e47 [clang] Enable the special enable_if_t diagnostics for libc++'s __enable_if_t as well.
This comes from lengthy discussion between Quuxplusone and ldionne over on D108216.
Right now, libc++ uses a "SCARY metaprogramming" version of _EnableIf that bypasses
all of Clang's clever diagnostic stuff and thus produces bad diagnostics. My recent
benchmarks ( https://quuxplusone.github.io/blog/2021/09/04/enable-if-benchmark/ )
have determined that the SCARYness is not buying us any speedup; therefore we are
happy to drop it and go back to using the standard std::enable_if for all our
SFINAE needs. However, we don't want to type out typename std::enable_if<X>::type
all over the library; we want to use an alias template. And we can't use
std::enable_if_t because we need a solution that works in C++11, and we do not
provide std::enable_if_t in C++11.

Therefore, D109435 switches us from SCARY `_EnableIf` to a normal `__enable_if_t`
(at least in C++11 mode, and possibly everywhere for consistency).
Simultaneously, this Clang patch enables the good diagnostics for `__enable_if_t`.
We don't need to enable good diagnostics for `_EnableIf` because the name
`_EnableIf` has only ever been used for the SCARY version where the good diagnostics
don't trigger anyway.

(Btw, this existing code is all sorts of broken, theoretically speaking.
I filed https://bugs.llvm.org/show_bug.cgi?id=51696 about it last week.
So if someone wants to use this PR as an excuse to go down the rabbit hole
and fix it for real, that would be cool too.)

Differential Revision: https://reviews.llvm.org/D109411
2021-09-11 13:44:51 -05:00
Zhouyi Zhou 6e91666e28 [libcxxabi] NFC: fix incorrect indentation of braces
Some functions in cxa_exception_storage.cpp have incorrect indentation
of braces; fix them.
Original patch by Zhouyi Zhou <zhouzhouyi@gmail.com>

Also, remove a line of commented-out (and no-longer-possible-to-compile)
code. That thread-safe-static initialization of `init` was replaced
with the call to pthread_once directly above it, back in 2012.

Differential Revision: https://reviews.llvm.org/D109408
2021-09-11 13:43:12 -05:00
David Green 26b653dae4 [AArch64] Regenerate some test checks. NFC
This regenerates some of the tests that had very-close-to-updated check
line already, in order to make them more maintainable.
2021-09-11 19:39:28 +01:00
Nikita Popov 45c467346a [LAA] Pass access type to getPtrStride()
Pass the access type to getPtrStride(), so it is not determined
from the pointer element type. Many cases still fetch the element
type at a higher level though, so this only partially addresses
the issue.
2021-09-11 19:16:49 +02:00
Martin Storsjö 314b5a0efd [llvm-shlib] Fix the i686 MSVC triple check for listing symbols to export in LLVM-C.dll
https://reviews.llvm.org/D47381 / eb46c95c3e
changed the triples set up by GetHostTriple.cmake for i686 MSVC
from i686-pc-win32 to i686-pc-windows-msvc without changing
the corresponding condition in llvm-shlib.

Since then, the 32 bit x86 build of LLVM-C.dll has contained no
exported symbols at all.

Differential Revision: https://reviews.llvm.org/D109493
2021-09-11 19:50:03 +03:00
Sanjay Patel 75e8eb2b10 [InstCombine] update code/test comments; NFC
Follow-up for post-commit suggestion on:
28afaed691

The comments were partly copied from the original
code, but not updated to match the new code.
2021-09-11 10:53:53 -04:00
Nikita Popov f5806830e0 [ARM] Support neon.vld auto-upgrade with opaque pointers
This code manually constructs the intrinsic name, so we need to
use p0 instead of p0i8 in opaque pointer mode.
2021-09-11 16:34:32 +02:00
Kazu Hirata e030d31fda [GlobalOpt] Use make_early_inc_range (NFC) 2021-09-11 07:23:22 -07:00