Commit Graph

398927 Commits

Author SHA1 Message Date
Corentin Jabot 601102d282 Cleanup identifier parsing; NFC
Rename methods to clearly signal when they only deal with ASCII,
simplify the parsing of identifier, and use start/continue instead of
head/body for consistency with Unicode terminology.
2021-09-14 09:12:22 -04:00
Stephen Tozer 9bbc0c1ffb [Dexter] Improve performance by evaluating expressions only when needed
Currently, Dexter's model for fetching watch values is to build a list of
expressions to watch before running the debugger, then evaluating all of them at
each breakpoint, then finally looking up the values of these expressions at each
line they were expected on. When using dexter on a large project while watching
many different expressions, this is very slow, as Dexter will make a massive
number of calls made to the debugger's API, the vast majority of which are not
being used for anything. This patch fixes this issue by having Dexter only
evaluate expressions at a breakpoint when it will be used by a Dexter command.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D107070
2021-09-14 14:09:23 +01:00
Nico Weber 8cfab5de13 [Windows build] Use "DIA SDK" in sysroot
This updates llvm/utils/sysroot.py to include the "DIA SDK" folder in the
sysroot.

It also updates the build to look for the DIA SDK there if a sysroot is set.

This requires moving LLVM_WINSYSROOT to config-ix.cmake.

For the GN build, I chose to pass a qualified path to diaguids in libs instead
of pushing a config with a `/libpath:` flag. The former requires a GN with
https://gn-review.googlesource.com/c/gn/+/12200, the latter requires D109624.
The former is more like the cmake build, arguably a bit simpler, and it's
easier to check for the wrong GN revision and easier to update GN.

Differential Revision: https://reviews.llvm.org/D109708
2021-09-14 08:59:28 -04:00
Nico Weber f78f613bb7 [llvm cmake] replace tabs with spaces in config-ix.cmake 2021-09-14 08:58:59 -04:00
Justas Janickas 09dc454b00 [OpenCL] Enables .rgba vector extension in C++ for OpenCL 2021
`.rgba` vector extension setting in C++ for OpenCL 2021 is now
performed analogously to OpenCL C 3.0. Test case added.

Differential Revision: https://reviews.llvm.org/D109370
2021-09-14 13:05:42 +01:00
Tobias Gysi 44a889778c [mlir][linalg] Fold ExtractSliceOps during tiling.
Add the makeComposedExtractSliceOp method that creates an ExtractSliceOp and folds chains of ExtractSliceOps by computing the sum of their offsets and by multiplying their strides.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D109601
2021-09-14 11:43:52 +00:00
Martin Storsjö 125e8ef10b [runtimes] Check whether -nostdinc++ and -nostdlib++ are supported
Don't blindly assume they're supported - GCC doesn't support -nostdlib++.

The llvm-project/runtimes directory is supposed to allow building the
runtimes standalone from a newly built Clang, and thus should allow
building with other compilers too.

Differential Revision: https://reviews.llvm.org/D109719
2021-09-14 13:42:51 +03:00
Florian Hahn e248d69036
Recommit "[LAA] Support pointer phis in loop by analyzing each incoming pointer."
SCEV does not look through non-header PHIs inside the loop. Such phis
can be analyzed by adding separate accesses for each incoming pointer
value.

This results in 2 more loops vectorized in SPEC2000/186.crafty and
avoids regressions when sinking instructions before vectorizing.

Fixes PR50296, PR50288.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D102266
2021-09-14 11:19:12 +01:00
David Green 5a6dfbb8cd [ARM] Teach DemandedVectorElts about VMOVN lanes
The class of instructions that write to narrow top/bottom lanes only
demand the even or odd elements of the input lanes. Which means that a
pair of VMOVNT; VMOVNB demands no lanes from the original input. This
teaches that to instcombine from the target hooks available through
ARMTTIImpl.

Differential Revision: https://reviews.llvm.org/D109325
2021-09-14 11:05:31 +01:00
Uday Bondhugula a91cfd1990 [MLIR] Improve op parse error message for AtLeastNOperands trait
Improve parse error message for "at least N operands" op trait.

