Commit graph

417552 commits

Author SHA1 Message Date
Peixin-Qiao b905864845 [flang] Support for dump OpenMP/OpenACC declarative directives PFT in module
OpenMP/OpenACC declarative directives can also be used in module unit.
Add support for dump them in module.

Reviewed By: kiranchandramohan, V Donaldson

Differential Revision: https://reviews.llvm.org/D120459
2022-03-11 14:33:17 +08:00
Craig Topper 337d49da84 [RISCV] Fix typo in comment. NFC 2022-03-10 22:00:18 -08:00
Eric Tang 336c92d5e8 [RISCV] Add alias for HFENCE.VVMA
Signed-off-by: Eric Tang <eric.tang@starfivetech.com>

Differential Revision: https://reviews.llvm.org/D120878
2022-03-11 13:32:52 +08:00
Johannes Doerfert e8fadafe77 [Attributor][NFCI] Make AAPointerInfo deterministic
The order in which we kept accesses was non-deterministic and a debug
output was a pointer value. Fixed both.
2022-03-10 23:27:47 -06:00
Johannes Doerfert 7211dbd01d [Attributor][NFCI] Remove non-deterministic behavior and debug output 2022-03-10 23:27:47 -06:00
Craig Topper 1f3a8d58a6 [RISCV] Use ZERO_EXTEND instead of ANY_EXTEND when promoting i32 RISCVISD::SHFL. NFC
We know the shift amount is a constant with bit 31 clear. anyext
of constant will be either zext or sext which will produce the
same result here. But we really shouldn't rely on that. It would
be valid to put a random number in the upper bits. Our isel patterns
expect the upper bits to be 0 so we should ask for it explicitly.
2022-03-10 20:57:04 -08:00
Weining Lu 097035f308 [LoongArch] Use getLoc() directly to construct error message 2022-03-11 11:55:35 +08:00
Fangrui Song 4a8de2832a [ELF] Add -z pack-relative-relocs
GNU ld 2.38 added -z pack-relative-relocs which is similar to
--pack-dyn-relocs=relr but synthesizes the `GLIBC_ABI_DT_RELR` version
dependency if a shared object named `libc.so.*` has a `GLIBC_2.*` version
dependency.

This is used to implement the (as some glibc folks call) version lockout
mechanism. Add this option, because glibc does not want to support
--pack-dyn-relocs=relr which does not add `GLIBC_ABI_DT_RELR`.
See https://maskray.me/blog/2021-10-31-relative-relocations-and-relr for
detail.

Close https://github.com/llvm/llvm-project/issues/53775

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D120701
2022-03-10 19:54:21 -08:00
Alex Brachet e970d2823c [llvm-mt] Add support /notify_update
`/notify_update` is an undocumented feature used by CMake. From their usage, it looks like this feature just changes `mt`'s exit code if the output file was changed. See https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2300 this is also consistent with some testing I have done of the mt.exeshipped with Visual Studio. See also the comment at https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmcmd.cxx#L2440.

There might be a more performant way to implement this by first checking calling `llvm::sys::fs::file_size()` and if it is the same as the new output's size use `llvm::WritableMemoryBuffer` and fallback to `llvm::FileOutputBuffer` otherwise,  but these don't inherit from a common ancestor so any implementation doing this would be really ugly.

Fixes https://github.com/llvm/llvm-project/issues/54329

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D121438
2022-03-11 03:46:46 +00:00
Khem Raj a11d1cc41c [builtins] Use mcr for dmb instruction on armv6
At present compiler-rt cross compiles for armv6 ( -march=armv6 ) but includes
dmb instructions which are only available in armv7+ this causes SIGILL on
clang+compiler-rt compiled components on rpi0w platforms.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D99282
2022-03-10 19:30:00 -08:00
4vtomat 25df633c24 Split up large test files(over 10k lines) under clang/test/CodeGen/RISCV including:
The llvm pre-merge test got timeout due to large test files, this commit
split up the files that have over 10k lines under clang/test/CodeGen/RISCV
into even smaller ones.

