Commit Graph

408192 Commits

Author SHA1 Message Date
Stella Laurenzo 8ff42766d1 [mlir] Use thread-pool's notion of thread count instead of requerying system.
The computed number of hardware threads can change over the life of the process based on affinity changes. Since we need a data structure that is at least as large as the maximum parallelism, it is important to use the value that was actually latched for the thread pool we will be dispatching work to.

Also adds an assert specifically for if it doesn't line up (I was getting a crash on an index into the vector).

Differential Revision: https://reviews.llvm.org/D116257
2021-12-23 17:04:45 -08:00
Nico Weber a6114ff0cd [gn build] "port" 71b3bfde9c 2021-12-23 19:52:34 -05:00
Fangrui Song 417cd2e5c5 [ELF] SymbolTable: change some vector<Symbol *> to SmallVector
The generated assembly for Symbol::insert is much shorter (std::vector resize is
inefficient) and enables some inlining.
2021-12-23 16:49:38 -08:00
Kirill Stoimenov 71b3bfde9c [ASan] Moved optimized callbacks into a separate library.
This will allow linking in the callbacks directly instead of using PLT.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116182
2021-12-24 00:40:44 +00:00
Mehdi Amini 735fe1da6b Revert "[mlir][tosa] Split tosa-to-linalg named ops out of pass"
This reverts commit 313de31fbb.

There is a missing CMake dependency, building with shared libraries is
broken:

55.509 [45/4/3061] Linking CXX shared library lib/libMLIRTosaToLinalg.so.14git
FAILED: lib/libMLIRTosaToLinalg.so.14git
...
TosaToLinalgPass.cpp: undefined reference to `mlir::createCanonicalizerPass()'
2021-12-24 00:09:15 +00:00
Jason Molenda 8a26ba6a02 Load binary by UUID from qProcessInfo packet fields
Support three new keys in the qProcessInfo response from the remote
gdb stub to handle the case of attaching to a core running some type
of standalone/firmware code and the stub knows the UUID and load
address-or-slide for the binary.  There will be no proper DynamicLoader
plugin in this scenario, but we can try to locate and load the binary
into lldb at the correct offset.

Differential Revision: https://reviews.llvm.org/D116211
rdar://75191077
2021-12-23 15:20:50 -08:00
Siva Chandra Reddy 60509623c4 [libc][obvious] Fix style of MPFRWrapper. 2021-12-23 23:19:42 +00:00
Krzysztof Parzyszek a67c0fc1fb [Hexagon] Revamp HVX flag verification in driver
Generalize warning/error messages (for reuse), refactor flag verification
code, rewrite HVX flag driver testcase.
2021-12-23 15:18:08 -08:00
Fangrui Song 464cc4c920 [ELF] Remove stale comment which was duplicated in MarkLive<ELFT>::run
Pointed out by thakis
2021-12-23 15:13:46 -08:00
Nico Weber ee4bbb50ae [gn build] (manually) port 7cd7b4d2f8 (sanitizer_symbolize_set_demangle) 2021-12-23 18:06:48 -05:00
Kristina Bessonova 81378f7e56 Revert "[DwarfDebug] Support emitting function-local declaration for a lexical block" & dependent patches
Try to revert D113741 once again.

This also reverts 0ac75e82ff (D114705)
as it causes LLDB's lldb-api.lang/cpp/nsimport.TestCppNsImport.py test
failure w/o D113741.

This reverts commit f9607d45f3.

Differential Revision: https://reviews.llvm.org/D116225
2021-12-24 00:47:04 +02:00
Vitaly Buka 7cd7b4d2f8 [sanitizer] Add common "demangle" flag
Reviewed By: browneee

Differential Revision: https://reviews.llvm.org/D116202
2021-12-23 14:36:39 -08:00
Florian Hahn 5d68dc184e
[Verifier] Iteratively traverse all indirect users.
The recursive implementation can run into stack overflows, e.g. like in PR52844.

The order the users are visited changes, but for the current use case
this only impacts the order error messages are emitted.
2021-12-23 23:20:12 +01:00
Nico Weber 5fd328c45f [gn build] (manually) port f103ee2e9e (sanitizer_symbolize_set_inline_frames) 2021-12-23 16:40:13 -05:00
Victor Perez 10b3675aa9 [RISCV][VP] Lower mask vector VP AND/OR/XOR to RVV instructions
For fixed and scalable vectors, each intrinsic x is lowered to vmx.mm,
dropping the mask, which is safe to do as masked-off elements are
undef anyway.

Differential Revision: https://reviews.llvm.org/D115339
2021-12-23 15:02:32 -06:00
Rob Suderman 313de31fbb [mlir][tosa] Split tosa-to-linalg named ops out of pass
Linalg named ops lowering are moved to a separate pass. This allows TOSA
canonicalizers to run between named-ops lowerings and the general TOSA
lowerings. This allows the TOSA canonicalizers to run between lowerings.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D116057
2021-12-23 12:23:19 -08:00
Michael Kruse 937b00ab2c [Polly][SchedOpt] Account for prevectorization of multiple statements.
A prevectorized loop may contain multiple statements, in which case
isl_schedule_node_band_sink will sink the vector band to multiple
leaves. Instead of statically assuming a specific tree structure after
sinking, add a SIMD marker to all inner bands.

Fixes llvm.org/PR52637
2021-12-23 14:06:41 -06:00
Arthur O'Dwyer 3042091168 [libc++] [ranges] Whitespace and namespace-style adjustments. NFC.
Largely split out of D116199 to keep that PR smaller.
2021-12-23 14:56:23 -05:00
Arthur O'Dwyer 4191a93ea4 [libc++] [test] Eliminate `== true` and `== false`. NFC.
As suggested in D115312.
2021-12-23 14:56:23 -05:00
Arthur O'Dwyer a2a9a5c7d3 [libc++] [ranges] Fix bugs in ranges::empty().
It was missing the cast to `bool` in `bool(__t.empty())`.
It was wrongly using `std::forward` in some places.

Differential Revision: https://reviews.llvm.org/D115312
2021-12-23 14:56:23 -05:00
Arthur O'Dwyer 6842f52a0b [libc++] [test] Flatten the directory structure a bit. NFC.
Differential Revision: https://reviews.llvm.org/D116198
2021-12-23 14:56:23 -05:00
Mogball 8f8c89f3cd [mlir] Remove spurious debug guard 2021-12-23 11:55:37 -08:00
Nathan Chancellor be8180af58
[clang][driver] Warn when '-mno-outline-atomics' is used with a non-AArch64 triple
The Linux kernel has a make macro called cc-option that invokes the
compiler with an option in isolation to see if it is supported before
adding it to CFLAGS. The exit code of the compiler is used to determine
if the flag is supported and should be added to the compiler invocation.

A call to cc-option with '-mno-outline-atomics' was added to prevent
linking errors with newer GCC versions but this call succeeds with a
non-AArch64 target because there is no warning from clang with
'-mno-outline-atomics', just '-moutline-atomics'. Because the call
succeeds and adds '-mno-outline-atomics' to the compiler invocation,
there is a warning from LLVM because the 'outline-atomics target
feature is only supported by the AArch64 backend.

$ echo | clang -target x86_64 -moutline-atomics -Werror -x c -c -o /dev/null -
clang-14: error: The 'x86_64' architecture does not support -moutline-atomics; flag ignored [-Werror,-Woption-ignored]

$ echo $?
1

$ echo | clang -target x86_64 -mno-outline-atomics -Werror -x c -c -o /dev/null -
'-outline-atomics' is not a recognized feature for this target (ignoring feature)

$ echo $?
0

This does not match GCC's behavior, which errors when the flag is added
to a non-AArch64 target.

$ echo | gcc -moutline-atomics -x c -c -o /dev/null -
gcc: error: unrecognized command-line option ‘-moutline-atomics’; did you mean ‘-finline-atomics’?

$ echo | gcc -mno-outline-atomics -x c -c -o /dev/null -
gcc: error: unrecognized command-line option ‘-mno-outline-atomics’; did you mean ‘-fno-inline-atomics’?

$ echo | aarch64-linux-gnu-gcc -moutline-atomics -x c -c -o /dev/null -

$ echo | aarch64-linux-gnu-gcc -mno-outline-atomics -x c -c -o /dev/null -

To get closer to  GCC's behavior, issue a warning when
'-mno-outline-atomics' is used without an AArch64 triple and do not add
'{-,+}outline-atomic" to the list of target features in these cases.

Link: https://github.com/ClangBuiltLinux/linux/issues/1552

Reviewed By: melver, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D116128
2021-12-23 12:36:42 -07:00
Fangrui Song bf45624ba0 [ELF][PPC32] Support .got2 in an output section description
I added `PPC32Got2Section` D62464 to support .got2 but did not implement .got2
in another output section.

PR52799 has a linker script placing .got2 in .rodata, which causes a null
pointer dereference because a MergeSyntheticSection's file is nullptr.
Add the support.
2021-12-23 11:32:44 -08:00
Vitaly Buka f103ee2e9e [sanitizer] Move internal_symbolizer "inline" option
This option is per process anyway. I'd like to add more options, but
having them as parameters of __sanitizer_symbolize_code looks
inconvenient.

Reviewed By: browneee

Differential Revision: https://reviews.llvm.org/D116201
2021-12-23 11:28:03 -08:00
Fangrui Song eafc64ed63 [Driver][test] Remove unneeded -no-canonical-prefixes and use preferred --target=
-no-canonical-prefixes is not needed if we omit "clang" from CHECK lines.
"-cc1" is sufficient to anchor the line we want to test.
--target= is preferred over Separate form -target.
2021-12-23 11:25:13 -08:00
Vitaly Buka a7ebf2010e [NFC][sanitizer] Increase kArgVMax to 16
D116202 uses all availible slots.
2021-12-23 11:11:47 -08:00
Vitaly Buka 9fe0d67c9a [sanitizer] Check kArgVMax in SymbolizerProcess::GetArgV 2021-12-23 11:05:37 -08:00
Michael Jones 3e52096809 [libc][NFC] fix variable name
A variable was named in a way that doesn't match the format. This patch
renames it to match the format.

Differential Revision: https://reviews.llvm.org/D116228
2021-12-23 10:42:30 -08:00
Krzysztof Parzyszek 1d1b5efdef [Hexagon] Driver/preprocessor options for Hexagon v69 2021-12-23 10:17:08 -08:00
Jakub Kuderski 5410152827 [Bazel] Add target for llvm-tli-checker
Reviewed By: vettoreldaniele, GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D116222
2021-12-23 13:14:12 -05:00
Fangrui Song 4374824ccf [ELF] --gc-sections: combine two iterations over inputSections
There is a slight speed-up.
2021-12-23 09:53:08 -08:00
Kirill Stoimenov 4bf31659fa Revert "[ASan] Moved optimized callbacks into a separate library."
This reverts commit ab3640aa0e.

Reviewed By: kstoimenov

Differential Revision: https://reviews.llvm.org/D116223
2021-12-23 17:13:18 +00:00
Brendon Cahoon d45a247998 [AMDGPU] Don't remove VGPR to AGPR dead spills from frame info
Removing dead frame indices for VGPR to AGPR spills is incorrect
when the frame index is shared by multiple objects, which may
occur due to stack slot coloring. The problem is that subsequent
code that processes the other object will assert because the stack
frame index is marked dead.

Removing dead frame indices is needed prior to stack slot
coloring, which is what happens with SGPR to VGPR spills. These
spills are lowered prior to stack slot coloring, but the VGPR
to AGPR spills are processed afterwards during the Prolog/Epilog
Inserter pass. This patch marks the VGPR to AGPR spill slot as
dead if the slot is not used by another object.

Differential Revision: https://reviews.llvm.org/D115996
2021-12-23 11:09:19 -06:00
Krzysztof Parzyszek 4c8becbeee [Hexagon] Add Hexagon v69 builtins to clang 2021-12-23 09:00:15 -08:00
Krzysztof Parzyszek f766bc093c [Hexagon] Introduce Hexagon v69 ISA 2021-12-23 08:46:03 -08:00
Kirill Stoimenov ab3640aa0e [ASan] Moved optimized callbacks into a separate library.
This will allow linking in the callbacks directly instead of using PLT.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D116182
2021-12-23 16:40:36 +00:00
Mark de Wever e8b24ee115 [libc++][format][NFC] Remove some unneeded headers.
Reviewed By: #libc, Quuxplusone, Mordante

Differential Revision: https://reviews.llvm.org/D116175
2021-12-23 17:38:21 +01:00
Craig Topper 7704c503ec [RISCV] Use positive 0.0 for the neutral element in fadd reductions if nsz is present.
-0.0 requires a constant pool. +0.0 can be made with vmv.v.x x0.

Not doing this in getNeutralElement for fear of changing other targets.

Differential Revision: https://reviews.llvm.org/D115978
2021-12-23 10:38:00 -06:00
Mark de Wever dfb20d4d19 [libc++][format] Improve ABI stability.
During the review of D115991 @vitaut pointed out the enum shouldn't
depend on whether or not _LIBCPP_HAS_NO_INT128 is defined. The current
implementation lets the enum's ABI depend on this configuration option
without a good cause.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D116120
2021-12-23 17:37:12 +01:00
Craig Topper b7b260e19a [RISCV] Support strict FP conversion operations.
This adds support for strict conversions between fp types and between
integer and fp.

NOTE: RISCV has static rounding mode instructions, but the constrainted
intrinsic metadata is not used to select static rounding modes. Dynamic
rounding mode is always used.

Differential Revision: https://reviews.llvm.org/D115997
2021-12-23 09:40:58 -06:00
Alexandros Lamprineas e70ef6d924 [AArch64] Add a tablegen pattern for SQXTN2.
Converts concat_vectors(Vd, trunc(smin(smax Vm, -2^n), 2^n-1) to
sqxtn2(Vd, Vm). Deliberately not handling v2i64 ~> v2i32 as the
min/max nodes are not legal (same thing we did for the SQXTN
patterns in https://reviews.llvm.org/D103263).

Differential Revision: https://reviews.llvm.org/D116105
2021-12-23 15:19:13 +00:00
Petar Avramovic fd3cde600b AMDGPU/GlobalISel: Fix attempt to select non-legal instr in mir test
Delete inst-select-insert.xfail.mir.
G_INSERT instructions in inst-select-insert.xfail.mir are no longer
legal after D114198. This breaks build bots, since builds with
LLVM_ENABLE_ASSERTIONS=Off don't check for legality and report cannot
select while build with LLVM_ENABLE_ASSERTIONS=On reports instruction
is not legal.
2021-12-23 16:14:33 +01:00
Anastasia Stulova 0045d01af9 [SPIR-V] Add a toolchain for SPIR-V in clang
This patch adds a toolchain (TC) for SPIR-V along with the
following changes in Driver and base ToolChain and Tool.
This is required to provide a mechanism in clang to bypass
SPIR-V backend in LLVM for SPIR-V until it lands in LLVM and
matures.

The SPIR-V code is generated by the SPIRV-LLVM translator tool
named 'llvm-spirv' that is sought in 'PATH'.

The compilation phases/actions should be bound for SPIR-V in
the meantime as following:

    compile -> tools::Clang
    backend -> tools::SPIRV::Translator
    assemble -> tools::SPIRV::Translator

However, Driver’s ToolSelector collapses compile-backend-assemble
and compile-backend sequences to tools::Clang. To prevent this,
added new {use,has}IntegratedBackend properties in ToolChain and
Tool to which the ToolSelector reacts on, and which SPIR-V TC
overrides.

Linking of multiple input files is currently not supported but
can be added separately.

Differential Revision: https://reviews.llvm.org/D112410

Co-authored-by: Henry Linjamäki <henry.linjamaki@parmance.com>
2021-12-23 15:10:09 +00:00
Simon Pilgrim 71fc4bbdd2 [X86][SSE] Add ISD::ROTR support
Fix issue in TargetLowering::expandROT where we only attempt to flip a rotation if the other direction has better support - this matches TargetLowering::expandFunnelShift

This allows us to enable ISD::ROTR lowering on SSE targets, which particularly simplifies/improves codegen for splat amount and AVX2 per-element shifts.
2021-12-23 15:07:30 +00:00
Mehrnoosh Heidarpour 0ff20f2f44 [InstSimplify] Fold logic AND to zero
Adding following fold opportunity:
((A | B) ^ A) & ((A | B) ^ B) --> 0

Reviewed By: spatel, rampitec

Differential Revision: https://reviews.llvm.org/D115755
2021-12-23 10:06:26 -05:00
Craig Topper a9486a40f7 [RISCV] Disable interleaving scalar loops in the loop vectorizer.
The loop vectorizer can interleave scalar loops even if it doesn't
vectorize them. I don't believe we intended to enable this when
we enabled interleaving for vector instructions.

Disable interleaving for VF=1 like X86 and AMDGPU already do. Test
lifted from AMDGPU.

Differential Revision: https://reviews.llvm.org/D115975
2021-12-23 08:37:24 -06:00
Simon Pilgrim a3f50fb06d [X86] isVectorShiftByScalarCheap - vXi8 select(shift(x,splat0),shift(x,splat1)) is better than shift(x,select(splat0,splat1))
Even though we don't have vXi8 vector shifts (apart from XOP), it is still better to prefer shift (or funnel-shift/rotate) by scalar where possible.

https://llvm.godbolt.org/z/6ss6ffTxv

Differential Revision: https://reviews.llvm.org/D116191
2021-12-23 14:30:02 +00:00
Nikita Popov 7977fd7cfc [OpenMP] Remove no-op cast (NFC)
This was casting the address to its own element type, which is
a no-op.
2021-12-23 15:15:26 +01:00
Nikita Popov bf2b5551f9 [CodeGen] Use CreateConstInBoundsGEP() in one more place
This does exactly what this code manually implemented.
2021-12-23 14:58:47 +01:00