Differential Revision: https://reviews.llvm.org/D109747
2021-09-14 15:01:51 +05:30
Cheng Wang 3582828748 [libc][Obvious] Some clean work with memmove. 2021-09-14 17:30:37 +08:00
Matheus Izvekov 2d6829bbbe [clang] disable implicit moves when not in CPlusPLus
See PR51842.

This fixes an assert firing in the static analyzer, triggered by implicit moves
in blocks in C mode:

This also simplifies the AST a little bit when compiling non C++ code,
as the xvalue implicit casts are not inserted.

We keep and test that the nrvo flag is still being set on the VarDecls,
as that is still a bit beneficial while not really making anything
more complicated.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D109654
2021-09-14 11:29:47 +02:00
Tim Northover f287405419 AArch64: fix indentation of ProcAppleA14. NFC. 2021-09-14 10:04:15 +01:00
Justas Janickas ad88632b65 [OpenCL] Tests C++ for OpenCL version macros
Version macro definitions are tested for C++ for OpenCL when
explicit version is provided on command line via `-cl-std` flag.

Differential Revision: https://reviews.llvm.org/D109366
2021-09-14 09:49:20 +01:00
Cullen Rhodes 6fbc167c0a [WebAssembly] NFC: Remove unused tblgen template args
Identified in D109359.

Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D109689
2021-09-14 08:26:15 +00:00
Cullen Rhodes 742cf3996e [AArch64] NFC: Use 'asm' in SIMDScalarCPY
Fixes a warning identified in D109359. The mnemonic is also mov, not
cpy.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D109573
2021-09-14 08:26:15 +00:00
Martin Storsjö ac3edc4c97 [Win64EH] Write .pdata symbol relocations relative to the temporary begin symbol
Previously the relocations pointed at the public user facing,
possibly external symbol.

When the function itself is weak, that symbol may be overridden at
link time, pointing at another strong implementation of the same
function instead. In that case, there's two conflicting pdata entries
pointing at the same address, and the wrong unwind info might end up
used.

Both GCC/binutils and MSVC produce pdata pointing at internal static
symbols. (GCC/binutils point at the .text section just as LLVM does
after this change, MSVC points at special label type symbols with the
type IMAGE_SYM_CLASS_LABEL and names like '$LN4'.)

This fixes unwinding through an overridden "operator new" with a
statically linked C++ library in MinGW mode. (Building libc++ with
-ffunction-sections and linking with --gc-sections might avoid the
issue too.)

This makes the produced object files a little less user friendly
to debug, but with other recent improvements for llvm-readobj, the
unwind info debugging experience should be pretty much the same.

Differential Revision: https://reviews.llvm.org/D109651
2021-09-14 11:05:37 +03:00
Martin Storsjö 63784b9a75 [llvm-readobj] [COFF] Resolve relocations pointing at section symbols for arm64 too
This syncs parts from the x86 implementation to the ARMWinEH
implementation.

Currently, neither of the compilers targeting COFF/arm64 (MSVC, LLVM)
produce such relocations, but LLVM might after a later patch.

Differential Revision: https://reviews.llvm.org/D109650
2021-09-14 11:04:46 +03:00
Martin Storsjö 197084fcee [llvm-readobj] [COFF] Try to resolve symbols in unwind info on x86
This is the same as we do on arm64 already for the MSVC style label
symbols, but also handle the way GCC produces it - with all relocations
pointing at the .text section symbol, with various offsets.

Differential Revision: https://reviews.llvm.org/D109649
2021-09-14 11:04:46 +03:00
Martin Storsjö 5b007f2c94 [runtimes] Calculate the path to the llvm directory without the LLVM cmake package
If building by pointing cmake directly at the llvm-project/runtimes
directory, the llvm cmake package files (that provide e.g.
LLVM_BUILD_MAIN_SRC_DIR) aren't necessarily available. Instead just
use a path relative to the current source dir.

