472186 Commits

Author SHA1 Message Date
erichkeane
dddfd93792 Revert "Test commit config"
Undoing test commit.
This reverts commit 3e50bcb44b7e850032d928ce53a582891336bc87.
2023-08-22 16:43:34 -07:00
Alex Lorenz
5c3d629376
Revert "Use InernalAlloc in DemangleCXXABI"
This reverts commit 649004ae9ea3cff905bbc0b2777ec12056558129.

This commit caused regression in TSAN tests on Darwin:
https://green.lab.llvm.org/green/job/clang-stage1-RA/35380/

These tests have been failing:
SanitizerCommon-tsan-x86_64-Darwin.Darwin.symbolizer-function-offset-dladdr.cpp
SanitizerCommon-tsan-x86_64h-Darwin.Darwin.symbolizer-function-offset-dladdr.cpp
ThreadSanitizer-x86_64.Darwin.symbolizer-dladdr.cpp
ThreadSanitizer-x86_64h.Darwin.symbolizer-dladdr.cpp
2023-08-22 16:40:23 -07:00
erichkeane
3e50bcb44b Test commit config 2023-08-22 16:39:30 -07:00
Nico Weber
44ba21e53a [gn] port e280e406c2e3 2023-08-22 19:32:46 -04:00
Rahman Lavaee
ab53109166 [BasicBlockSections] avoid insertting redundant branch to fall through blocks 2023-08-22 23:32:02 +00:00
Mehdi Amini
ec5e947f97 Fix MSAN error: use of unitialized value when hashing the MLIR pass manager (NFC) 2023-08-22 16:27:44 -07:00
Rahman Lavaee
e280e406c2 Add a pass to garbage-collect empty basic blocks after code generation.
Propeller and pseudo-probes map profiles back to Machine IR via basic block addresses that are stored in metadata sections.
Empty basic blocks (basic blocks without real code) obfuscate the profile mapping because their addresses collide with their next basic blocks.
For instance, the fallthrough block of an empty block should always be adjacent to it. Otherwise, a completely unnecessary jump would be added.
This patch adds a MachineFunction pass named `GCEmptyBasicBlocks` which attempts to garbage-collect the empty blocks before the `BasicBlockSections` and pass.
This pass removes each empty basic block after redirecting its incoming edges to its fall-through block.
The garbage-collection is not complete. We keep the empty block in 4 cases:
      1. The empty block is an exception handling pad.
      2. The empty block has its address taken.
      3. The empty block is the last block of the function and it has
         predecessors.
      4. The empty block is the only block of the function.
The first three cases are extremely rare in normal code (no cases for the clang binary). Removing the blocks under the first two cases requires modifying exception handling structures and operands of non-terminator instructions -- which is doable but not worth the additional complexity in the pass.

Reviewed By: tmsriram

