Commit Graph

412957 Commits

Author SHA1 Message Date
Martin Storsjö 5b79d5acdb [MC] Remove a stray space after tab for COFF .def directives
This extra stray space after tab can be traced back to when printing
of this directive was added originally in
4f01b783a3. The same commit added
inconsistent printing of space after the ELF .type directive too,
which was fixed later in
77fe07a93a.

(This is kind of NFC, but it does alter the output, so it's not
strictly non-functional in that sense.)

Differential Revision: https://reviews.llvm.org/D118401
2022-01-28 11:19:51 +02:00
Michał Górny 59a3f65f5e Revert "[lldb] [gdb-remote] Support getting siginfo via API"
This reverts commit 1a8f60f5f5.
The API requires further work.
2022-01-28 10:15:52 +01:00
David Spickett d1c124e6e7 [lldb][ARM/AArch64] Update dissembler to v9.3-a
This means sve2 is enabled by default and the v8.8 mops (memcpy
and memset acceleration instructions) and HBC (hinted conditional
branch) extensions can be disassembled.

v9.3-a is equivalent to v8.8-a except that in v9.0-a sve2 was
enabled by default so v9.3-a includes that too.

MTE remains an optional extension, only enabled for specific CPUs.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D118358
2022-01-28 09:10:04 +00:00
Nikita Popov a4ad79c50a [MLIR] Remove some pointer element type accesses
Use the MLIR pointer element type, rather than the LLVM pointer
element type.
2022-01-28 09:50:52 +01:00
Alexander Shaposhnikov 0d71f2e097 [lld][ELF] Cleanup %t directory in tests, NFC 2022-01-28 08:41:52 +00:00
Nikita Popov f2c2a31dd7 [OpenMPIRBuilder] Store element type in AtomicOpValue
With opaque pointers, we can no longer derive this from the pointer
type, so we need to explicitly provide the element type the atomic
operation should work with.

Differential Revision: https://reviews.llvm.org/D118359
2022-01-28 09:35:11 +01:00
Nikita Popov 93122b2567 [ARM] Don't look through pointer types in canTailPredicateLoop()
Inspecting the pointer element type here is incompatible with
opaque pointers, and doesn't seem necessary to me. I think the
intention might have been to check the type of load/store pointer
arguments, but I believe those should get checked through their
return type or value operand anyway. I don't get any test failures
if I simply drop this.

Differential Revision: https://reviews.llvm.org/D118353
2022-01-28 09:34:13 +01:00
Dominic Chen 3f72f9da43 [libc] Fix 64-bit Apple ARM support and header includes
Summary:

Reviewers: sivachandra

Subscribers:

Differential Revision: https://reviews.llvm.org/D114236
2022-01-28 00:22:47 -08:00
Chuanqi Xu 61528a7778 [NFC] Add tests for ODR checking of default template argument 2022-01-28 15:32:28 +08:00
Adrian Kuegel c962b3fdf8 [mlir][Bazel][cmake] Add missing dependency.
After 2c7b0685e1 this dependency is needed.
2022-01-28 08:20:24 +01:00
Christian Sigg f7da4a5d4d [NVPTX] Remove fmin/fmax.NaN.f64 again
Added in https://reviews.llvm.org/D117204, but it does not exist.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D118398
2022-01-28 07:46:16 +01:00
David Tenty 5cf9b2e341 [LLVM][AIX] Prefer a 32-bit default target triple on AIX
If the user doesn't specify a default target triple, the LLVM CMake usually defaults us into the host triple. This is a problem when building Clang/LLVM on 64-bit AIX (i.e. powerpc64-ibm-aix), as the host toolchain (e.g. ar, ld, nm, dump) all expect the compiler to generate 32-bit objects by default (which both GCC and XL on the platform do) and will hard error if passed a 64-bit object without an explicit option or environment setting. This breaks downstream consumers, such as builds generated with build tools like CMake, which when they invoke clang, etc. without explicit bitmode flags also expect 32-bit mode.

This patch changes the default target selection when the host is powerpc64-ibm-aix to prefer powerpc-ibm-aix to avoid these issues. We don't update the runtimes/CMakeList.txt since the default is less meaningful as we assume runtimes will need to build for both targets anyways.

Differential Revision: https://reviews.llvm.org/D118377
2022-01-28 01:34:03 -05:00
Chuanqi Xu 8cc23bde26 [NFC] Mark the parameter const for isSame* methods in ASTContext 2022-01-28 13:56:19 +08:00
Craig Topper 3e98ce45b6 [RISCV] Add Zbkb RUN lines to bswap-bitreverse.ll. NFC 2022-01-27 21:21:17 -08:00
Vitaly Buka f750c3d95a Revert "clang-format: [JS] sort import aliases."
Triggers MSAN report.