Differential Revision: https://reviews.llvm.org/D109717
2021-09-14 11:04:25 +03:00
Martin Storsjö 61f22f70ca [runtimes] Initialize LLVM_DEFAULT_TARGET_TRIPLE if not set by the caller
Differential Revision: https://reviews.llvm.org/D109716
2021-09-14 11:04:23 +03:00
serge-sans-paille 9aeecdfa8e Check supported architectures in sseXYZ/avxXYZ headers
It doesn't make sense to include those headers on the wrong architecture,
provide an explicit error message in that case.

Fix https://bugs.llvm.org/show_bug.cgi?id=48915

Differential Revision: https://reviews.llvm.org/D109686
2021-09-14 09:57:54 +02:00
Heejin Ahn e85ed44373 [WebAssembly] Fix a typo in comments 2021-09-14 00:45:02 -07:00
David Blaikie 13e34f9fc1 Fixup some formatting from a recent commit 2021-09-14 00:41:19 -07:00
David Blaikie e4b9f5e851 DebugInfo: Add support for template parameters with reference qualifiers
Followon from the previous commit supporting cvr qualifiers.
2021-09-14 00:39:47 -07:00
David Blaikie db4ff98bf9 DebugInfo: Add support for template parameters with qualifiers
eg: t1<void () const> - DWARF doesn't have a particularly nice way to
encode this, for real member function types (like `void (t1::*)()
const`) the const-ness is encoded in the type of the artificial first
parameter. But `void () const` has no parameters, so encode it like a
normal const-qualified type, using DW_TAG_const_type. (similarly for
restrict and volatile)

Reference qualifiers (& and &&) coming in a separate commit shortly.
2021-09-14 00:04:40 -07:00
Esme-Yi b98c3e957f [yaml2obj][XCOFF] add the SectionIndex field for symbol.
Summary: Add the SectionIndex field for symbol.
1: a symbol can reference a section by SectionName or SectionIndex.
2: a symbol can reference a section by both SectionName and SectionIndex.
3: if both Section and SectionIndex are specified, but the two values refer
   to different sections, an error will be reported.
4: an invalid SectionIndex is allowed.
5: if a symbol references a non-existent section by SectionName, an error will be reported.

Reviewed By: jhenderson, Higuoxing

Differential Revision: https://reviews.llvm.org/D109566
2021-09-14 06:18:03 +00:00
Chris Lattner 8b4afc5aef [APInt] Add a concat method, use LLVM_UNLIKELY to help optimizer.
Three unrelated changes:

1) Add a concat method as a convenience to help write bitvector
   use cases in a nicer way.
2) Use LLVM_UNLIKELY as suggested by @xbolva00 in a previous patch.
3) Fix casing of some "slow" methods to follow naming standards.

Differential Revision: https://reviews.llvm.org/D109620
2021-09-13 22:02:54 -07:00
Chen Zheng 946e69d253 [PowerPC] prepare more loop load/store instructions
PPCLoopInstrFormPrep pass now can prepare for load store instructions
in a loop whose increment is not a constant integer.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D105872
2021-09-14 05:00:48 +00:00
Matt Arsenault c305513cc2 AMDGPU: Fix assert with indirect call with known required inputs
The attributor can determine that some indirect calls do not require
special inputs. The special inputs will still be present in the ABI,
so we need to allocate the registers and pass undefs.
2021-09-13 22:54:11 -04:00
David Blaikie 2bd8493847 Improve type printing of const arrays to normalize array-of-const and const-array
Since these map to the same effective type - render them the same/in the
more legible way (const x[n]).
2021-09-13 19:17:05 -07:00
Matthias Springer 62883459cd [mlir][linalg] makeTiledShape: No affine.min if tile size == 1
This improves codegen (more static type information) with `scalarize-dynamic-dims`.

Differential Revision: https://reviews.llvm.org/D109415
2021-09-14 10:48:20 +09:00
Matthias Springer fb1def9c66 [mlir][linalg] New tiling option: Scalarize dynamic dims
This tiling option scalarizes all dynamic dimensions, i.e., it tiles all dynamic dimensions by 1.

