Commit Graph

398779 Commits

Author SHA1 Message Date
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
Sanjay Patel 28afaed691 [InstCombine] fold sub of min/max intrinsics with invertible ops
This is a translation of the existing code to handle the intrinsics
and another step towards D98152.

https://alive2.llvm.org/ce/z/jA7eBC

This pattern is already handled by underlying folds if there are
less uses, so the minimal tests in this case have extra uses.

The larger cmyk tests show the motivation - when combined with
other folds, we invert a larger sequence and eliminate 'not' ops.
2021-09-11 09:18:46 -04:00
Muhammad Omair Javaid c55e021de4 [LLDB] Skip TestDyldLaunchLinux.py on Arm/Linux
TestDyldLaunchLinux.py has been recently added and is failing on LLDB
Arm/Linux buildbot. I am marking it skip till I come back and look at
it in more detail.
2021-09-11 16:18:22 +05:00
guopeilin 749ddd25e9 [BitcodeReader] Delay select until all constants resolved
Like the shuffle, we should treat the select delayed so that
all constants can be resolved.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D109053
2021-09-11 18:51:35 +08:00
Simon Pilgrim df975e4590 [X86][SLM] Fix PSAD/MPSAD uops, latency and throughput
Noticed while trying to improve generic reduction costs via the D103695 helper script. Confirmed with Intel AoM / Agner / InstLatX64.
2021-09-11 11:44:09 +01:00
Simon Pilgrim 484944ac3b [X86][SLM] Fix HADD/HSUB uops, latency and throughput
Noticed while trying to improve generic reduction costs via the D103695 helper script. Confirmed with Intel AoM / Agner / InstLatX64.
2021-09-11 11:44:09 +01:00
Simon Pilgrim 51d04e2268 [X86][SLM] Swap LoadLat and LoadUOps in the SLMWriteResPair<> helper. NFC.
We set the LoadUOps argument a lot more frequently that LoadLat, by swapping them we can simplify a number of declarations.
2021-09-11 11:44:09 +01:00
Wang, Pengfei 2aaa6466fe [X86] Support *_set1_pch(Float16 _Complex h)
Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D109487
2021-09-11 17:47:31 +08:00
LLVM GN Syncbot 6aacc69338 [gn build] Port 2269a941a4 2021-09-11 09:02:52 +00:00
Lang Hames 2269a941a4 Revert 5629afea91 and bb27e45643 while I look into bot failures.
This reverts commit 5629afea91 ("[ORC] Add missing
include."), and bb27e45643 ("[ORC] Add
SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.").

The SimpleRemoteEPC patch currently assumes availability of threads, and needs
to be rewritten with LLVM_ENABLE_THREADS guards.
2021-09-11 19:02:11 +10:00
LLVM GN Syncbot 26f1cab44a [gn build] Port bb27e45643 2021-09-11 08:51:51 +00:00
Lang Hames 5629afea91 [ORC] Add missing include. 2021-09-11 18:51:16 +10:00
Lang Hames bb27e45643 [ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.
SimpleRemoteEPC is an ExecutorProcessControl implementation (with corresponding
new server class) that uses ORC SimplePackedSerialization (SPS) to serialize and
deserialize EPC-messages to/from byte-buffers. The byte-buffers are sent and
received via a new SimpleRemoteEPCTransport interface that can be implemented to
run SimpleRemoteEPC over whatever underlying transport system (IPC, RPC, network
sockets, etc.) best suits your use case.

The SimpleRemoteEPCServer class provides executor-side support. It uses a
customizable SimpleRemoteEPCServer::Dispatcher object to dispatch wrapper
function calls to prevent the RPC thread from being blocked (a problem in some
earlier remote-JIT server implementations). Almost all functionality (beyond the
bare basics needed to bootstrap) is implemented as wrapper functions to keep the
implementation simple and uniform.

Compared to previous remote JIT utilities (OrcRemoteTarget*,
OrcRPCExecutorProcessControl), more consideration has been given to
disconnection and error handling behavior: Graceful disconnection is now always
initiated by the ORC side of the connection, and failure at either end (or in
the transport) will result in Errors being delivered to both ends to enable
controlled tear-down of the JIT and Executor (in the Executor's case this means
"as controlled as the JIT'd code allows").

The introduction of SimpleRemoteEPC will allow us to remove other remote-JIT
support from ORC (including the legacy OrcRemoteTarget* code used by lli, and
the OrcRPCExecutorProcessControl and OrcRPCEPCServer classes), and then remove
ORC RPC itself.

The llvm-jitlink and llvm-jitlink-executor tools have been updated to use
SimpleRemoteEPC over file descriptors. Future commits will move lli and other
tools and example code to this system, and remove ORC RPC.
2021-09-11 18:16:38 +10:00
Matt Beardsley c6bf8b8592 Fix python 2-vs-3 issues in add_new_check.py and rename_check.py
As of this commit:
  https://github.com/llvm/llvm-project/commit/307b1fdd

If either of those scripts are invoked with python 2, neither works due to:
  "TypeError: write() argument 1 must be unicode, not str"

And if rename_check.py is invoked with python 3:
  "ValueError: binary mode doesn't take an encoding argument"
(referring to `with io.open(filename, 'wb', encoding='utf8') as f:`), and

Another issue in rename_check.py in python 2:
  "TypeError: list object is not an iterator"
(referring to `next(filter( ... os.listdir(old_module_path)))`)

(so, rename_check doesn't work with either 2 or 3, and add_new_check
doesn't work with 2, but does work with 3)

I ran these steps to test both python versions:
(manually - appears to be the "status quo" for these files)

  python3 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg
  python3 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh

  git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst
  rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst

  python2 clang-tools-extra/clang-tidy/add_new_check.py readability ggggg
  python2 clang-tools-extra/clang-tidy/rename_check.py readability-ggggg readability-hhhhh

  git checkout HEAD -- clang-tools-extra/clang-tidy/readability/CMakeLists.txt clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/docs/clang-tidy/checks/list.rst
  rm -f clang-tools-extra/clang-tidy/readability/GggggCheck.cpp clang-tools-extra/clang-tidy/readability/GggggCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-ggggg.rst clang-tools-extra/test/clang-tidy/checkers/readability-ggggg.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.cpp clang-tools-extra/clang-tidy/readability/HhhhhCheck.h clang-tools-extra/docs/clang-tidy/checks/readability-hhhhh.rst

Reviewed By: kbobyrev

Differential Revision: https://reviews.llvm.org/D109127
2021-09-11 09:52:50 +02:00
Jessica Paquette 4e408aae2c [AArch64][GlobalISel] Select full-fp16 s16 G_FCONSTANT as a constant pool load
When we have full-fp16 support, we should (manually select) s16 G_FCONSTANT to
a constant pool load.

Add support for that to `emitLoadFromConstantPool` + the existing constant
selection code.

Also tidy up the constant selection code a little. There were some out-of-date
comments + some dead code.

Differential Revision: https://reviews.llvm.org/D108957
2021-09-10 19:36:34 -07:00
Keith Smiley e972e49b11 [llvm-cov] Add error for invalid -path-equivalence format
Differential Revision: https://reviews.llvm.org/D109042
2021-09-10 18:34:37 -07:00
Lang Hames 6c56b13331 [JITLink] Working memory shouldn't be subject to alignment constraints.
Refactors copyBlockContentToWorkingMemory to use offsets rather than direct
pointers to working memory. This simplifies the problem of maintaining
alignments between blocks in working memory, without requiring the working
memory itself to be aligned.
2021-09-11 11:26:38 +10:00
Lang Hames 3828ab086a [ORC] Fix missing newline in debugging output. 2021-09-11 11:24:01 +10:00
Lang Hames a0a91ed3dd [ORC] Merge LLVMSPSSerializers.h into SimplePackedSerialization.h.
Since the ORC runtime and LLVM are no longer sharing SPS code (the ORC runtime
has its own copy) there is no reason to keep these separate.
2021-09-11 11:24:00 +10:00
Lang Hames 22641f5853 [ORC] Use EPC for EPCGeneric MemoryAccess / JITLinkMemoryManager construction.
This allows these classes to be created during EPC construction, before an
ExecutionSession is available.
2021-09-11 11:24:00 +10:00
Usman Nadeem ab111e982f Revert "Revert "[AArch64][SVE][InstCombine] Canonicalize aarch64_sve_dup_x intrinsic to IR splat operation""
This reverts commit eee7d225de.
Effectively relanding 98c37247d8
after fixing the failing tests.

Change-Id: I5d7461aeb820a2d5f1895457d824a8de4d316ee5
2021-09-10 18:11:24 -07:00
Eric Christopher 2d26a72f82 nullptr initialize variables, spotted on msan bots. 2021-09-10 18:10:53 -07:00
Keith Smiley f7062f6dfb [docs] Improve description of LLVM_BUILD_TESTS
This makes it clear that this only has an effect if you use the all
build target.

Differential Revision: https://reviews.llvm.org/D109113
2021-09-10 18:01:38 -07:00
Jason Molenda 89ed21a8f8 Recognize namespaced all_image_infos symbol name from dyld
In macOS 12, the symbol name for the dyld_all_image_infos struct
in dyld has a namespace qualifier.  Search for it without qualification,
then with qualification when doing a by-name search.  (lldb will
only search for it by name when loading a user process Mach-O corefile)

rdar://76270013
2021-09-10 16:56:48 -07:00
owenca 3205dd3d59 [clang-format] Restrict the special handling for K&R C to C/C++
Commits 58494c856a, f6bc614546, and 0fc27ef196 added special
handlings for K&R C function definitions and caused some
JavaScript/TypeScript regressions which were addressed in D107267,
D108538, and D108620. This patch would have prevented these known
regressions and will fix any unknown ones.

Differential Revision: https://reviews.llvm.org/D109582
2021-09-10 15:51:35 -07:00
Joseph Huber 29b44ca896 [OpenMP] Add flag for setting debug in the offloading device
This patch introduces the flags `-fopenmp-target-debug` and
`-fopenmp-target-debug=` to set the value of a global in the device.
This will be used to enable or disable debugging features statically in
the device runtime library.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109544
2021-09-10 18:19:19 -04:00
Joseph Huber 7eb899cbcd [OpenMP] Add more verbose remarks for runtime folding
We peform runtime folding, but do not currently emit remarks when it is
performed. This is because it comes from the runtime library and is
beyond the users control. However, people may still wish to view  this
and similar information easily, so we can enable this behaviour using a
special flag to enable verbose remarks.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109627
2021-09-10 17:36:06 -04:00
Alex Langford 8dae35527f [lldb] Remove unused typedefs from lldb-forward.h 2021-09-10 14:16:47 -07:00
Ye Luo 2187cbf56f [OpenMP][libomptarget] Add __tgt_target_return_t enum for __tgt_target_XXX return int
The defintion of OFFLOAD_SUCCESS and OFFLOAD_FAIL used in plugin APIs and libomptarget public APIs are not consistent.
Create __tgt_target_return_t for libomptarget public APIs.

Differential Revision: https://reviews.llvm.org/D109304
2021-09-10 16:11:08 -05:00
Johannes Doerfert 99ea8ac9f1 Reapply "[OpenMP] Group side-effects to improve guarding efficiency"
This reapplies ca134c3963, effectively
reverting commit d2f206e0af.

Minor test changes to make the test pass.
2021-09-10 15:22:57 -05:00
Johannes Doerfert c09fbbdcfb Reapply "[GlobalOpt][FIX] Do not embed initializers into AS!=0 globals""
This reapplies commit 7dbba3376f, or, put
differently, this reverts commit d9a8d20827.

The test now requires the amdgpu and nvptx backend explicitly as it
won't work without properly.
2021-09-10 15:22:56 -05:00
Rob Suderman b0532286fe [mlir][tosa] Add shape inference for tosa.while
Tosa.while shape inference requires repeatedly running shape inference across
the body of the loop until the types become static as we do not know the number
of iterations required by the loop body. Once the least specific arguments are
known they are propagated to both regions.

To determine the final end type, the least restrictive types are determined
from all yields.

Differential Revision: https://reviews.llvm.org/D108801
2021-09-10 13:11:53 -07:00
Mark Schimmel 7c82db3634 [ARC] Improve code generated for i32 ADDC/ADDE and SUBC/SUBE
This change improves the code generated for long long addition and subtraction

Differential Revision: https://reviews.llvm.org/D109615
2021-09-10 13:04:08 -07:00