This reverts commit c6d5efb5d9.
2022-01-27 21:16:53 -08:00
Craig Topper dcd751b26e [RISCV] Split bswap-bitreverse-ctlz-cttz-ctpop.ll into two files bswap/bitreverse and ctlz/cttz/ctpop. NFC
Add Zbkb command lines to the bswap/bitreverse test.
2022-01-27 21:12:03 -08:00
Max Kazantsev b3d2a96d65 [Test] One more test for 'ne' and-reduce pattern 2022-01-28 12:11:37 +07:00
Heejin Ahn 4f1244d7cc [WebAssembly] Nullify unnecessary setjmp invokes
This is similar to D116619, but now it handles `invoke`s. The reason we
didn't handle `invoke`s back then was we didn't support Wasm EH + Wasm
SjLj together, and the only case SjLj transformation will see `invoke`s
is when we are using Wasm EH. (In Emscripten EH, they would have been
transformed to `call`s to invoke wrappers.)

But after D117610 we support Wasm EH + Wasm SjLj together and we can
nullify `invoke`s to `setjmp` when there is no other longjmpable calls
within the function. Actually this is very unlikely to happen in
practice, because we treat destructors as longjmpable and also treat
`__cxa_end_catch` as longjmpable even if it is not.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D118408
2022-01-27 21:11:10 -08:00
Heejin Ahn 20c1d9ce5e [WebAssembly] Handle cleanuppad with no parent in Wasm SjLj
Wasm SjLj converts longjmpable calls into `invoke`s that unwind to
`%catch.longjmp.dispatch` BB, from where we check if the thrown
exception is a `longjmp`. But in case a call already has a `funclet`
attribute, i.e., it is within a catch scope, we have to unwind to its
unwind destination first to preserve the scoping structure. That will
eventually unwind to `%catch.longjmp.dispatch`, because all
`catchswitch` and `cleanupret` that unwind to caller are redirected to
`%catch.dispatch.longjmp` during Wasm SjLj transformation.

But the prevous code assumed `cleanuppad`'s parent pad was always an
instruction, and didn't handle when a `cleanuppad`'s parent is `none`.
This CL handles this case, and makes the `while` loop more intuitive by
removing `FromPad` condition and explicitly inserting `break`s.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D118407
2022-01-27 21:10:23 -08:00
Heejin Ahn 26d587cf0f [WebAssembly] Error out for setjmp within catch clause for Wasm SjLj
Wasm EH, used with either of Emscripten SjLj or Wasm SjLj, does not
allow `setjmp` calls to be placed within a `catch` clause, because we
don't support jumping into a `catch` block. Emscripten EH does not have
this restriction. But I think this restriction wouldn't prevent most of
use cases. This CL errors out with a clear messsage for this case.

Reviewed By: dschuff, kripken

Differential Revision: https://reviews.llvm.org/D118286
2022-01-27 21:05:43 -08:00
Heejin Ahn 786da40667 [WebAssembly] Don't copy noreturn attr to invokes
When we create an invoke wrapper call, if the original call instruction
has a `noreturn` attribute, we shouldn't copy it, because we expect
invoke wrapper calls to return. This generated incorrect `free` call
before an invoke wrapper call that calls `__cxa_throw`, because
`__cxa_throw` has `noreturn` attribute.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D118274
2022-01-27 21:04:43 -08:00
Heejin Ahn d9517efbb3 [WebAssembly] Treat __cxa_end_catch not longjmpable in Emscripten SjLj
In D117610 we treated `__cxa_end_catch` longjmpable even though it was
not to make unwind destination relationships correct. But we only need
to do this in Wasm SjLj, and doing this in Emscripten SjLj does not make
the code incorrect but add unnecessary invokes. This CL treats
`__cxa_end_catch` longjmpable only in Wasm SjLj.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D117943
2022-01-27 21:03:23 -08:00
Max Kazantsev a4aaa59953 [Test] Add 'ne' tests for and-reduce pattern folding 2022-01-28 11:47:05 +07:00
Max Kazantsev 8599bb0f26 [InstCombine] Fold and-reduce idiom
This patch introduces folding of and-reduce idiom and generates code
that is easier to read and which is lest costly in terms of icmp operations.
The folding is
```
  icmp eq (bitcast(icmp ne (lhs, rhs)), 0)
```
into
```
  icmp eq(bitcast(lhs), bitcast(rhs))
```

See PR53419.