Differential Revision: https://reviews.llvm.org/D121431
2022-03-10 19:13:39 -08:00
Chia-hung Duan ed645f6336 [mlir] Support verification order (3/3)
In this CL, update the function name of verifier according to the
behavior. If a verifier needs to access the region then it'll be updated
to `verifyRegions`.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D120373
2022-03-11 01:16:28 +00:00
Jez Ng fc968bcba4
[lld-macho][nfc] Fix formatting in ld64-vs-lld.rst 2022-03-10 18:33:18 -05:00
Sanjay Patel ca808e8924 [x86] add tests for and+setcc; NFC 2022-03-10 18:32:00 -05:00
Zhiyao Ma adc26b4eae [ARM] Fix 8-bit immediate overflow in the instruction of segmented stack prologue.
It fixes the overflow of 8-bit immediate field in the emitted
instruction that allocates large stacklet.

For thumb2 targets, load large immediate by a pair of movw and movt
instruction. For thumb1 and ARM targets, load large immediate by reading
from literal pool.

Differential Revision: https://reviews.llvm.org/D118545
2022-03-10 15:15:24 -08:00
Philippe Valembois 26cd258420 [AArch64] Use correct calling convention for each vararg
While checking is tail call optimization is possible, the calling
convention applied to fixed arguments is not the correct one.
This implies for DarwinPCS that all arguments of a vararg function will
go to the stack although fixed ones can go in registers.

This prevents non-virtual thunks to be tail optimized although they are
marked as musttail.

Differential Revision: https://reviews.llvm.org/D120622
2022-03-10 15:07:25 -08:00
Zequan Wu d54c4df314 [clang-format] Fix namespace format when the name is followed by a macro
Example:
```
$ cat a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}

$ clang-format a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}// namespace my_namespace::yeahAPI_AVAILABLE(macos(10.15))
```
After:
```
$ clang-format a.cpp
namespace my_namespace::yeah API_AVAILABLE(macos(10.15)) {
void test() {}
}// namespace my_namespace::yeah
```

Reviewed By: MyDeveloperDay, owenpan, curdeius

Differential Revision: https://reviews.llvm.org/D121269
2022-03-10 15:00:32 -08:00
Sam McCall 7f0df31ee3 [clang-tools-extra] Don't consider python below LLVM_MINIMUM_PYTHON_VERSION. NFC 2022-03-10 23:57:27 +01:00
Dave Lee 14e4d2e564 [lldb] Remove unused include in ScriptedProcessInterface.h 2022-03-10 14:56:21 -08:00
Eli Friedman 27a5749625 [Sema][Windows] Don't special-case void* in __unaligned conversions.
As far as I can tell, MSVC allows the relevant conversions for all
pointer types. Found compiling a Windows SDK header.