Differential Revision: https://reviews.llvm.org/D107534
2023-08-22 22:42:19 +00:00
Jessica Clarke
7e1afab1b1 [compiler-rt] Use .globl for FreeBSD/NetBSD interceptor wrappers
On FreeBSD and NetBSD we don't use .weak due to differing semantics.
Currently we end up using no directive, which gives a local symbol,
whereas the closer thing to a weak symbol would be a global one. In
particular, both GNU and LLVM toolchains cannot handle a GOT-indirect
reference to a local symbol at a non-zero offset within a section on
AArch64 (see https://github.com/ARM-software/abi-aa/issues/217), and so
interceptors do not work on FreeBSD/arm64, failing to link with LLD.
Switching to .globl both works around this bug and more closely aligns
such non-weak platforms with weak ones.

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

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D158552
2023-08-22 23:38:24 +01:00
Daniel Thornburgh
7dc5bde90c [Docs] Release note for LLVM_ENABLE_SYMBOLIZER_MARKUP 2023-08-22 15:02:07 -07:00
Paul Robinson
0d592c8d49 [Driver][PS5] Simplify a condition 2023-08-22 15:01:55 -07:00
Erick Velez
e81744563a [clang][ExtractAPI] Fix bool spelling coming from the macro definition.
getFragmentsForType resulted in a bool typeIdentifier fragment to be spelled "_Bool".
This fixes the spelling to be "bool" and checks it in C and C++.

Reviewed By: dang

Differential Revision: https://reviews.llvm.org/D158474
2023-08-22 15:00:14 -07:00
walter erquinigo
7822e5dbf1 [LLDB] Allow expression evaluators to set arbitrary timeouts
59237bb52c changed the behavior of the `SetTimeout` and `GetTimeout` methods of `EvaluateExpressionOptions`, which broke the Mojo REPL and related services (https://docs.modular.com/mojo/) because it relies on having infinite timeouts. That's a necessity because developers often use the REPL for executing extremely long-running numeric jobs. Having said that, `EvaluateExpressionOptions` shouldn't be that opinionated on this matter anyway. Instead, it should be the responsibility of the evaluator to define which timeout to use for each specific case.

Differential Revision: https://reviews.llvm.org/D157764
2023-08-22 17:41:14 -04:00
Arthur Eubanks
9b6b6bbc91 Revert "[Profile] Allow online merging with debug info correlation."
This reverts commit cf2cf195d5fb0a07c122c5c274bd6deb0790e015.
This breaks merging profiles when nothing is instrumented, see comments in https://reviews.llvm.org/D157632.

This also reverts follow-up commit bfc965c54fdbfe33a0785b45903b53fc11165f13.
2023-08-22 14:34:46 -07:00
Philip Reames
4a35655dac [RISCV][TTI] Factor out getVSlideCost helper [nfc]
Reasonable implementations may differ in complexity cost, so doing some API prepwork to support tunables.  Note that this patch only covers the cases where we model the slide cost as linear.  A separate patch will propose changing our insert and extract costs from constant-in-lmul to linear-in-lmul.
2023-08-22 14:16:51 -07:00
Philip Reames
f346cbd378 [RISCV][TTI] Factor out getVRGatherVICost helper [nfc]
Reasonable implementations may differ in complexity cost, so doing some API prepwork to support tunables.
2023-08-22 14:10:46 -07:00
walter erquinigo
9e66ea503e Revert "[LLDB] Allow expression evaluators to set arbitrary timeouts"
This reverts commit a4dbdf4749938396dbf913478289fa426d8341ae because it breaks the buildbot https://lab.llvm.org/buildbot/#/builders/68/builds/58591
2023-08-22 17:04:53 -04:00
Jonathan Peyton
99f5969565 [OpenMP] Let primary thread gather topology info for each worker thread
This change has the primary thread create each thread's initial mask
and topology information so it is available immediately after
forking. The setting of mask/topology information is decoupled from the
actual binding. Also add this setting of topology information inside the
__kmp_partition_places mechanism for OMP_PLACES+OMP_PROC_BIND.

Without this, there could be a timing window after the primary
thread signals the workers to fork where worker threads have not yet
established their affinity mask or topology information.

Each worker thread will then bind to the location the primary thread
sets.

Differential Revision: https://reviews.llvm.org/D156727
2023-08-22 15:56:51 -05:00
Leonard Chan
3a4f471b11 [compiler-rt][Fuchsia] Use map name if provided
Prior to this, any allocations coming from the SizeClassAllocator would just
have the vmo name "SizeClassAllocator". This will instead use the string passed
to the Map functions if provided which provide slightly more info on what the
vmo is used for. That is, is it for region data, metadata, or freearray space.

Differential Revision: https://reviews.llvm.org/D158537
2023-08-22 20:38:45 +00:00
Nathan Sidwell
b045c36ab9 [llvm][NFC]Refactor AutoUpgrader case 'n'.
The NVPTX intrinsics are under 'n'. Use the consume_front API, so fix
that. Refactor the helper function to group matchers on the first
component and check that first. Do similarly with the final set of
intrinsics, which have a lot of commonality in the matching.  Finally
reorder the argument/return type checking wrt name checking -- the
former is going to be cheaper, so do that first before checking the
name.#

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D158445
2023-08-22 16:32:53 -04:00
zhijian
f2b150b450 Summary:
Fixed a clang: error: OBJECT_MODE setting any is not recognized and is not a valid setting
in https://lab.llvm.org/buildbot/#/builders/214/builds/9125/steps/6/logs/FAIL__Clang__dwarf-version_c

The error is caused by the modification of clang/test/lit.cfg.py of the commit of https://reviews.llvm.org/D142660
2023-08-22 16:29:22 -04:00
Daniel Hoekwater
90ab85a1b2 Reland "[CodeGen][AArch64] Make MFS testable on AArch64"
Reverted by 3d22dac6c3b97d7bb92f243886dfb0d32a5c42e9 because it depended
on b9d079d6188b50730e0a67267b7fee36008435ce, which broke some tests.
2023-08-22 20:21:33 +00:00
Mehdi Amini
809b440395 Fix MLIR pass manager initialization: hash the pass pipeline to detect when initialization is needed
The current logic hashes the context to detect registration changes and re-run
the pass initialization. However it wasn't checking for changes to the
pipeline, so a pass that would get added after a first run would not be
initialized during subsequent runs.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D158377
2023-08-22 12:55:07 -07:00
Craig Topper
d9320e22d4 [RISCV][GlobalISel] Select register banks for GPR ALU instructions
This patch implements the getInstrMapping hook for RISCVRegisterBankInfo and others in order to correctly select the GPR register bank for operands of ALU instructions, and the associated operations introduced by the legalizer.

Co-authored-by: Lewis Revill <lewis.revill@embecosm.com>

Reviewed By: nitinjohnraj

Differential Revision: https://reviews.llvm.org/D76051
2023-08-22 12:31:20 -07:00
Harini Chilamantula
c3c8f16fc3 Fixing the memory leak using split() instead of strtok
Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D158254
2023-08-22 15:26:34 -04:00
Florian Hahn
c071dba1a3
[LV] update hexagon test to use load results.
The current version of the test doesn't use any of the loads, so they
can be removed together with the mask of the interleave group.

Use some loaded values and store them, to prevent the mask from being
optimized away.
2023-08-22 20:20:58 +01:00
Ted Woodward
be88462cd6 Platform qemu-user: Build path to qemu automatically if not specified
Get the path to qemu in the following order:
1) From the property platform.plugin.qemu-user.emulator-path
2) If that property is not set, from PATH, building the name of the qemu
   binary from the triple in  property platform.plugin.qemu-user.architecture