Differential Revision: https://reviews.llvm.org/D118317
Reviewed By: lebedev.ri, spatel
2022-01-28 11:20:08 +07:00
Jonas Devlieghere 4a64955c37 [lldb] Remove reproducers documentation 2022-01-27 19:35:28 -08:00
Frederik Gossen 2c7b0685e1 Fix tensor.extract for complex elements 2022-01-28 04:33:15 +01:00
Fangrui Song 232c601676 [Driver] Update clang -B help message
* After 3452a0d8c1 (2020-07), $prefix/$triple-$file is not searched.
* Unlike GCC, -B is not used for include paths. Seems nobody needs this behavior because there are more targeted options like --sysroot/-isystem
2022-01-27 19:05:10 -08:00
Chenbing.Zheng 6d6c44a3f3 [RISCV] Add support for matching vwmulsu from fixed vectors
According to riscv-v-spec-1.0, widening signed(vs2)-unsigned integer multiply
vwmulsu.vv vd, vs2, vs1, vm # vector-vector
vwmulsu.vx vd, vs2, rs1, vm # vector-scalar

It is worth noting that signed op is only for vs2.
For vwmulsu.vv, we can swap two ops, and don't care which is sign extension,
but for vwmulsu.vx signExt can not be a vector extended from scalar (rs1).
I specifically added two functions ending with _swap in the test case.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D118215
2022-01-28 02:33:30 +00:00
Florian Mayer d5aec5e260 [NFC] remove unnecessary references. 2022-01-27 17:48:44 -08:00
Ron Lieberman 619f44b0ed Revert "[OpenMP] Ensure broken assumptions print once, not thousands of times."
This reverts commit 27c799ecc9.
2022-01-28 01:41:10 +00:00
Ellis Hoag 11d3074267 [InstrProf] Add single byte coverage mode
Use the llvm flag `-pgo-function-entry-coverage` to create single byte "counters" to track functions coverage. This mode has significantly less size overhead in both code and data because
  * We mark a function as "covered" with a store instead of an increment which generally requires fewer assembly instructions
  * We use a single byte per function rather than 8 bytes per block

The trade off of course is that this mode only tells you if a function has been covered. This is useful, for example, to detect dead code.

When combined with debug info correlation [0] we are able to create an instrumented Clang binary that is only 150M (the vanilla Clang binary is 143M). That is an overhead of 7M (4.9%) compared to the default instrumentation (without value profiling) which has an overhead of 31M (21.7%).

[0] https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116180
2022-01-27 17:38:55 -08:00
Nico Weber 936f247ade [gn build] fix mac build after 0c425b43b9 2022-01-27 20:35:17 -05:00
Sam Clegg 875ee937ae [lld][WebAssembly] Handle TLS symbols in older object file
In older versions of llvm (e.g. llvm 13), symbols were not individually
flagged as TLS.  In this case, the indent was to implicitly mark any
symbols defined in TLS segments as TLS.  However, we were not performing
this implicit conversion if the segment was explicitly marked as TLS

As it happens, llvm 13 was branched between the addition of the segment
flag and the addition of the symbol flag. See:

- segment flag added: https://reviews.llvm.org/D102202
- symbol flag added: https://reviews.llvm.org/D109426

Testing this is tricky because the assembler will imply the TLS status
of the symbol based on the segment its declared in, so we are forced to
use a yaml file here.

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

Differential Revision: https://reviews.llvm.org/D118414
2022-01-27 17:27:09 -08:00
Aart Bik 35ece3beaa [mlir][sparse][pytaco] add PyTACO SpMM example
Also contains a few TODOs on future enhancements

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D118418
2022-01-27 17:26:22 -08:00
Ruslan Arutyunyan 843c12d6a0 [libc++][pstl] Implement tag dispatching mechanism for Parallel STL
Implement the mechanism that simplifies the execution policy/iterator
category dispatching and allows to implement customizations for
the parallel algorithms with adding custom tags

Reviewed By: rodgert, MikeDvorskiy

Differential Revision: https://reviews.llvm.org/D104492
2022-01-28 04:09:51 +03:00
Nico Weber 912f1c8ce3 [gn build] slighly reformat files to make sync script work 2022-01-27 20:09:04 -05:00
Vitaly Buka bddc814b44 [msan] Copy origin of byval arguments
Depends on D117278

Reviewed By: kda, eugenis

Differential Revision: https://reviews.llvm.org/D117285
2022-01-27 16:24:07 -08:00
Arthur Eubanks 0c425b43b9 [gn build] Add support for check-asan
With these changes, check-asan passes on Linux and Windows.

