Commit Graph

473767 Commits

Author SHA1 Message Date
Jan Svoboda
65331da003 Partially revert "[clang] NFCI: Adopt SourceManager::getFileEntryRefForID()"
This commit partially reverts ddbcc10b to fix `clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-run-with-database.cpp`.
2023-09-06 11:59:40 -07:00
Mircea Trofin
24a08592bc
[nfc][thinlto] Factor common state for computeImportForModule (#65427)
Added a class to hold such common state. The goal is to both reduce the argument list of other utilities used by `computeImportForModule` (which will be brought as members in a subsequent patch), and to make it easy to extend such state later.
2023-09-06 11:57:15 -07:00
Daniil Dudkin
d4fa0884c3
[mlir][arith] Improve Lowering of maxf/minf ops (#65213)
This patch is part of a larger initiative aimed at fixing floating-point
`max` and `min` operations in MLIR:
https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671.

This patch addresses task 1.1 from the plan. It involves modifying the
lowering process for `arith.minf` and `arith.maxf` operations.
Specifically, the change replaces the usage of `llvm.minnum` and
`llvm.maxnum` with `llvm.minimum` and `llvm.maximum`, respectively. This
adjustment is necessary because the `m**num` intrinsics are not suitable
for the mentioned MLIR operations due to semantic discrepancies in
handling NaNs, positive and negative floating-point zeros.
2023-09-06 21:56:08 +03:00
Mark de Wever
0735a6e3fa [NFC][libc++] Adds spaces in the CMake output.
The line continuations didn't have the proper spaces.
2023-09-06 20:54:43 +02:00
Mark de Wever
f78f93bc9f [libc++][chrono] Adds tzdb_list implementation.
This is the first step to implement time zone support in libc++. This
adds the complete tzdb_list class and a minimal tzdb class. The tzdb
class only contains the version, which is used by reload_tzdb.

Next to these classes it contains documentation and build system support
needed for time zone support. The code depends on the IANA Time Zone
Database, which should be available on the platform used or provided by
the libc++ vendors.

The code is labeled as experimental since there will be ABI breaks
during development; the tzdb class needs to have the standard headers.

Implements parts of:
- P0355 Extending <chrono> to Calendars and Time Zones

Addresses:
- LWG3319 Properly reference specification of IANA time zone database

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154282
2023-09-06 20:48:07 +02:00
Joseph Huber
460840c09d
[OpenMP] Support 'omp_get_num_procs' on the device (#65501)
Summary:
The `omp_get_num_procs()` function should return the amount of
parallelism availible. On the GPU, this was not defined. We have elected
to define this function as the maximum amount of wavefronts / warps that
can be simultaneously resident on the device. For AMDGPU this is the
number of CUs multiplied byth CU's per wave. For NVPTX this is the
maximum threads per SM divided by the warp size and multiplied by the
number of SMs.
2023-09-06 13:45:05 -05:00
Mikhail R. Gadelha
6f387135ae
[libc] Fix failing mktime test case in 32-bit systems (#65390)
Previously, these tests expected that calling mktime with a struct tm
that caused overlow to succeed with return -1
(TimeConstants::OUT_OF_RANGE_RETURN_VALUE), however, the Succeeds call
expects the errno to be zero (no failure).

This patch fixes the expected calls to fail with EOVERFLOW. These tests
are only enabled to 32-bit systems, and are probably not being tested on
the arm32 buildbot, that's why this was not a problem before.
2023-09-06 14:29:31 -04:00
Mikhail R. Gadelha
10fb71bdff
[libc] Fix test passing negative value in timespec passed to nanosleep (#65346)
This test was setting tv_nsec to a negative value, which as per the
standard this is an EINVAL:

The value in the tv_nsec field was not in the range [0, 999999999] or
tv_sec was negative.

https://man7.org/linux/man-pages/man2/nanosleep.2.html
2023-09-06 14:28:31 -04:00
Mikhail R. Gadelha
ce3bade0cf
[libc] Fix call to clock_gettime (#65166)
The calls were missing the __llvm_libc:: namespace, which can allow the
test case to be linked to glibc's clock_gettime.
2023-09-06 14:26:20 -04:00
Daniel Paoliello
a8138c3d2f [lldb] Fix inline_sites.test
Fixes `lldb/test/Shell/SymbolFile/NativePDB/inline_sites.test` to use the correct line number now that f2f36c9b29 is causing the inline call site info to be taken into account.
2023-09-06 11:20:39 -07:00
Jan Svoboda
e75ecaa190 [clang] NFCI: Use FileEntryRef in CoverageMappingGen
This removes some uses of the deprecated `FileEntry::getName()`.
2023-09-06 11:15:51 -07:00
kazutakahirata
06d2db25aa
[ADT] Fix a comment typo (#65497) 2023-09-06 11:10:56 -07:00
Piotr Zegar
93f9f63b2d [clang-tidy][NFC] Update documentation for fuchsia-statically-constructed-objects
Fix compile errors in example provided in
documentation.

Fixes: #65118
2023-09-06 18:06:59 +00:00
Jakub Kuderski
2e3d694018
[ADT] Add detection utility for incomplete types (#65495)
This allows us to produce better error messages for types that were only
forward-declared, but where a full definition was expected.

The first user will be https://reviews.llvm.org/D159013; this change is
sent to review separately to reduce the scope of the other patch.
2023-09-06 14:06:40 -04:00
Jan Svoboda
1d56c509be [llvm][ADT] Fix signedness mismatch in IntrusiveRefCntPtr test 2023-09-06 11:05:01 -07:00
Jan Svoboda
ddbcc10b9e [clang] NFCI: Adopt SourceManager::getFileEntryRefForID()
This commit replaces some calls to the deprecated `FileEntry::getName()` with `FileEntryRef::getName()` by swapping current usages of `SourceManager::getFileEntryForID()` with `SourceManager::getFileEntryRefForID()`. This lowers the number of usages of the deprecated `FileEntry::getName()` from 95 to 50.
2023-09-06 10:49:48 -07:00
Mark de Wever
8271713981 [libc++][CI] Improves bootstrap build output.
Use the same arguments as other builds. This gives better output to
validate what the CI did.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158860
2023-09-06 19:48:59 +02:00
rorth
b084d10c28
[Driver] Wrap -lgcc_s in -z ignore/-z record on Solaris (#65487)
`clang` currently links `libgcc_s` unconditionally on Solaris, which is
unnecessary.

This patch wraps it in `-z ignore`/`-z record` instead.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
2023-09-06 19:44:39 +02:00
Jan Svoboda
d1487670ee
[llvm][ADT] Implement IntrusiveRefCntPtr::useCount() (#65502)
This function has the same semantics as
`std::shared_ptr<T>::use_count()`, and enables implementing
copy-on-write semantics.
2023-09-06 10:37:10 -07:00
Mark de Wever
d015e481d7 [libc++][C++20 modules] Tests no experimental library build.
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158936
2023-09-06 19:31:29 +02:00
Daniel Paoliello
f2f36c9b29 Emit line numbers in CodeView for trailing (after ret) blocks from inlined functions
Issue Details:
When building up line information for CodeView debug info, LLVM attempts to gather the "range" of instructions within a function as these are printed together in a single record. If there is an inlined function, then those lines are attributed to the original function to enable generating `S_INLINESITE` records. However, this thus requires there to be instructions from the inlining function after the inlined function otherwise the instruction range would not include the inlined function.

Fix Details:
Include any inlined functions when finding the extent of a function in `getFunctionLineEntries`

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D159226
2023-09-06 10:19:30 -07:00
Vladislav Dzhidzhoev
c39edd7b53 [AArch64][GlobalISel] Regenerate prelegalizercombiner-shuffle-vector.mir 2023-09-06 18:38:13 +02:00
Craig Topper
bb810d8fa0 [RISCV] Disable machine verifier in gisel-commandline-option.ll. NFC
Hopefully this fixes the expensive checks build.
2023-09-06 09:32:32 -07:00
Shilei Tian
ff5c7261ef [OpenMP] Fix a wrong assertion in __kmp_get_global_thread_id
The function assumes that `__kmp_gtid_get_specific` always returns a valid gtid.
That is not always true, because when creating the key for thread-specific data,
a destructor is assigned. The dtor will be called at thread exit. However, before
the dtor is called, the thread-specific data will be reset to NULL first
(https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_key_create.html):

> At thread exit, if a key value has a non-NULL destructor pointer, and the thread
> has a non-NULL value associated with that key, the value of the key is set to NULL.

This will lead to that `__kmp_gtid_get_specific` returns `KMP_GTID_DNE`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D159369
2023-09-06 12:21:43 -04:00
Shilei Tian
518b08c193
[OpenMP] Fix issue of indirect function call in __kmpc_fork_call_if (#65436)
The outlined function is typically invoked by using
`__kmp_invoke_microtask`,
which is written in asm. D138495 introduces a new interface function for
parallel
region for OpenMPIRBuilder, where the outlined function is called via
the function
pointer. For some reason, it works perfectly well on x86 and x86-64
system, but
doesn't work on Apple Silicon. The 3rd argument in the callee is always
`nullptr`, even
if it is not in caller. It appears `x2` always contains `0x0`. This
patch adopts
the typical method to invoke the function pointer. It works on my M2
Ultra Mac.

Fix #63194.
2023-09-06 12:17:45 -04:00
Florian Mayer
08ad327dde Do not duplicate identical stack safety test for RISCV
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D159148
2023-09-06 09:16:55 -07:00
zhijian
f903119cce Fixed a compile error on use of deleted function ¡®{anonymous}::MemberData::MemberData(const {anonymous}::MemberData&)
Summary:

There is compile error on https://lab.llvm.org/buildbot/#/builders/264/builds/1147/steps/5/logs/stdio
when commit in https://reviews.llvm.org/D144872
2023-09-06 12:04:52 -04:00
Simon Pilgrim
84447c044f [DAG] Add SelectionDAG::isADDLike helper. NFC.
Make the DAGCombine helper global so we can more easily reuse it.
2023-09-06 16:54:25 +01:00
Simon Pilgrim
c61d1984b4 [X86] matchIndexRecursively - pull out repeated getOpcode() calls. NFCI. 2023-09-06 16:54:25 +01:00
Stefan Gränitz
24f8822876 [JITLink][AArch32] Add initial test for R_ARM_THM_CALL and R_ARM_THM_JUMP24
This test still fails since RuntimeDyldChecker needs a few fixes before it works with Thumb. We can remove the XFAIL once the patch in D158280 landed.
2023-09-06 17:49:51 +02:00
Ying Yi
61d6154044 [llvm-cov] Fix the test of bnary-id-lookup.c after the commit cd8fe1dbc. 2023-09-06 16:44:19 +01:00
zhijian
4cc7c749c3 [AIX] Align the content of an xcoff object file which has auxiliary header in big archive.
Summary:

if the member file is XCOFF object file and has auxiliary header, the content of the member file need to be aligned at the
MAX(maximum alignment of .text , maximum alignment of .data). The "maximum alignment of .text" and "maximum alignment of .data" are two
field of auxiliary header of XCOFF object file.

Reviewers: James Henderson, Stephen Peckham
Differential Revision: https://reviews.llvm.org/D144872
2023-09-06 11:35:18 -04:00
Florian Hahn
785e7063b9
[VPlan] Don't rely on underlying instr in VPWidenRecipe (NFCI).
VPWidenRecipe only needs the opcode to widen, all other information
(flags, debug loc and operands) is already modeled directly via the
recipe.

This removes the remaining uses of the underlying instruction from
VPWidenRecipe::execute.
2023-09-06 16:27:09 +01:00
David Spickett
ad2453a2db
[lldb][Docs] Add page about debugging lldb itself (#65332)
We have docs about how to use lldb on other programs, this tells you how
to use lldb on ldlb and lldb-server.

Lacking any Mac experience I've not included any debugserver information
apart from stating it will be similar but not the same.

I plan for this page to include sections on debugging tests and other
things but this initial commit is purely about the two main binaries
involved.
2023-09-06 16:22:28 +01:00
Stephen Tozer
43d70e4640 [DebugInfoTests] Mark debuginfo 'optnone-*' tests unsupported on darwin
The optnone tests, following the removal of the Dexter builder in a
prior patch (45a40c16), are experiencing intermittent failures. This
patch marks them unsupported to be fixed in a new commit, rather than
reverting the Dexter patch.
2023-09-06 16:12:04 +01:00
Mark de Wever
3401b308f8 [libc++] Renames modules-build.
This is a followup of D157625. Using the name clang-modules-build makes
it clear this is regarding the clang modules and not the C++23 std or
std.compat module.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158927
2023-09-06 17:11:13 +02:00
Florian Hahn
4c9223c770
[ComplexDeinterleaving] Use MapVector to fix codegen non-determinism. 2023-09-06 15:57:35 +01:00
Mikhail R. Gadelha
8cd4ecfa60 [libc] Unify lseek implementations
In patch D157792, the calls to SYS_llseek/SYS_llseek for 32-bit systems
were fixed in lseek.cpp but there was another implementation in file.cpp
that was missed.

To reduce the code duplication, this patch unifies both call sites to
use a new lseekimpl function.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159208
2023-09-06 11:56:41 -03:00
Aleksandr Popov
0e0ff8573d [GuardWidening] Refactor to work with the list of checks to widen/hoist
Currently we hoist conditions from widenable branch which are joined to
the widenable_condition by And operation. E.g if we have
br(WC && (c1 && c2)) we will operate with (c1 && c2) unsplitted.

This patch adds more flexibility to that mechanism by supporting work
with the list of checks parsed from the widenable branch.

On that stage patch doesn't change the logic of checks hoisting. In the
example above we will either hoist both checks [c1, c2] or none of them.
But in the future we would improve that logic analyzing each check
separately.

Reviewed By: anna

Differential Revision: https://reviews.llvm.org/D157689
2023-09-06 00:46:48 +02:00
yronglin
9f67143be0 [libc++] Implement LWG3938 (Cannot use std::expected monadic ops with move-only error_type)
Implement LWG3938 (Cannot use std::expected monadic ops with move-only error_type)
https://wg21.link/LWG3938

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154116
2023-09-06 22:38:29 +08:00
Jie Fu
1f3fa96e51 [llvm-cov] Fix -Wcovered-switch-default in CoverageMapping.cpp (NFC)
/Users/jiefu/llvm-project/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp:959:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  default:
  ^
1 error generated.
2023-09-06 22:30:36 +08:00
Stephen Tozer
45a40c1639 Re-reapply "[Dexter] Remove builder from Dexter"
This patch makes a further attempt to fix the tests broken by the
previous revision by ensuring that the command line for the modified
Dexter tests use -std=gnu++11, in keeping with the old build script.

This reverts commit 5647f2908d.
2023-09-06 15:06:07 +01:00
MaggieYingYi
cd8fe1dbcb
[llvm-cov] - Output better error message when the error kind is coveragemap_error::malforme. (#65264)
The current llvm-cov error message for kind `coveragemap_error::malforme`, just gives the issue kind without any reason for what caused the issue. This patch is aimed at improving the llvm-cov error message to help identify what caused the issue.

Reviewed By: MaskRay
Close: https://github.com/llvm/llvm-project/pull/65264
2023-09-06 15:02:31 +01:00
Viktoriia Bakalova
6258912880 [clangd][clang-tidy] Add missing symbols to the symbol map.
Differential Revision: https://reviews.llvm.org/D159462
2023-09-06 13:42:12 +00:00
Louis Dionne
e375fd0343 [libc++] Remove unused include in __threading_support
Differential Revision: https://reviews.llvm.org/D138528
2023-09-06 09:39:39 -04:00
Timm Bäder
92ac46e703 [clang][Interp] Handle CXXParenListInitExprs
Differential Revision: https://reviews.llvm.org/D156047
2023-09-06 15:26:54 +02:00
Louis Dionne
98d28e947c [libc++] Fix issue in std.cppm after introducing views::chunk_by
This should fix CI issues introduced by 065dc485bd where the std.cppm
module won't build in C++20 mode because views::chunk_by was added in
C++23 but wasn't marked as such in ranges.inc.
2023-09-06 09:19:07 -04:00
NAKAMURA Takumi
cd25a50a8f [Bazel] Introduce //compiler-rt:profile
At the moment,

  - Provide only `profile`
  - Will invoke error unless the platform is linux

Differential Revision: https://reviews.llvm.org/D156095
2023-09-06 22:10:30 +09:00
Timm Bäder
7e5809e7e7 [clang][Interp] Enable existing source_location tests
Differential Revision: https://reviews.llvm.org/D156045
2023-09-06 15:05:45 +02:00
Kadir Cetinkaya
73b2c86d95
[include-cleaner] Weaken signal for boosting preferred headers
Putting preferred header signal above completeness implied we would
uprank forward declarations above complete ones in certain cases.

This can be desired in cases where:
- Complete definition is private. But this case is already governed by
  publicness signal.
- The library indeed intends to provide a forward declaring interface, like
  iosfwd vs ostream.

In all other cases, upranking is undesired as it means we've picked up prefered
headerness signal by mistake from an unrelated declaration to the library.

This change regresses the behavior for libraries that intentionally provide a
forward declaring interface. But that wasn't something we intended to support
explicitly, it was working incidentally when the forward declaring header had a
similar name to the symbol. Moreover, include-cleaner deliberately discourages
forward-declarations, so not working in this case is also more aligned with rest
of the components.

Differential Revision: https://reviews.llvm.org/D159441
2023-09-06 14:46:33 +02:00