3) If that property is not set, from PATH, building the name of the qemu
   binary from the triple in the target

This will allow a user to load a target and run without setting properties,
if qemu is on the PATH and named qemu-<ArchName>

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D155117
2023-08-22 14:20:18 -05:00
Ted Woodward
523110d654 Add support for llvm::MCInstPrinter::setPrintBranchImmAsAddress
llvm::MCInstPrinter has an option, controlled by setPrintBranchImmAsAddress,
to print branch targets as immediate addresses instead of offsets.
Turn this on in lldb, so targets that support this flag will print addresses
instead of offsets.

This requires the address of the instruction be provided, but fortunately
it's calculated right before the call to PrintMCInst.

Reviewed By: jasonmolenda, DavidSpickett

Differential Revision: https://reviews.llvm.org/D155107
2023-08-22 14:16:14 -05:00
Jakub Kuderski
553943dced [mlir][spirv] Fix description formatting in BitOps. NFC.
Issue: https://github.com/llvm/llvm-project/issues/64765

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D158535
2023-08-22 15:12:56 -04:00
Florian Hahn
34d25924c4
[VPlan] Mark some VPInstruction opcodes as not having side effects.
Mark some VPInstruction opcodes as not having side effects, preparation
for D157037.
2023-08-22 20:05:57 +01:00
Kyungwoo Lee
a033184abb [lld-macho] Stricter Bitcode Symbol Resolution
LLD resolves symbols before performing LTO compilation, assuming that the symbols in question are resolved by the resulting object files from LTO. However, there is a scenario where the prevailing symbols might be resolved incorrectly due to specific assembly symbols not appearing in the symbol table of the bitcode. This patch deals with such a scenario by generating an error instead of silently allowing a mis-linkage.
If a prevailing symbol is resolved through post-loaded archives via LC linker options, a warning will now be issued.

Reviewed By: #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D158003
2023-08-22 12:03:17 -07:00
Jonas Devlieghere
34f84697c3
[lldb] Link back to the LLVM Project and Developer Policy from the docs
Add backlinks to the LLVM Project and the LLVM Developer Policy from the
docs. As suggested by Tanya on Discourse:
https://discourse.llvm.org/t/rfc-revamping-lldbs-website/72899.

Differential revision: https://reviews.llvm.org/D158467
2023-08-22 11:42:46 -07:00
Mark de Wever
f105ed11ae [NFC][libc++][test] Improve name test file.
With C++20 modules in libc++ the old name modules is ambiguous. This
rename makes it clear this is regarding the clang modules.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D153042
2023-08-22 20:29:41 +02:00
Mark de Wever
c1d49ce67a [libc++][CI] Moves modules build to C++23.
The std module can be tested in the generic C++23 build. This removes the
special module build.

Note it is possible to enable modules automatically in CMake, but that
would fail in the "parts disabled" builds; they have not been properly
been converted to modules yet.

Depends on D157625

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D157744
2023-08-22 20:19:48 +02:00
Mark de Wever
cfab8686bf [libc++][C++20 modules] Tests no unicode build.
Depends on D158347

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158357
2023-08-22 20:17:37 +02:00
Mark de Wever
0e26efe3dc [libc++][C++20 modules] Tests no random device build.
Depends on D158337

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158347
2023-08-22 20:16:53 +02:00
Mark de Wever
c9c71a7e0b [libc++][C++20 modules] Tests no filesystem build.
Depends on D158331

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158337
2023-08-22 20:15:59 +02:00
Mark de Wever
ef3a39160d [libc++][C++20 modules] Tests no threading build.
Depends on D158330

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158331
2023-08-22 20:15:16 +02:00
Mark de Wever
7e8c80fc60 [libc++][C++20 modules] Tests no locale build.
This fixes some missing #ifndef and implements the header restrictions
in the modules script.