There are a couple libraries we need to add support for, asan_static, asan_preinit, and the shared library version of asan proper.
Since we need to build the asan proper sources twice, once with -DASAN_DYNAMIC and once without, those sources are no longer in a source_set.
Much of the check-asan target is taken from the existing check-hwasan target.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D118307
2022-01-27 16:09:43 -08:00
Joseph Huber 27c799ecc9 [OpenMP] Ensure broken assumptions print once, not thousands of times.
If we have a broken assumption we want to print a message to the user.
If the assumption is broken by many threads in many teams this can
become a problem. To avoid it we use a hash that tracks if a broken
assumption has (likely) been printed and avoid printing it again. This
is not fool proof and has some caveats that might cause problems in
the future (see comment) but it should improve the situation
considerably for now.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D112156
2022-01-27 18:43:45 -05:00
Joseph Huber 2945f11c60 [OpenMP] Only generate runtime flags with host input
This patch changes the code generation of runtime flags to only occur if
a host bitcode file was passed in. This is a cheap way to determine if
we are compiling the OpenMP device runtime itself or user code. This is
needed because the global flags we generate for the device runtime e.g.
__omp_rtl_debug_kind were being generated with default values when we
compiled the runtime library. This would then invalidate the ones we
want to be able to add in when the user defines it.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D118399
2022-01-27 18:43:41 -05:00
Mogball 1e3a02162d [mlir][scf] Update IfOp to have getInvocationBounds
This allows `scf.if` to be used by Control-Flow sink.

Depends on D115088

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D115089
2022-01-27 23:15:53 +00:00
LLVM GN Syncbot aa53d0781b [gn build] Port bf20a09790 2022-01-27 23:10:54 +00:00
Arthur O'Dwyer bf20a09790 [libc++] [P1614] Implement the second half of [cmp.alg]: compare_{strong,weak,partial}_fallback.
The tests for these are just copy-pasted from the tests for std::{strong,weak,partial}_order,
and then I added an extra clause in each (test_2()) to test the stuff that's not just the same
as std::*_order.

This also includes the fix for https://wg21.link/LWG3465 (which falls naturally out of the
"you must write it three times" style, but I've added test cases for it also).

There is an action item here to go back and give good diagnostics for SFINAE failures
in these CPOs. I've filed this as https://github.com/llvm/llvm-project/issues/53456 .

Differential Revision: https://reviews.llvm.org/D111514
2022-01-27 17:48:01 -05:00
Arthur Eubanks 662ef6d177 [NFC][Clang][OpaquePtr] Move away from deprecated Address constructor in VisitArrayInitLoopExpr
With this we can bootstrap an `-O0 -g0` clang with `-mllvm -opaque-pointers`!
2022-01-27 14:44:53 -08:00
Arthur Eubanks 6e8a66bdad [NFC][Clang][OpaquePtr] Move away from deprecated Address constructor in EmitCXXMemberDataPointerAddress() 2022-01-27 14:44:53 -08:00
Arthur O'Dwyer f9a00b3cbc Revert "[clang] Don't typo-fix an expression in a SFINAE context."
This reverts commit 9be5f4d5af.

I'm not sure if this caused
 https://lab.llvm.org/buildbot/#/builders/60/builds/6350
 https://lab.llvm.org/buildbot/#/builders/119/builds/7433
but I'm acting as if it did.
2022-01-27 17:36:08 -05:00
Brian Cain d5ab243c6f Omit atomic_{,un}signed_lock_free if unsupported
On targets that have limited atomic support, e.g. ones that define
ATOMIC_*_LOCK_FREE to '1' ("sometimes lock free"), we would end up
referencing yet-undefined __libcpp_{,un}signed_lock_free.

This commit adds a guard to prevent these references for such
targets.

Differential Revision: https://reviews.llvm.org/D118391
2022-01-27 14:29:08 -08:00
Vladislav Khmelevsky e900f0584e [BOLT] Fix AARCH64 registers aliasing
The aarch64 platform has special registers like X0_X1_X2_X3_X4_X5_X6_X7.
Using the downwards propagation this register will become a super
register for all X0..X7 and its super registers which is not right. This
patch replaces the downwards propagation with caching all the aliases using MCRegAliasIterator.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D117394
2022-01-28 01:24:35 +03:00
Sam James 11c2ef5638 unwind: fix typo for __powerpc__
Fixes: cd20e579df
Signed-off-by: Sam James <sam@gentoo.org>
2022-01-27 23:21:07 +01:00
Arthur Eubanks f17123831e [NFC][Clang][OpaquePtr] Move away from deprecated Address constructor in CreateTempAlloca()
Specify the Address element type, which is the bitcast destination type.
(the whole bitcast won't be needed after opaque pointers)
2022-01-27 14:18:54 -08:00