Commit Graph

394219 Commits

Author SHA1 Message Date
Nathan Ridge 08b289867b [clang] Respect PrintingPolicy::FullyQualifiedName when printing a template-id
Fixes PR50774

Differential Revision: https://reviews.llvm.org/D104619
2021-07-19 17:31:51 -04:00
Sam Clegg 9b965b37c7 [lld][WebAssembly] Cleanup duplicate fields in Symbols.h. NFC
This avoids duplication and simplifies the code in several places
without increasing the size of the symbol union (at least not
above the assert'd limit of 120 bytes).

Differential Revision: https://reviews.llvm.org/D106026
2021-07-19 14:31:09 -07:00
Jim Ingham 2656af95eb Don't use !eStateRunning when you mean eStateStopped in DestroyImpl.
When we go to destroy the process, we first try to halt it, if
we succeeded and the target stopped, we want to clear out the
thread plans and breakpoints in case we still need to resume to complete
killing the process.  If the target was exited or detached, it's
pointless but harmless to do this.  But if the state is eStateInvalid -
for instance if we tried to interrupt the target to Halt it and that
fails - we don't want to keep trying to interact with the inferior,
so we shouldn't do this work.

This change explicitly checks eStateStopped, and only does the pre-resume
cleanup if we did manage to stop the process.
2021-07-19 14:30:04 -07:00
Artem Belevich 1a43ee65d1 Revert "[MemCpyOpt] Enable memcpy optimizations unconditionally."
This reverts commit 2c98298a75 which breaks
sanitizers.
2021-07-19 14:27:41 -07:00
thomasraoux 73f1d6edc0 [mlir] Fix bazel build
Differential Revision: https://reviews.llvm.org/D106311
2021-07-19 14:06:37 -07:00
Derek Schuff ad1f5457d2 [WebAssembly] Generate R_WASM_FUNCTION_OFFSET relocs in debuginfo sections
Debug info sections need R_WASM_FUNCTION_OFFSET_I32 relocs (with FK_Data_4 fixup
kinds) to refer to functions (instead of R_WASM_TABLE_INDEX as is used in data
sections). Usually this is done in a convoluted way, with unnamed temp data
symbols which target the start of the function, in which case
WasmObjectWriter::recordRelocation converts it to use the section symbol
instead. However in some cases the function can actually be undefined; in this
case the dwarf generator uses the function symbol (a named undefined function
symbol) instead. In that case the section-symbol transform doesn't work and we
need to generate the correct reloc type a different way. In this change
WebAssemblyWasmObjectWriter::getRelocType takes the fixup section type into
account to choose the correct reloc type.

Fixes PR50408
Differential Revision: https://reviews.llvm.org/D103557
2021-07-19 14:02:33 -07:00
Mircea Trofin 55e2d2060a [MLGO] Use binary protobufs for improved training performance.
It turns out that during training, the time required to parse the
textual protobuf of a training log is about the same as the time it
takes to compile the module generating that log. Using binary protobufs
instead elides that cost almost completely.

Differential Revision: https://reviews.llvm.org/D106157
2021-07-19 13:59:28 -07:00
Nick Fitzgerald 4ae575b999 [WebAssembly] Deduplicate imports of the same module name, field name, and type
When two symbols import the same thing, only one import should be emitted in the Wasm file.

Fixes https://bugs.llvm.org/show_bug.cgi?id=50938

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D105519
2021-07-19 13:59:02 -07:00
Leonard Grey 6ef37b640d [lld/mac] Add test for --lto-O
This belongs to fe08e9c487, I (thakis) forgot to `git add` it back then.

Differential Revision: https://reviews.llvm.org/D105223
2021-07-19 16:45:33 -04:00
thomasraoux f6f88e66ce [mlir] Add software pipelining transformation for scf.For op
This is the first step to support software pipeline for scf.for loops.
This is only the transformation to create pipelined kernel and
prologue/epilogue.
The scheduling needs to be given by user as  many different algorithm
and heuristic could be applied.
This currently doesn't handle loop arguments, this will be added in a
follow up patch.

Differential Revision: https://reviews.llvm.org/D105868
2021-07-19 13:43:26 -07:00
Nico Weber fbb45947b2 [lld/mac] Resolve defined symbols before undefined symbols
Ports https://reviews.llvm.org/D95985 to the MachO port.
Happens to fix PR51135; see that bug for details.
Also makes lld's behavior match ld64 for the included test case.

Differential Revision: https://reviews.llvm.org/D106293
2021-07-19 16:37:41 -04:00
owenca 9da70ab3d4 [clang-format] Break an unwrapped line at a K&R C parameter decl
Break an unwrapped line before the first parameter declaration in a
K&R C function definition.

This fixes PR51074.

Differential Revision: https://reviews.llvm.org/D106112
2021-07-19 13:30:38 -07:00
Stuart Brady 87039c048c [demangler] Fix demangling of 'half'
Demangle 'Dh' as 'half' (as per GCC), and not 'decimal16' (which doesn't
make sense, as there is no IEEE 754 decimal16 format).

The Itanium C++ ABI specification describes 'Dh' as:
> IEEE 754r half-precision floating point (16 bits)

(https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin)

Reviewed By: ldionne, jyknight

Differential Revision: https://reviews.llvm.org/D103833
2021-07-19 21:21:34 +01:00
Teresa Johnson 54c8902f02 [LangRef] Clarify support for multiple metadata attachments with same id
As discussed on D105251, currently the compiler does not support
multiple metadata attachments on instructions having the same
identifier, whereas it does for global objects. Note this in the
Language Reference manual for clarity.

See D105251 for discussions of history behind this divergence, and the
complexities and possible approaches of adding this support to
instructions in the future.

Differential Revision: https://reviews.llvm.org/D106304
2021-07-19 13:18:47 -07:00
Tony Tye 51e62e56f7 [AMDGPU] Reserve AMDGPU ELF e_flags machine 0x45
Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D106249
2021-07-19 20:17:35 +00:00
MaheshRavishankar 5994201c8e [mlir][Linalg] NFC: Rename FusionOfTensors pass to FusionOfElementwiseOps pass.
This makes it more explicit what the scope of this pass is. The name
of this pass predates fusion on tensors using tile + fuse, and hence
the confusion.

Differential Revision: https://reviews.llvm.org/D106132
2021-07-19 12:51:26 -07:00
LLVM GN Syncbot 42e6cfc81d [gn build] Port 54902e00d1 2021-07-19 19:24:16 +00:00
Petr Hosek 54902e00d1 [InstrProfiling] Use weak alias for bias variable
We need the compiler generated variable to override the weak symbol of
the same name inside the profile runtime, but using LinkOnceODRLinkage
results in weak symbol being emitted in which case the symbol selected
by the linker is going to depend on the order of inputs which can be
fragile.

This change replaces the use of weak definition inside the runtime with
a weak alias. We place the compiler generated symbol inside a COMDAT
group so dead definition can be garbage collected by the linker.

We also disable the use of runtime counter relocation on Darwin since
Mach-O doesn't support weak external references, but Darwin already uses
a different continous mode that relies on overmapping so runtime counter
relocation isn't needed there.

Differential Revision: https://reviews.llvm.org/D105176
2021-07-19 12:23:51 -07:00
Artem Belevich b988d69ea2 [infer-address-spaces] Handle complex non-pointer constexpr arguments.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51099

Differential Revision: https://reviews.llvm.org/D106098
2021-07-19 12:15:52 -07:00
Simon Pilgrim 408f2b8b01 [SLP][X86] Add dot product tests based off PR51075 2021-07-19 20:06:23 +01:00
Nico Weber bcbb3066ce [lld/mac] Change load command order to be more like ld64
No meaningful behavior change. Makes diffing `otool -l` output a bit easier.

Differential Revision: https://reviews.llvm.org/D106219
2021-07-19 15:04:32 -04:00
Haowei Wu a2cc67eaf0 [ifs] Fix linking errors on some llvm builders
This change fixes linking errors on some llvm builders.
2021-07-19 12:01:34 -07:00
Artem Belevich 2c98298a75 [MemCpyOpt] Enable memcpy optimizations unconditionally.
The patch does not depend on the availability of the library functions for
memcpy/memset as it operates on LLVM intrinsics.  The optimizations are useful
on the targets that have these functions disabled (e.g. NVPTX & AMDGPU).

Differential Revision: https://reviews.llvm.org/D104801
2021-07-19 11:58:02 -07:00
Geoffrey Martin-Noble ef648df281 [Bazel] Update for 6103fdfab4
Update Bazel config for
https://github.com/llvm/llvm-project/commit/6103fdfab4
by deleting the llvm-elfabi target.

Differential Revision: https://reviews.llvm.org/D106295
2021-07-19 11:50:47 -07:00
David Carlier 2d56e1394b [Sanitizer] Intercepts flopen/flopenat on FreeBSD.
Reviewers: vitalybuka

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106218
2021-07-19 19:46:35 +01:00
Louis Dionne 9333d34b8a [libc++] Disable #pragma system_header in the new testing configuration
The new testing configuration did not turn off #pragma system_header,
which means we were not seeing warnings in system headers.

Differential Revision: https://reviews.llvm.org/D106187
2021-07-19 14:38:24 -04:00
LLVM GN Syncbot 68dec42e6b [gn build] Port 8b4acb067f 2021-07-19 18:24:11 +00:00
LLVM GN Syncbot e78560f6e8 [gn build] Port 61fa9afe4c 2021-07-19 18:24:10 +00:00
LLVM GN Syncbot d0ed40204d [gn build] Port 6103fdfab4 2021-07-19 18:24:09 +00:00
Haowei Wu 6103fdfab4 [ifs][elfabi] Merge llvm-ifs/elfabi tools
This change merges llvm-elfabi and llvm-ifs tools.

Differential Revision: https://reviews.llvm.org/D100139
2021-07-19 11:23:19 -07:00
Haowei Wu 61fa9afe4c [ifs] Prepare llvm-ifs for elfabi/ifs merging.
This diff changes llvm-ifs to use unified IFS file format
and perform other renaming changes in preparation for the
merging between elfabi/ifs.

Differential Revision: https://reviews.llvm.org/D99810
2021-07-19 11:23:00 -07:00
Haowei Wu 8b4acb067f [elfabi] Prepare elfabi/ifs merging.
This change implements unified text stub format and command line
interface proposed in the elfabi/ifs merge plan.

Differential Revision: https://reviews.llvm.org/D99399
2021-07-19 11:22:43 -07:00
Jonas Paulsson 6c0e6895d0 [SystemZ] Handle NoRegister in SystemZTargetLowering::emitMemMemWrapper().
Bugfix: The compiler should be able to generate a memset to nullptr.

Review: Ulrich Weigand
2021-07-19 20:04:44 +02:00
Amy Huang fd972bb9fd Revert "[llvm][sve] Lowering for VLS truncating stores" because it
causes a seg fault (see https://reviews.llvm.org/D104471).

This reverts commit c305557acd.
2021-07-19 11:03:33 -07:00
Eli Friedman 4f993463ca [NFC] Run -instnamer on test Transforms/LICM/sink-debuginfo-preserve.ll 2021-07-19 11:00:47 -07:00
Rob Suderman 11dda1a234 [mlir][tosa] Added shape inference for tosa convolution operations
Added shape inference handles cases for convolution operations. This includes
conv2d, conv3d, depthwise_conv2d, and transpose_conv2d. With transpose conv
we use the specified output shape when possible however will shape propagate
if the output shape attribute has dynamic values.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105645
2021-07-19 10:41:56 -07:00
Amara Emerson 03cdb5221d [GlobalISel] Fix load-or combine moving loads across potential aliasing stores.
Although this combine checks that there's no load folding barriers between
the loads that it's trying to merge, it was inserting the load at the
MIRBuilder's default insertion point, which is the G_OR use inst.

This was causing a miscompile in the test suite's
SingleSource/Regression/C/gcc-c-torture/execute/GCC-C-execute-bswap-2

Differential Revision: https://reviews.llvm.org/D106251
2021-07-19 10:23:23 -07:00
Wouter van Oortmerssen 670944fb20 [WebAssembly] Support R_WASM_MEMORY_ADDR_TLS_SLEB64 for wasm64
Also fixed TLS tests swapping addr & value in store op
Differential Revision: https://reviews.llvm.org/D106096
2021-07-19 10:22:43 -07:00
Craig Topper 50302feb1d [SelectionDAG][RISCV] Use isSExtCheaperThanZExt to control whether sext or zext is used for constant folding any_extend.
RISCV would prefer a sign extended constant since that works better
with our constant materialization. We have an existing TLI hook we
use to control sign extension of setcc operands in type legalization.
That hook happens to do the right check we need here, but might be
straying from its original purpose. With only RISCV defining this
hook in tree, I wasn't sure if it was worth adding another hook
with identical behavior.

This is an alternative to D105785 where I tried to handle this in
the RISCV backend by not creating ANY_EXTENDs in some places.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D105918
2021-07-19 09:25:28 -07:00
Hanhan Wang 9c49195330 [mlir][Linalg] Migrate 2D pooling ops from tc definition to yaml definition.
This deletes all the pooling ops in LinalgNamedStructuredOpsSpec.tc. All the
uses are replaced with the yaml pooling ops.

Reviewed By: gysit, rsuderman

Differential Revision: https://reviews.llvm.org/D106181
2021-07-19 09:24:02 -07:00
Victor Campos 59e4e53ead [NewPM] Fix wrong perfect forwardings
Some template functions were missing '&&' in function arguments,
therefore these were always taken by value after template instantiation.

This patch adds the double ampersand to introduce proper perfect
forwarding.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D106148
2021-07-19 17:21:32 +01:00
Amy Kwan 356300a351 [NFC][PowerPC] Update builtins-ppc-altivec.c to be run under `-faltivec-src-compat=mixed`
This patch adds the `-faltivec-src-compat=mixed` option to the
`builtins-ppc-altivec.c` test.

Currently, the default for `-faltivec-src-compat` is `mixed`. The reason we
explicitly specify `mixed` to the RUN lines of this test is because eventually,
the default will set to `xl`.

Having the default as `xl` changes the CHECKs of this test slightly, as it
reorders some of the `vector bool` and `vector pixel` CHECKs (since under the
`xl` option, `vector bool` and `vector pixel` are treated in the same way as
other vector scalars). Explicitly specifying `mixed` ensures that we are testing
pre-existing Clang behaviour.

Differential Revision: https://reviews.llvm.org/D106282
2021-07-19 11:20:21 -05:00
Simon Pilgrim 8c598b77a0 [ISD] Add disclaimer comments to AssertSext/Zext/Align opcodes about poison values
As encountered on D106053, we need to be very explicit that the Assertion nodes don't hold true for a poison value (or for specific poisoned vector elements).

Differential Revision: https://reviews.llvm.org/D106257
2021-07-19 17:15:28 +01:00
Simon Pilgrim 142e60f40b [X86] Fix case of IsAfterLegalize argument. NFC.
Pulled out of D106280
2021-07-19 17:15:28 +01:00
Tobias Gysi 87656a3134 [mlir][linalg] Fold TensorCast into PadTensorOp.
Add pattern to fold a TensorCast into a PadTensorOp if the cast removes static size information.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D106278
2021-07-19 15:57:38 +00:00
Matt Arsenault 67d6132463 GlobalISel: Preserve memory types for implicit sret load/stores 2021-07-19 11:52:42 -04:00
David Green 5561ad8b36 [ARM] Remove PromotedBitwiseVT for NEON types
This removes the promotion of NEON AND, OR and XOR nodes to v2i32/v4i32,
treating them the same as the AArch64 and MVE backends where we just add
the relevant patterns for each legal type. This prevents a lot of
bitcasts from being added to the DAG, which have the potential to make
optimizations more difficult. It does mean adding extra patterns, and
some codegen can change due to the types now being legal, not promoted.

Differential Revision: https://reviews.llvm.org/D105588
2021-07-19 16:36:33 +01:00
maekawatoshiki 74f0f9a455 [LICM] Create LoopNest Invariant Code Motion (LNICM) pass
This patch adds a new pass called LNICM which is a LoopNest version of LICM and a test case to show how LNICM works.
Basically, LNICM only hoists invariants out of loop nest (not a loop) to keep/make perfect loop nest. This enables later optimizations that require perfect loop nest.

Reviewed By: Whitney

Differential Revision: https://reviews.llvm.org/D104180
2021-07-20 00:31:18 +09:00
Matt Arsenault 9236125ec8 GlobalISel: Preserve LLT when bitcasting loads and stores
This also avoids improperly legalizing some truncating vector stores.
2021-07-19 11:30:14 -04:00
Riccardo Mori 84dfbf5a77 [Polly][Isl] Stop using isl::set::lex_le_set. NFC
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Stop using `isl::set::lex_le_set`. The official way to do this is to use `isl::map::lex_le_at`
 - Removed `isl::set::lex_le_set` from `isl-noexceptions.h`
 - `isl-noexceptions.h` has been generated by this 266fea1d3d

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D106269
2021-07-19 17:23:56 +02:00