Commit Graph

432182 Commits

Author SHA1 Message Date
Aarush Bhat a6cb8419b1
clang: fix typo availbility
- Fixes [[ https://github.com/llvm/llvm-project/issues/56787 | #56787 ]].

I am fixing the spelling of availability.

I am unsure if this change will have any side effects. If someone can
help on how to check if it has any side effects, I can test those out as
well.

Reviewed By: inclyc

Differential Revision: https://reviews.llvm.org/D131277
2022-08-07 03:44:55 +08:00
Krzysztof Parzyszek 2bc390bdd6 [RDF] Use default TargetOperandInfo if not given in constructor
All current in-tree users use the default implementation.
2022-08-06 14:32:52 -05:00
Thorsten Schütt 0c9258612b [bolt] silence unused variables warnings 2022-08-06 20:52:45 +02:00
Krzysztof Parzyszek ede96de751 [RDF] Remove explicit template arguments from Print
CTAD takes care of it.
2022-08-06 13:29:15 -05:00
Kazu Hirata c8e6ebd74e Use value instead of getValue (NFC) 2022-08-06 11:21:39 -07:00
Kazu Hirata 9750648cb4 [mlir, flang] Use has_value instead of hasValue (NFC) 2022-08-06 11:12:47 -07:00
Aaron Ballman 486a3c4662 Update the status of some more C DRs
Update some of the C99-era DRs starting in the 300s.
2022-08-06 11:53:40 -04:00
Benjamin Kramer d6eea96b8e [bazel] Port 1c5a50e328 2022-08-06 16:08:48 +02:00
Adrian Vogelsgesang 619e8f46f3 [libc++] Remove `operator!=` from `type_info` in C++20
Implements part of:

* P1614R2 The Mothership has Landed

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130853
2022-08-06 15:10:38 +02:00
Adrian Vogelsgesang 735240b38f [libc++] Implement `operator<=>` for `unique_ptr`
Implements part of:

  - P1614R2 The Mothership has Landed

Fixes LWG3426

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130838
2022-08-06 15:09:16 +02:00
Chen Zheng 13016f1f1b [NFC] add test cases for D123366 2022-08-06 08:56:42 -04:00
Chen Zheng ef60e44fe8 [PowerPC] fix stack size allocated for float point argument
This is for https://github.com/llvm/llvm-project/issues/56469

Allocate 4 bytes for float point arguments on PPC32.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D129558
2022-08-06 08:38:52 -04:00
Nico Weber f489297501 [gn build] fix 547c551925 2022-08-06 08:36:01 -04:00
Nico Weber 547c551925 [gn build] Try to fix build on linux after std=c++17 switch
glibc annotates `process_vm_readv` with `__THROW`.
lldb/include/lldb/Host/linux/Uio.h and
lldb/source/Host/linux/LibcGlue.cpp don't.

Having a mismatch causes an error with c++17:

    ../../lldb/source/Host/linux/LibcGlue.cpp:18:9:
        error: 'process_vm_readv' is missing exception specification 'throw()'
    ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov,
            ^
    ../../lldb/include/lldb/Host/linux/Uio.h:18:9:
        note: previous declaration is here
    ssize_t process_vm_readv(::pid_t pid, const struct iovec *local_iov,
            ^

The diagnostic is a bit misleading, since the previous declaration
in the sysroot (in usr/include/x76_64-linux-gnu/bits/uio-ext.h) is
what has the `__THROW`.

In the cmake build, cmake sets `HAVE_PROCESS_VM_READV` correctly based
on header probing.

In the GN build, just set it to 1 unconditionally on linux. If that
turns out to not be good enough everywhere, we'll have to add a GN arg
for this.

(I'm also setting it to 1 on Android. I'm not sure if that's correct --
but we don't build lldb for Android anyways.)
2022-08-06 08:34:24 -04:00
Markus Böck f7b73b7e8e [llvm] Remove uses of deprecated `std::iterator`
std::iterator has been deprecated in C++17 and some standard library implementations such as MS STL or libc++ emit deperecation messages when using the class.
Since LLVM has now switched to C++17 these will emit warnings on these implementations, or worse, errors in build configurations using -Werror.

This patch fixes these issues by replacing them with LLVMs own llvm::iterator_facade_base which offers a superset of functionality of std::iterator.

Differential Revision: https://reviews.llvm.org/D131320
2022-08-06 14:07:37 +02:00
Markus Böck 1c5a50e328 [mlir][tblgen] Refact mlir-tblgen main into its own library
This has previously been done for `mlir-opt` and `mlir-reduce` and roughly the same approach has been done here.

The use case for having a separate library is that it is easier for downstream to make custom TableGen backends/executable that work on top of the utilities that are defined in `mlir/TableGen`.
The customization point here is the same one as for any upstream TableGen backends: One can add a new generator by simply creating a global instance of `mlir::GenRegistration`.

Differential Revision: https://reviews.llvm.org/D131112
2022-08-06 14:07:37 +02:00
Nico Weber c59c8a515f [gn build] port b1356504e6 better (c++17) 2022-08-06 07:54:43 -04:00
Nico Weber 51a91d6c5d [gn build] port b1356504e6 (c++17) 2022-08-06 07:51:06 -04:00
Benjamin Kramer e0807b0d7e [bazel] Add missing dependency after 713f85d595 2022-08-06 11:34:24 +02:00
Fangrui Song e45a5696bb [ELF] toString(const InputFile *): synchronize toStringCache
The function may be called currently for diagnostics.
2022-08-06 01:00:06 -07:00
Leon Clark 6a275cd53c Transform illegal intrinsics to V_ILLEGAL
Related tasks:

- SWDEV-240194
- SWDEV-309417
- SWDEV-334876

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D123693
2022-08-06 08:59:00 +01:00
Tobias Hieta b1356504e6
[LLVM] Update C++ standard to 17
Also make the soft toolchain requirements hard. This allows
us to use C++17 features in LLVM now.

If we find patterns with C++17 that improve readability
it should be recommended in the coding standards.

Reviewed By: jhenderson, cor3ntin, MaskRay

Differential Revision: https://reviews.llvm.org/D130689
2022-08-06 09:42:10 +02:00
Jun Zhang 786b503f66
[Clang][Lex] Extend HeaderSearch::LookupFile to control OpenFile behavior.
In the case of static compilation the file system is pretty much read-only
and taking a snapshot of it usually is sufficient. In the interactive C++
case the compilation is longer and people can create and include files, etc.
In that case we often do not want to open files or cache failures unless is
absolutely necessary.

This patch extends the original API call by forwarding some optional flags,
so we can continue use it in the previous way with no breakage.
Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D131241
2022-08-06 11:36:02 +08:00
Chen Zheng e99ffe6ae8 [NFC] add test case for D129558 2022-08-05 23:15:48 -04:00
Slava Gurevich bcac7b3acb [LLDB] Missing break in a switch statement alters the execution flow.
Looks like a typo from the past code changes.

    Differential Revision: https://reviews.llvm.org/D131244
2022-08-05 18:33:18 -07:00
Fangrui Song d7cbfcf36a [ELF][AArch64] Fix potentially corrupted section content for PAC
D74537 introduced a bug: if `(config->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_PAC) != 0`
with -z pac-plt unspecified, we incorrectly use AArch64BtiPac, whose writePlt will make
out-of-bounds write after the .plt section. This is often benign because the
output section after .plt will usually overwrite the content.

This is very difficult to test without D131247 (Parallelize writes of different OutputSections).
2022-08-05 18:24:54 -07:00
Fangrui Song e89d6d2ac5 [ELF] Keep only getTarget() call. NFC
The place from D61712 seems unneeded now. We can just use the place added by
D62609 (support AArch64 BTI/PAC).
2022-08-05 18:20:23 -07:00
Argyrios Kyrtzidis 7b12e561ac [test/Modules/cxx20-export-import.cpp] Pre-clean the modules cache directory of the test, NFC 2022-08-05 17:27:43 -07:00
Fangrui Song abd9807590 [ELF] mergeCmp: work around irreflexivity bug
Some tests (e.g. aarch64-feature-pac.s) segfault in libstdc++ _GLIBCXX_DEBUG
builds (enabled by LLVM_ENABLE_EXPENSIVE_CHECKS).

dyn_cast<ThunkSection> is incorrectly true for any SyntheticSection. std::merge
transitively calls mergeCmp(x, x) (due to __glibcxx_requires_irreflexive_pred)
and will segfault in `ta->getTargetInputSection()`. The dyn_cast<ThunkSection>
issue should be eventually fixed properly, bug `a != b` is robust enough for now.
2022-08-05 17:08:37 -07:00
Nico Weber 3fbbf28173 unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV=OFF after 6635f48e4a
See revision b8b7a9dcdc for prior art.
2022-08-05 19:50:23 -04:00
Xiang Li 549542b494 [HLSL] emit-obj when set output.
When not set output, set default output to stdout.
When set output with -Fo and no -fcgl, set -emit-obj to generate dx container.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D130858
2022-08-05 16:27:17 -07:00
Joseph Huber 3b52341116 [CUDA] Fix output name being replaced in device-only mode
When performing device only compilation, there was an issue where
`cubin` outputs were being renamed to `cubin` despite the user's name.
This is required in a normal compilation flow as the Nvidia tools only
understand specific filenames instead of checking magic bytes for some
unknown reason. We do not want to perform this transformation when the
user is performing device only compilation.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D131278
2022-08-05 19:08:41 -04:00
Argyrios Kyrtzidis 6635f48e4a [Serialization] Remove `ORIGINAL_PCH_DIR` record
Use of `ORIGINAL_PCH_DIR` record has been superseeded by making PCH/PCM files with relocatable paths at write time.
Removing this record is useful for producing an output-path-independent PCH file and enable sharing of the same PCH file even
when it was intended for a different output path.

Differential Revision: https://reviews.llvm.org/D131124
2022-08-05 15:40:33 -07:00
Keith Smiley 9ec4ddd224
[Sanitizer][Darwin] Support OS versions before DRIVERKIT
Fixes https://github.com/llvm/llvm-project/issues/56960

Differential Revision: https://reviews.llvm.org/D131288
2022-08-05 15:39:05 -07:00
Fangrui Song 28d05d6723 [ELF][PPC64] Fix potentially corrupted section content with empty .got
D91426 makes .got possibly empty while needed. If .got and .data have the same
address, and .got's content is written after .data, the first word of .data will
be corrupted.

The bug is not testable without D131247.
2022-08-05 15:22:57 -07:00
Eugene Zhulenev 5f1c7e2cc5 [mlir] Use SymbolTableCollection to lookup referenced symbol in AddressOfOp
Depends On D131285

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D131291
2022-08-05 14:05:03 -07:00
Konstantin Varlamov 3fa291fa92 [libc++][ranges][NFC] Mark the completed Ranges papers and issues as done.
The newly-completed papers:
- P0896R4 ("The One Ranges Proposal");
- P1243R4 ("Rangify New Algorithms");
- P1252R2 ("Ranges Design Cleanup");
- P1716R3 ("Range Comparison Algorithms Are Over-Constrained");
- P1871R1 ("Concept traits should be named after concepts");
- P2106R0 ("Alternative wording for GB315 and GB316").

Differential Revision: https://reviews.llvm.org/D131234
2022-08-05 14:03:02 -07:00
Filipp Zhinkin c55899f763 [DAGCombiner] Hoist funnel shifts from logic operation
Hoist funnel shift from logic op:
logic_op (FSH x0, x1, s), (FSH y0, y1, s) --> FSH (logic_op x0, y0), (logic_op x1, y1), s

The transformation improves code generated for some cases related to
issue https://github.com/llvm/llvm-project/issues/49541.

Reduced amount of funnel shifts can also improve throughput on x86 CPUs by utilizing more
available ports: https://quick-bench.com/q/gC7AKkJJsDZzRrs_JWDzm9t_iDM

Transformation correctness checks:
https://alive2.llvm.org/ce/z/TKPULH
https://alive2.llvm.org/ce/z/UvTd_9
https://alive2.llvm.org/ce/z/j8qW3_
https://alive2.llvm.org/ce/z/7Wq7gE
https://alive2.llvm.org/ce/z/Xr5w8R
https://alive2.llvm.org/ce/z/D5xe_E
https://alive2.llvm.org/ce/z/2yBZiy

Differential Revision: https://reviews.llvm.org/D130994
2022-08-05 17:02:22 -04:00
Konstantin Varlamov 8ac015caf6 [libc++][ranges][NFC] Make sure all implemented algorithms are enabled in "robust" tests.
Also fix `std::find_first_of` (which accidentally copied the predicate
in the implementation).

Differential Revision: https://reviews.llvm.org/D131235
2022-08-05 14:02:12 -07:00
Lang Hames bc062e034f [ORC] Fix a memory leak in LLVMOrcIRTransformLayerSetTransform.
This function heap-allocates a ThreadSafeModule (the current C bindings assume
that TSMs are always heap-allocated), but was failing to free it.

Should fix http://llvm.org/PR56953.
2022-08-05 13:52:03 -07:00
Lang Hames 424626953e [examples][ORC] Add missing call to LLVMDisposeBuilder to example.
The missing call was pointed out in https://llvm.org/PR56953, though it's not
the focus of that issue.
2022-08-05 13:52:03 -07:00
Eugene Zhulenev 51bc82d147 [mlir] Implement SymbolUserOpInterface in LLVM::CallOp
Avoid expensive calls to `SymbolTable::lookupNearestSymbolFrom` in verifier

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D131285
2022-08-05 13:50:31 -07:00
Jakub Kuderski 5c16eeb7ee [mlir][spirv] Define spv.IAddCarry
Based on `spv.ISubBorrow` from D127909.
Also resolved some clang-tidy warnings.

Reviewed By: antiagainst, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D131281
2022-08-05 16:45:51 -04:00
Vitaly Buka 8d2901d537 [NFC][Inliner] Add Load/Store handler
This is an additional signal which may benefit sanitizers.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D131129
2022-08-05 13:42:17 -07:00
Ruobing Han b5244fb71c [test][SimpleLoopUnswitch] Precommit test for D129599 2022-08-05 20:17:26 +00:00
Florian Mayer 29ff262761 [HWASan] Remove incorrect unreachable.
This function could be called wih access_info & 0x20 or with
flags()->halt_on_error, in which case HandleTagMismatch returns (is not
fatal).

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D131279
2022-08-05 13:14:08 -07:00
Amaury Séchet cbd2b7cda4 [NFC] Regenerates X86's win64-bool.ll 2022-08-05 19:58:30 +00:00
Slava Zakharin 1b9faafe91 [flang] Lower MOD to Fortran runtime call.
This change removes dependency on pgmath mod, and also allows
Fortran runtime to issue a diagnostic message in case of zero
denominator.

Differential Revision: https://reviews.llvm.org/D131192
2022-08-05 12:53:37 -07:00
Craig Topper 75c64c7c4e [RISCV] Don't use li+sh3add for constants that can use lui+add.
If we're adding a constant that can't use addi we try a few tricks,
one of which is using li+sh3add. We should not do this if lui+add
would work. For example adding 8192. Using sh3add prevents folding
a sext.w to form addw, thus increasing instruction count.
2022-08-05 12:47:03 -07:00
Tobias Hieta 4b8db17c32 [llvm][macos] Fix usage of std::shared_mutex on old macOS SDK versions
When setting CMAKE_CXX_STANDARD to 17 and targeting a macOS version
under 10.12 the ifdefs would try to use std::shared_mutex because
the of the C++ standard. This should also check the targeted SDK.

See discussion in: https://reviews.llvm.org/D130689

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D131063
2022-08-05 21:45:23 +02:00