This option is useful for linalg ops with partly dynamic tensor dimensions. E.g., such ops can appear in the partial iteration after loop peeling. After scalarizing dynamic dims, those ops can be vectorized.

Differential Revision: https://reviews.llvm.org/D109268
2021-09-14 10:40:50 +09:00
Matthias Springer 8faf35c0a5 [mlir][linalg] Add scf.for loop peeling to codegen strategy
Only scf.for loops are supported at the moment. linalg.tiled_loop support will be added in a subsequent commit.

Only static tensor sizes are supported. Loops for dynamic tensor sizes can be peeled, but the generated code is not optimal due to a missing canonicalization pattern.

Differential Revision: https://reviews.llvm.org/D109043
2021-09-14 10:35:01 +09:00
Geoffrey Martin-Noble 216d974a2f [Bazel] Fix Bazel config for 2c8e784915
Updates the Bazel config for OrcTargetProcess after
https://github.com/llvm/llvm-project/commit/2c8e784915

Differential Revision: https://reviews.llvm.org/D109731
2021-09-13 18:29:42 -07:00
Matthias Springer a4a654d301 [mlir][linalg] TiledLoopOp peeling: Do not peel partial iterations
Extend the unit test with an option for skipping partial iterations during loop peeling.

Differential Revision: https://reviews.llvm.org/D109640
2021-09-14 10:01:46 +09:00
Shao-Ce Sun d4f25d0046 [RISCV] add Half-precision test for vle/vse
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D109681
2021-09-14 08:55:22 +08:00
LLVM GN Syncbot 7c76cefd7c [gn build] Port 2c8e784915 2021-09-14 00:27:49 +00:00
Lang Hames 3ca6eee2a9 [ORC] Fix self-assignment.
We want to read the page size from EPI->PageSize. Thanks to Simon Pilgrim for
spotting this.
2021-09-14 10:21:49 +10:00
Lang Hames 2c8e784915 [ORC] Add Shared/OrcRTBridge, and TargetProcess/OrcRTBootstrap.
This is a small first step towards reorganization of the ORC libraries:

Declarations for types and function names (as strings) to be found in the
"ORC runtime bootstrap" set are moved into OrcRTBridge.h / OrcRTBridge.cpp.

The current implementation of the "ORC runtime bootstrap" functions is moved
into OrcRTBootstrap.h and OrcRTBootstrap.cpp. It is likely that this code will
eventually be moved into ORT-RT proper (in compiler RT).

The immediate goal of this change is to make these bootstrap functions usable
for clients other than SimpleRemoteEPC/SimpleRemoteEPCServer. The first planned
client is a new RuntimeDyld::MemoryManager that will run over EPC, which will
allow us to remove the old OrcRemoteTarget code.
2021-09-14 10:19:45 +10:00
Brendon Cahoon 42dace9c5b [Hexagon] Use getTypeAllocSize to compute difference between objects
The code was using getTypeStoreSize to calculate the difference
between consecutive objects. The calculation was incorrect due
to padding that is added between consecutive objects. The
getTypeAllocSize includes the padding amount. For example,
if the type is [19 x i8], the difference between consecutive
objects is 32 bytes, not 19 bytes.

A second case for getTypeAllocSize is needed when computing
the pointer values for the vector accesses. The calculation needs
to account for the padding as well.

Differential Revision: https://reviews.llvm.org/D109403
2021-09-13 19:04:59 -05:00
Ankit Aggarwal a72763af67 [Hexagon] Handle bitcast of i64/i128 -> v64i1/v128i1 2021-09-13 18:52:30 -05:00
Nico Weber b7bac5a172 [clang] Revert gcc-driver part of 648feabc65
See discussion on https://reviews.llvm.org/D109624
2021-09-13 19:04:29 -04:00
Arthur Eubanks 096d9814aa [opt] Remove some legacy PM flags
Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D109664
2021-09-13 15:50:03 -07:00
Kuba Mracek e80ee4cbd9 [GlobalDCE] In VFE support for relative pointers, allow GEP references to the base symbol
This is for Swift VFE support. In some vtable forms that Swift emits, the "base" of a relative pointer is not the global symbol itself directly, but a GEP into it -- so the pointer is relative to a particular field in the global. So getPointerAtOffset() needs to be able to see through the GEP and allow it in a SUB expression, to correctly recognize the offset as a vtable slot.

