462680 Commits

Author SHA1 Message Date
Krzysztof Drewniak
087b67cc06 [AMDGPU][LoadStoreVectorizer] Pre-commit test for addrspace 7 crash
Differential Revision: https://reviews.llvm.org/D151751
2023-05-30 21:15:21 +00:00
Fangrui Song
43bec3376c Remove HAVE_STRERROR
Most systems support strerror_r. For the remaining systems (e.g. MSVC) strerror_s and
strerror can be used as fallbacks. We don't have a supported operating
system/compiler that doesn't provide `strerror`.

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

https://github.com/flang-compiler/f18/pull/1068 added a fallback
when strerror is unavailable, but I think the code path is dead.

Reviewed By: serge-sans-paille, vzakhari

Differential Revision: https://reviews.llvm.org/D151718
2023-05-30 14:12:20 -07:00
Jan Svoboda
e348dbc4b2 [lldb] Fix build after Clang API change
This fixes breakage introduced by 769d282d.
2023-05-30 14:08:04 -07:00
Jan Svoboda
e19f352bee [clang][lex] NFCI: Use DirectoryEntryRef in Preprocessor::MainFileDir
This patch changes the type of `Preprocessor::MainFileDir` from `const DirectoryEntry *` to `Optional<DirectoryEntryRef>` in order to remove some calls to the deprecated `DirectoryEntry::getName()`.

Depends on D127658.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127660
2023-05-30 13:54:06 -07:00
Jan Svoboda
b1e5b28b8c [clang][lex] NFCI: Use FileEntryRef in Sema::CodeCompleteIncludedFile
This patch replaces some calls to the deprecated `DirectoryEntry::getName()` with calls to `DirectoryEntryRef::getName()` in SemaCodeComplete.cpp.

Depends on D127654.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127658
2023-05-30 13:54:06 -07:00
Jan Svoboda
32d6f3cfd9 [clang] NFCI: Use DirectoryEntryRef in Module::Directory
This patch changes the type of `Module::Directory` from `const DirectoryEntry *` to (essentially) `Optional<DirectoryEntryRef>` in order to remove uses of the deprecated `DirectoryEntry::getName()`.