Depends on D158192

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158330
2023-08-22 20:14:28 +02:00
Augusto Noronha
fef609d2d1 Revert "[lldb] Fix data race in ThreadList"
This reverts commit bb90063249707e3ae081bfbd8e3512566abb7df6.
2023-08-22 11:14:04 -07:00
Mark de Wever
41161aeb54 [libc++][modules] Generates std.cppm.in.
This takes the header restrictions into account instead of manually
duplicating this build information. This is a preparation to properly
support the libc++ disabled parts in the std module.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158192
2023-08-22 20:13:39 +02:00
Eymen Ünay
9724bf999b [compiler-rt] Fix typo in comment
Reviewed By: fmayer

Differential Revision: https://reviews.llvm.org/D157209
2023-08-22 11:12:54 -07:00
Mark de Wever
30f9b47907 [libc++][CI] Test std module in C++26 mode.
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D153408
2023-08-22 20:08:52 +02:00
Mark de Wever
d9e3c85f57 [libc++][modules] Simplifies C++20 module testing.
The building of the std module has been moved from `params.py` and
`dsl.py` to a `lit.local.cfg` for the entire test suite. In theory this
change allows testing modules in most configurations, except:
- combined with clang modules
- C++ versions that don't support the std module

Currently only C++23 with all parts enabled works.
C++26 is expected to work properly with CMake 3.27. That versions of CMake
knows how to invoke clang using C++26.
The parts disabled modi of libc++ have not been modularized yet.

It still is the goal that in the future CMake will be able to do the work
done in `lit.local.cfg`. Doing this in CMake would require a more mature
libc++ implementation.

Thanks a lot to @ldionne for giving hints how to enable modules in a
`lit.local.cfg`.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D157625
2023-08-22 20:06:28 +02:00
Mehdi Amini
1d3003668a Adopt MLIR properties for attribute storage in Flang (NFC)
MLIR is deprecating the old behavior in LLVM 18.

Differential Revision: https://reviews.llvm.org/D158533
2023-08-22 11:03:36 -07:00
Stanislav Mekhanoshin
cfe9a134bb [AMDGPU] Rename 64BitDPP feature and fix the checks
Names '64BitDPP' and especially 'DPP64' were found misleading, and
DPP64 can easily be mixed with DPP16 and DPP8 while these are
different concepts. DPP16 and DPP8 refers to lanes where DPP64
refers to the operand size.

In fact the essential part here is that these instructions are
executed on the DP ALU, so rename the feature accordingly.

I have also found a bug in a check for these instructions, which is
fixed here and a common utility function is now used.

Differential Revision: https://reviews.llvm.org/D158465
2023-08-22 11:00:10 -07:00
Mehdi Amini
c65442bd6f Fix some missing fully qualified namespaces in MLIR TableGen generator
Using properties would break when a dialect isn't in the mlir namespace
2023-08-22 10:59:31 -07:00
Jonas Devlieghere
07afc41a2e
[lldb] Fix broken link in docs/index.rst 2023-08-22 10:58:44 -07:00
Alex Langford
ebff12d675 [lldb][NFCI] Change return type of UnixSignals::GetSignalInfo
There's no reason for GetSignalInfo to return the signal name. All users
of this method only use the return value to determine if the method
succeeded in filling in the output parameters, so let's explicitly make
it a bool instead of a pointer.

Differential Revision: https://reviews.llvm.org/D158457
2023-08-22 10:54:06 -07:00
Joseph Huber
8a20612467 [AMDGPU] Respect nobuiltin when converting printf
The AMDGPU backend uses a pass to transform calls to the `printf`
function to a built-in verision for either HIP or OpenCL. Currently this
does not respect `-fno-builtin` and is always emitted. This allows the
user to turn off this functionality as is standard for these types of
built-in transformations. The motivation behind this change is to allow
the `libc` project to provide a linkable version of the `printf`
function in the future.

Reviewed By: sameerds

Differential Revision: https://reviews.llvm.org/D158477
2023-08-22 12:48:16 -05:00
Alex Langford
a43e23a214 [lldb][NFCI] Silence warning about unhandled value eManglingSchemeSwift in switch statement
For now, we don't handle swift names in Symtab.
2023-08-22 10:35:36 -07:00