Differential Revision: https://reviews.llvm.org/D109169
2021-09-13 15:22:11 -07:00
Thomas Lively b2032f18c9 [lld][WebAssembly] Relax limitations on multithreaded instantiation
For multithreaded modules (i.e. modules with a shared memory), lld injects a
synthetic Wasm start function that is automatically called during instantiation
to initialize memory from passive data segments. Even though the module will be
instantiated separately on each thread, memory initialization should happen only
once. Furthermore, memory initialization should be finished by the time each
thread finishes instantiation. Since multiple threads may be instantiating their
modules at the same time, the synthetic function must synchronize them.

The current synchronization tries to atomically increment a flag from 0 to 1 in
memory then enters one of two cases. First, if the increment was successful, the
current thread is responsible for initializing memory. It does so, increments
the flag to 2 to signify that memory has been initialized, then notifies all
threads waiting on the flag. Otherwise, the thread atomically waits on the flag
with an expected value of 1 until memory has been initialized. Either the
initializer thread finishes initializing memory (i.e. sets the flag to 2) first
and the waiter threads do not end up blocking, or the waiter threads succesfully
start waiting before memory is initialized so they will be woken by the
initializer thread once it has finished.

One complication with this scheme is that there are various contexts on the Web,
most notably on the main browser thread, that cannot successfully execute a
wait. Executing a wait in these contexts causes a trap, and in this case would
cause instantiation to fail. The embedder must therefore ensure that these
contexts win the race and become responsible for initializing memory, since that
is the only code path that does not execute a wait.

Unfortunately, since only one thread can win the race and initialize memory,
this scheme makes it impossible to have multiple threads in contexts that cannot
wait. For example, it is not currently possible to instantiate the module on
both the main browser thread as well as in an AudioWorklet. To loosen this
restriction, this commit inserts an extra check so that the wait will not be
executed at all when memory has already been initialized, i.e. when the flag
value is 2. After this change, the module can be instantiated on threads in
non-waiting contexts as long as the embedder can guarantee either that the
thread will win the race and initialize memory (as before) or that memory has
already been initialized when instantiation begins. Threads in contexts that can
wait can continue racing to initialize memory.

Fixes (or at least improves) PR51702.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D109722
2021-09-13 15:03:51 -07:00
Jian Cai ce6d512015 [mlir][doc] fix typos.
Also wrap some function/class names in backticks.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D109723
2021-09-13 14:48:58 -07:00
Heejin Ahn c55b6c593b [WebAssembly] Handle _setjmp and _longjmp in SjLj
In some platforms `_setjmp` and `_longjmp` are used instead of `setjmp`
and `longjmp`. This CL adds support for them.

Fixes https://github.com/emscripten-core/emscripten/issues/14999.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D109669
2021-09-13 14:20:04 -07:00
Heejin Ahn b7b4ebbcfa [WebAssembly] Rethrow longjmp in EH handling if EmSjLj is enabled
This is a fix on top of D106525's Case 2. In D106525, in
`runEHOnFunction` which handles Emscripten EH, We rethrow `longjmp` only
when the module has any usage of `setjmp` or `longjmp`. But now Wasm
object files are linked using wasm-ld, the module this pass sees is not
the whole program, and even if this module does not contain any
`longjmp`, another file can contain it and can be linked with the
current module. This enables the rethrowing of longjmp whenever
Emscripten SjLj is enabled, regardless of whether it is used in this
module or not.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D109670
2021-09-13 14:15:25 -07:00
Geoffrey Martin-Noble 095bbc3a5a [Bazel][mlir] Simplify test/BUILD.bazel with globs
This reduces the maintenance burden by using globs, which is the
tradeoff we make in the other LLVM Bazel build files as well.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D109720
2021-09-13 13:45:23 -07:00