Depends on D127651.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127654
2023-05-30 13:54:06 -07:00
Jan Svoboda
d574e918db [clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::parseModuleMapFile()
This patch changes the argument type of `ModuleMap::parseModuleMapFile()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove the deprecated uses of `DirectoryEntry::getName()`.

Depends on D127648.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127651
2023-05-30 13:54:06 -07:00
Jan Svoboda
95279d7670 [clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()
This patch changes the argument type of `ModuleMap::inferFrameworkModule()` from `const DirectoryEntry *` to `DirectoryEntryRef` in order to remove the deprecated uses of `DirectoryEntry::getName()`.

Depends on D127647.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127648
2023-05-30 13:54:06 -07:00
Jan Svoboda
769d282d72 [clang][lex] NFCI: Use FileEntryRef in ModuleMap::{load,lookup}ModuleMap()
This patch changes the return/argument types of `ModuleMap::{load,lookup}ModuleMap()` from `const FileEntry *` to `FileEntryRef` in order to remove uses of the deprecated `DirectoryEntry::getName()`.

Reviewed By: bnbarham

Differential Revision: https://reviews.llvm.org/D127647
2023-05-30 13:54:06 -07:00
Alex Langford
9e8a412cb3 [lldb][NFCI] Remove use of ConstString from StructuredDataDarwinLog static functions
The strings "DarwinLog" and "log" probably do not need to be in the
ConstString StringPool. We still create ConstStrings from them in some
places (for now) but that's because we don't have an implicit
constructor to convert a StringRef to a ConstString.

Differential Revision: https://reviews.llvm.org/D151599
2023-05-30 13:47:09 -07:00
Nitin John Raj
af8e386102 [RISCV][GlobalISel] Add lowerFormalArguments for calling convention
This patch adds an IncomingValueHandler and IncomingValueAssigner, and implements minimal support for lowering formal arguments according to the RISC-V calling convention. Simple non-aggregate integer and pointer types are supported.

In the future, we must correctly handle byval and sret pointer arguments, and instances where the number of arguments exceeds the number of registers.

Coauthored By: lewis-revill

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D74977
2023-05-30 13:42:49 -07:00
Alex Langford
f46638b01d [lldb][NFCI] Change type of SBDebugger::m_instance_name
This doesn't need to be in the ConstString StringPool. There's little
benefit to having these be unique, and we don't need fast comparisons on
them.

Differential Revision: https://reviews.llvm.org/D151524
2023-05-30 13:21:56 -07:00
Peiming Liu
db7f639b90 [mlir][sparse] fix a crash when generating sparse convolution with nchw input
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D151744
2023-05-30 20:16:54 +00:00
Kazu Hirata
692f3059fb [Driver] Remove unused class ForceSuccessCommand
The last use was removed by:

  commit 6625680a581c5e29c53d9f58d864cc6cd3cd05f6
  Author: Hans Wennborg <hans@chromium.org>
  Date:   Tue Feb 2 14:10:26 2021 +0100

Differential Revision: https://reviews.llvm.org/D151609
2023-05-30 13:16:15 -07:00
Alex Langford
8e0001eb95 [lldb][NFCI] Refactor Language::GetFormatterPrefixSuffix
- Remove unused parameter `valobj` (I checked downstream, not
  even swift is using it).
- Return a std::pair<StringRef, StringRef> insted of having 2 out
  parameter strings.
- Remove the use of ConstStrings.

This change was primarily mechanical except in
`ObjCLanguage::GetFormatterPrefixSuffix`. To keep this fast, we
construct an llvm::StringMap<std::pair<StringRef, StringRef>> so that we
can look things up quickly. There is some amount of cost to setting up
the map the first time it is called, but subsequent lookups should be
as fast as a hash + string comparison (the cost of looking up something
in an llvm::StringMap).

Differential Revision: https://reviews.llvm.org/D151603
2023-05-30 13:11:55 -07:00
Louis Dionne
19ef02e3f4 [libc++][ci] Use ccache in the jobs that build Clang
This is an attempt to reduce the time taken by the Bootstrapping
build job and the Clang CI job that builds the compiler from scratch.

Differential Revision: https://reviews.llvm.org/D150908
2023-05-30 13:10:03 -07:00
Florian Hahn
02bf5e36f5
[ConstraintElim] Add additional tests for and implication handling. 2023-05-30 21:08:38 +01:00
Martin Storsjö
28b26b161c [clang] [test] Narrow down an MSVC specific behaviour to only not covever MinGW
This uses the same logic as in c2b256a990590dc8b69930259650cfeb085add03;
we can't check defined(_MSC_VER) invoked as %clang_cc1, therefore
check for !defined(__MINGW32__) instead.

This fixes the same issue in a new testcase that was added after this
issue was fixed last time in c2b256a990590dc8b69930259650cfeb085add03.

Differential Revision: https://reviews.llvm.org/D151661
2023-05-30 23:05:57 +03:00
Fangrui Song
d81ce04587 [Driver] Report error for unsupported -mlarge-endian/-mlittle-endian 2023-05-30 12:45:21 -07:00
Petr Hosek
99a1aeefb3 Revert "[BOLT][CMake] Use LLVM macros for install targets"
This reverts commit 627d5e16127bd8034b893e66ab0c86eacf2d939a.
2023-05-30 19:28:14 +00:00
Petr Hosek
627d5e1612 [BOLT][CMake] Use LLVM macros for install targets
The existing BOLT install targets are broken on Windows becase they
don't properly handle output extension. Rather than reimplementing
this logic in BOLT, reuse the existing LLVM macros which already
handle this aspect correctly.

Differential Revision: https://reviews.llvm.org/D151595
2023-05-30 19:23:11 +00:00
Alex Brachet
54d45ddc89 [clang-tidy][docs] Fix link to libc style guide
Differential Revision: https://reviews.llvm.org/D151502
2023-05-30 18:22:26 +00:00
Fangrui Song
fbea5aada1 [Driver] Add ClangFlags::TargetSpecific to simplify err_drv_unsupported_opt_for_target processing
clang/lib/Driver/ToolChains/Clang.cpp has a lot of fragments like the following:
```
if (const Arg *A = Args.getLastArg(...)) {
  if (Triple is xxx)
    A->render(Args, CmdArgs);
  else
    D.Diag(diag::err_drv_unsupported_opt_for_target) << ...;
}
```

The problem is more apparent with a recent surge of AIX-specific options.

Introduce the TargetSpecific flag so that we can move the target-specific
options to ToolChains/*.cpp and ToolChains/Arch/*.cpp and overload the
warn_drv_unused_argument mechanism to give an err_drv_unsupported_opt_for_target
error.

Migrate -march=/-mcpu= and some AIX-specific options to use this simplified pattern.

Reviewed By: jansvoboda11

Differential Revision: https://reviews.llvm.org/D151590
2023-05-30 11:21:17 -07:00
Alex Brachet
a2a51448c1 [compiler-rt][bultins] Fix libatomic standalone build
Differential Revision: https://reviews.llvm.org/D151679
2023-05-30 18:19:36 +00:00
Tue Ly
e557b8a142 [libc][RISCV] Add log, log2, log1p, log10 for RISC-V64 entrypoints.
Add log, log2, log1p, log10 RISCV64 entrypoints.

Reviewed By: michaelrj, sivachandra

Differential Revision: https://reviews.llvm.org/D151674
2023-05-30 14:18:19 -04:00
LLVM GN Syncbot
520362b28d [gn build] Port 06ff9770477d 2023-05-30 18:02:40 +00:00
Erick Velez
06ff977047 [clang][ExtractAPI] Refactor serializer to the CRTP
Refactor SerializerBase and SymbolGraphSerializer to use a visitor pattern described by the CRTP.

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D151477
2023-05-30 19:00:35 +01:00
Fangrui Song
bd9940a809 [Driver][test] Properly test -mdefault-visibility-export-mapping= 2023-05-30 10:58:06 -07:00
Mats Petersson
b75f9ce3fe [FLANG] Support all arrays for LoopVersioning
This patch makes more than 2D arrays work, with a fix for the way that
loop index is calculated. Removing the restriction of number of
dimensions.

This also changes the way that the actual index is calculated, such that
the stride is used rather than the extent of the previous dimension. Some
tests failed without fixing this - this was likely a latent bug in the
2D version too, but found in a test using 3D arrays, so wouldn't
have been found with 2D only. This introduces a division on the index
calculation - however it should be a nice and constant value allowing
a shift to be used to actually divide - or otherwise removed by using
other methods to calculate the result. In analysing code generated with
optimisation at -O3, there are no divides produced.

Some minor refactoring to avoid repeatedly asking for the "rank" of the
array being worked on.

This improves some of the SPEC-2017 ROMS code, in the same way as the
limited 2D array improvements - less overhead spent calculating array
indices in the inner-most loop and better use of vector-instructions.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D151140
2023-05-30 18:54:40 +01:00
Philip Reames
b07d08bb85 [RISCV] Add additional vslide1up test coverage
Add another form of the same pattern (as_rotate tests), and add coverage for a couple corner cases I got wrong at first in an upcoming rewrite.
2023-05-30 10:53:58 -07:00
Deniz Evrenci
6219b7c61a [clang-tidy] Do not emit bugprone-exception-escape warnings from coroutines
All exceptions thrown in coroutine bodies are caught and
unhandled_exception member of the coroutine promise type is called.
In accordance with the existing rules of diagnostics related to
exceptions thrown in functions marked noexcept, even if the promise
type's constructor, get_return_object, or unhandled_exception
throws, diagnostics should not be emitted.

Fixes #61905.

Reviewed By: PiotrZSL, ChuanqiXu

Differential Revision: https://reviews.llvm.org/D147417
2023-05-30 17:48:11 +00:00
Artem Belevich
6cdc07a701 [CUDA] correctly install cuda_wrappers/bits/shared_ptr_base.h
The file must go under cuda_wrappers/bits/ directly, but was by mistake copied
directly into cuda_wrappers/ during installation.

Differential Revision: https://reviews.llvm.org/D151503
2023-05-30 10:44:33 -07:00
Mehdi Amini
2922e7cd93 Re-enable MLIR test-contraction.mlir integration test after LLVM backend crash was fixed 2023-05-30 10:38:57 -07:00
Philip Reames
0bb23c58be [RISCV] Rename vslide1down tests (should have been part of 24172de) 2023-05-30 10:32:24 -07:00
Philip Reames
24172de17d [RISCV] Add tests for vslide1down shuffle/insert idiom 2023-05-30 10:24:43 -07:00
Paul Robinson
d8291908ef [Headers][doc] Add add/sub/mul intrinsic descriptions to avx2intrin.h
Differential Revision: https://reviews.llvm.org/D150114
2023-05-30 10:15:18 -07:00
Ben Hamilton
85670ac868 [Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser
This adds to the ObjC language guesser a few more common macros used
in ObjC headers. These can help distinguish ObjC headers which
otherwise lack ObjC types from C++ headers.

Contributed by danblakemore.

Tested: New tests included. Ran unit tests with:
  ```
  % cmake -S llvm -B build -G Ninja && \
    ninja -C build FormatTests && \
    ./build/tools/clang/unittests/Format/FormatTests --gtest_filter="*FormatTestObjC*"

  (snip)
  [----------] 24 tests from FormatTestObjC (265 ms total)

  [----------] Global test environment tear-down
  [==========] 26 tests from 2 test suites ran. (270 ms total)
  [  PASSED  ] 26 tests.
  ```

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D151578
2023-05-30 11:12:03 -06:00
Peter Steinfeld
5c000df215 [flang] [NFC] Remove an unneeded include.
The title says it all.

Differential Revision: https://reviews.llvm.org/D151712
2023-05-30 10:09:55 -07:00
Craig Topper
86821b54eb [RISCV] Add copyright header to IntrinsicsRISCVXTHead.td and IntrinsicsRISCVXsf.td. NFC 2023-05-30 10:07:14 -07:00
max
ab70b63a71 [MLIR][CAPI] Move DenseMapInfo<MlirTypeID>
I mistakenly put this in `mlir/CAPI/Support.h` at some point during the flurry of refactoring of `TypeCaster`s but as @jpienaar rightly pointed out, it doesn't belong there.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D151669
2023-05-30 12:03:56 -05:00
Mark de Wever
0ee73debf7 [libc++][format] Fixes year formatter on Windows.
Windows' libc, like some other libc implementations do not work as
specified for %Y and %y. This uses the fixes used for other libc
implementations.

The work was part of D150593.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151612
2023-05-30 18:57:55 +02:00
Mark de Wever
66c7388c83 [libc++] Deprecate the classes in strstream.
These have been deprecated since their initial version in libc++. It
seems they were never properly marked as deprecated.

Discovered while working on D151223.

Reviewed By: #libc, ldionne, philnik

Differential Revision: https://reviews.llvm.org/D151474
2023-05-30 18:57:09 +02:00
Marco Elver
8c5ad4a0e2 Fix "[compiler-rt] Refactor memintrinsic interceptors"
Fix the Fuchsia build. asan_interceptors_memintrinsics.cpp should not
include any interceptors on Fuchsia.

Reported-by: haowei
Link: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8779679021892159153/+/u/clang/build/stdout
2023-05-30 18:55:46 +02:00
Craig Topper
93f8554e65 [RISCV] Correct capitalization of SiFive in a comment. NFC 2023-05-30 09:51:49 -07:00
David Green
5e98dbff72 [AArch64] Add i1 insert/extract cost tests. NFC
See D151189. The existing files check lines have also been adjusted whilst
here.
2023-05-30 17:45:16 +01:00
Mark de Wever
d951c6a533 [libc++][CI] Installs libomp.
This is needed to build clang-tidy plugins using clang-tidy 17.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D151488
2023-05-30 18:40:36 +02:00
Dmitri Gribenko
8a40f89e2e [clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace
MemRegion::getMemorySpace() is annotated with
LLVM_ATTRIBUTE_RETURNS_NONNULL (which triggers instant UB if a null
pointer is returned), and callers indeed don't check the return value
for null. Thus, even though llvm::dyn_cast is called, it can never
return null in this context. Therefore, we can safely call llvm::cast.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151727
2023-05-30 18:30:30 +02:00
Dmitri Gribenko
0989ce947e [clang][analyzer][NFC] Move dyn_cast's into if statements for readability
Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D151725
2023-05-30 18:22:43 +02:00
Simon Pilgrim
0ec79f413e [X86] Regenerate sqrt-fastmath-mir.ll 2023-05-30 17:21:53 +01:00
Adrian Prantl
d6e1909526 Mark header as textual 2023-05-30 09:21:39 -07:00