I've verified that the updated errors in MicrosoftExtensions.cpp match
the ones that MSVC actually emits, except for the one with a FIXME. (Not
sure why this wasn't done for the patch that added the tests.)

To make up for the missing error, add a warning that triggers on
conversions that drop the __unaligned qualfier.

Differential Revision: https://reviews.llvm.org/D120936
2022-03-10 14:49:16 -08:00
Diego Caballero f71f9958b9 [mlir][Vector] Modernize default lowering of vector transpose
This patch removes an old recursive implementation to lower vector.transpose to extract/insert operations
and replaces it with a iterative approach that leverages newer linearization/delinearization utilities.
The patch should be NFC except by the order in which the extract/insert ops are generated.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D121321
2022-03-10 22:33:14 +00:00
Florian Hahn 3c9e849943
[FunctionAttrs] Add tests for argmemonly inference. 2022-03-10 22:32:29 +00:00
owenca 0be56c8701 [clang-format][NFC] Group all C++ passes under isCpp()
Also removes a not very helpful comment.
2022-03-10 14:30:30 -08:00
Sam McCall 2d58ba200a [clang-tools-extra] Remove unused lit features/substitutions. NFCI 2022-03-10 23:28:43 +01:00
Sam McCall 6ed2f8902b Fix reference to execute_external leftover in 69924ccf7a 2022-03-10 23:20:03 +01:00
Sam McCall 69924ccf7a Remove redundant lit config already handled in llvm_config. NFCI
This logic duplicates lit.llvm.initialize, which we're already calling
(in lit.site.cfg.py.in).
The equivalent logic was removed from clang in d4401d354a but
never cleaned up here.
2022-03-10 23:11:01 +01:00
Dave Lee 47f652d695 [lldb] Call ThreadPlan::DiscardPlan from Thread::DiscardPlan
Correct `Thread::DiscardPlan` to call `DiscardPlan` instead of `PopPlan`.

Differential Revision: https://reviews.llvm.org/D96655
2022-03-10 13:58:08 -08:00
Sylvestre Ledru 54d7fde46e llvm-ifs doc: Replace a utf-8 char by a more classic one
Fails on old python (like on ubuntu bionic) otherwise with:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2130: ordinal not in range(128)
2022-03-10 22:45:05 +01:00
Kirill Stoimenov 120e0434bc [ASan] Added back @PLT to __asan_report_* calls to avoid compile errors.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D121409
2022-03-10 21:43:00 +00:00
Saleem Abdulrasool c604207608 lldb/ObjectFile,Disassembler: read some state from the executable
Add support to inspect the ELF headers for RISCV targets to determine if
RVC or RVE are enabled and the floating point support to enable.  As per
the RISCV specification, d implies f, q implies d implies f, which gives
us the cascading effect that is used to enable the features when setting
up the disassembler.  With this change, it is now possible to attach the
debugger to a remote process and be able to disassemble the instruction
stream.

~~~
$ bin/lldb tmp/reduced
(lldb) target create "reduced"
Current executable set to '/tmp/reduced' (riscv64).
(lldb) gdb-remote localhost:1234
(lldb) Process 5737 stopped
* thread #1, name = 'reduced', stop reason = signal SIGTRAP
    frame #0: 0x0000003ff7fe1b20
->  0x3ff7fe1b20: mv     a0, sp
    0x3ff7fe1b22: jal    1936
    0x3ff7fe1b26: mv     s0, a0
    0x3ff7fe1b28: auipc  a0, 27
~~~
2022-03-10 21:42:06 +00:00
Siva Chandra Reddy 1f45a1071d [libc][Obvious] Destroy the block store var in block store test. 2022-03-10 21:36:46 +00:00
owenca e2b219bded [clang-format] Handle "// clang-format off" for RemoveBracesLLVM
Differential Revision: https://reviews.llvm.org/D121352
2022-03-10 13:30:53 -08:00
Siva Chandra Reddy 19c6098097 [libc] Add a resizable container with constexpr constructor and destructor.
The new container is used to store atexit callbacks. This way, we avoid
the possibility of the destructor of the container itself getting added
as an at exit callback.

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D121350
2022-03-10 21:28:23 +00:00
Zahira Ammarguellat 15ef06f453 Diagnose when #pragma clang fp eval_method doesn't have a supported value.
Currently the compiler is crashing.

Differential Revision: https://reviews.llvm.org/D121380
2022-03-10 13:19:53 -08:00
Kirill Stoimenov 035441ff30 [ASan] Moved optimized callbacks out of asan_static to avoid DSO size increase.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D121405
2022-03-10 21:11:32 +00:00
Florian Hahn d90d45fc90
[FunctionAttrs] Add initial test for pass statistics. 2022-03-10 21:02:41 +00:00
Simon Pilgrim db522568d5 [X86] Add (u)comiss/sd tests showing eflags handling (PR38960) 2022-03-10 20:59:52 +00:00
Louis Dionne 071762199f [libc++] Add tests for the content of <cstddef>
As discussed in D114786.

Differential Revision: https://reviews.llvm.org/D121110
2022-03-10 15:54:15 -05:00
Louis Dionne 553ab7a090 [libc++] Remove operator-> from iterator archetypes that don't need it
operator-> is not a requirement for most iterators, so remove it. To
account for this change, the `common_iterator.operator->` test needs to
be refactored quite a bit -- improve test coverage while we're at it.

Differential Revision: https://reviews.llvm.org/D118400
2022-03-10 15:52:34 -05:00
Jonas Devlieghere c24199e8e8
[lldb] Always listen for progress events in the default event handler
We came to the conclusion that this doesn't matter for VSCode/Xcode
because they don't use the default event loop and that other clients
who might care should use the setting.

Differential revision: https://reviews.llvm.org/D120972
2022-03-10 12:51:27 -08:00
Zequan Wu 5e9c9b324a [LLDB][NativePDB] Add support for S_DEFRANGE_REGISTER and S_DEFRANGE_SUBFIELD_REGISTER
Differential Revision: https://reviews.llvm.org/D119508
2022-03-10 12:40:31 -08:00
Thomas Raoux 2f33f11428 [mlir][NVVM] Add ldmatrix op to NVVM dialect
Differential Revision: https://reviews.llvm.org/D121347
2022-03-10 20:37:17 +00:00
Stanislav Mekhanoshin c7f25b6fd4 [AMDGPU] Updated some tests to run on gfx940. NFC. 2022-03-10 12:34:24 -08:00
Sam McCall 895653d904 [cmake] Remove unused OUTPUT_MAPPING param to configure_lit_site_cfg(). NFC
Looks like it never did anything.
Added in 71deeee593
2022-03-10 21:26:53 +01:00
Jez Ng 4308f031cd [lld-macho] Align cstrings less conservatively
Previously, we aligned every cstring to 16 bytes as a temporary hack to
deal with https://github.com/llvm/llvm-project/issues/50135. However, it
was highly wasteful in terms of binary size.

To recap, in contrast to ELF, which puts strings that need different
alignments into different sections, `clang`'s Mach-O backend puts them
all in one section.  Strings that need to be aligned have the .p2align
directive emitted before them, which simply translates into zero padding
in the object file. In other words, we have to infer the alignment of
the cstrings from their addresses.

We differ slightly from ld64 in how we've chosen to align these
cstrings. Both LLD and ld64 preserve the number of trailing zeros in
each cstring's address in the input object files. When deduplicating
identical cstrings, both linkers pick the cstring whose address has more
trailing zeros, and preserve the alignment of that address in the final
binary. However, ld64 goes a step further and also preserves the offset
of the cstring from the last section-aligned address.  I.e. if a cstring
is at offset 18 in the input, with a section alignment of 16, then both
LLD and ld64 will ensure the final address is 2-byte aligned (since
`18 == 16 + 2`). But ld64 will also ensure that the final address is of
the form 16 * k + 2 for some k (which implies 2-byte alignment).

Note that ld64's heuristic means that a dedup'ed cstring's final address is
dependent on the order of the input object files. E.g. if in addition to the
cstring at offset 18 above, we have a duplicate one in another file with a
`.cstring` section alignment of 2 and an offset of zero, then ld64 will pick
the cstring from the object file earlier on the command line (since both have
the same number of trailing zeros in their address). So the final cstring may
either be at some address `16 * k + 2` or at some address `2 * k`.

I've opted not to follow this behavior primarily for implementation
simplicity, and secondarily to save a few more bytes. It's not clear to me
that preserving the section alignment + offset is ever necessary, and there
are many cases that are clearly redundant. In particular, if an x86_64 object
file contains some strings that are accessed via SIMD instructions, then the
.cstring section in the object file will be 16-byte-aligned (since SIMD
requires its operand addresses to be 16-byte aligned). However, there will
typically also be other cstrings in the same file that aren't used via SIMD
and don't need this alignment. They will be emitted at some arbitrary address
`A`, but ld64 will treat them as being 16-byte aligned with an offset of
`16 % A`.

I have verified that the two repros in https://github.com/llvm/llvm-project/issues/50135
work well with the new alignment behavior.

Fixes https://github.com/llvm/llvm-project/issues/54036.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D121342
2022-03-10 15:18:15 -05:00
Elvina Yakubova db65429db5 [BOLT] Divide RegularPageSize for X86 and AArch64 cases
For AArch64 in some cases/some distributions ld uses 64K alignment of LOAD segments by default.

Reviewed By: yota9, maksfb

Differential Revision: https://reviews.llvm.org/D119267
2022-03-10 23:09:50 +03:00
Dave Lee e3dfa30501 [lldb] Remove extra space in step logging message
When seeing the extra space in the log, it wasn't clear if there was a missing
printf argument. Removing the extra space removes the potential confusion.
2022-03-10 12:02:58 -08:00
wren romano 3734c0783e [mlir][sparse] Improving error messages for openSparseTensorCOO
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D121333
2022-03-10 11:48:19 -08:00
Craig Topper 9ce6b1ca86 [RISCV] Remove performANY_EXTENDCombine.
This doesn't appear to be needed any more. I did some inspecting
of the gcc torture suite and SPEC2006 with this removed and didn't
find any meaningful changes.

I think we're more aggressive about forming ADDIW now using
sign_extend_inreg during type legalization and hasAllWUsers in isel.
This probably helps catch the cases this helped with before.
2022-03-10 11:29:31 -08:00
Pavel Labath ed1a83befe [lldb/gdb-remote] Remove ancient debugserver workaround
This workaround is the source of an awkwared Process->Platform
dependency. While this could be solved in various ways (the only thing
we really use is the plugin name), it may be better to just remove it --
the workaround was added 10 years ago (43c555dfc), and the affected
debugservers were "old" even then, so hopefully they are not in use
anymore.

Differential Revision: https://reviews.llvm.org/D121305
2022-03-10 20:26:54 +01:00