Commit Graph

431965 Commits

Author SHA1 Message Date
Vitaly Buka 26dd42705c [NFC][Inliner] Simplify clamping in addCost 2022-08-03 14:54:37 -07:00
Craig Topper 84e9194828 Revert "[X86][MC] Always emit `rep` prefix for `bsf`"
This reverts commit c2066d19cd.

It's causing failures on the build bots.
2022-08-03 14:51:34 -07:00
Jonas Devlieghere 9ffcc85fbe
Revert "Revert "[lldb][modules] Disable Clang Modules in source/Host directory on macOS""
This reverts commit c7bd61d4a7 because it
breaks the underlying issue is apparently not yet resolved. This only
affects the modules build.
2022-08-03 14:39:45 -07:00
Craig Topper 11322203b7 [X86] Add a test for missed opportunity combine AND32rm+TEST32rr.
If the chain output of the AND32rm is used, the post isel peephole
won't fold it. We should be able to fold it by replacing the chain
use with the chain from a TEST32rm.
2022-08-03 14:33:26 -07:00
Jonas Devlieghere 2b61b770df
[lldb] Make TestModuleLoadedNotifys work with dyld from the shared cache
Make TestModuleLoadedNotifys work with a dyld from the expanded shared
cache in the DeviceSupport directory. In that case the module path is:

  ~/Library/Developer/Xcode/iOS DeviceSupport/<...>/Symbols/usr/lib/dyld

instead of just:

  /usr/lib/dyld

This makes the test pass when running against an embedded Darwin device.
2022-08-03 14:24:42 -07:00
Jonas Devlieghere 880b2128ef
[lldb] Mark TestRosetta as skipIfDarwinEmbedded
This test only makes sense on the host.
2022-08-03 14:24:37 -07:00
Chris Bieneman 383e754072 NFC. Require DirectX backend for these tests
Should have added this when I added the test directory. This just
requires the DirectX target for running these tests.
2022-08-03 15:55:03 -05:00
Chris Bieneman ce0bb316eb [DX] [NFC] Move hasSection check up
Juming out earlier if the global doesn't have a section is just a
cleaner early out.
2022-08-03 15:54:53 -05:00
Vitaly Buka e056e74dda [NFC][inline] Add const to an argument 2022-08-03 13:20:47 -07:00
Craig Topper ff91b2d9df [X86] Promote i16 CTTZ/CTTZ_ZERO_UNDEF always.
If we're going to emit a rep prefix before bsf as proposed in
D130956, it makes sense to promote i16 operations to i32 to avoid
the false depedency of tzcntw.

Reviewed By: skan, pengfei

Differential Revision: https://reviews.llvm.org/D130995
2022-08-03 13:12:20 -07:00
Rafael Auler 19eb908e61 [BOLT] Remove always true if statement
Got a warning from GCC when building this.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D131092
2022-08-03 13:11:33 -07:00
Adrian Prantl 11e5275cc2 Document why test is disabled on macOS Ventura
Starting with macOS 13 CoreFoundation pulls in Foundation, so we
always get the Foundation object description.

rdar://96224141

Differential Revision: https://reviews.llvm.org/D131025
2022-08-03 13:05:21 -07:00
Adrian Prantl 905f2d1ecb Fix LDV InstrRefBasedImpl to not crash when encountering unreachable MBBs.
The testcase was delta-reduced from an LTO build with sanitizer
coverage and the MIR tail duplication pass caused a machine basic
block to become unreachable in MIR. This caused the MBB to be invisible
to the reverse post-order traversal used to initialize the MBB <->
RPONumber lookup tables.

rdar://97226240

Differential Revision: https://reviews.llvm.org/D130999
2022-08-03 13:05:05 -07:00
Louis Dionne c5ccb78ade [clang][Darwin] Always set the default C++ Standard Library to libc++
Newer SDKs don't even provide libstdc++ headers, so it's effectively
never valid to build for libstdc++ unless the user explicitly asks
for it (in which case they will need to provide include paths and more).
2022-08-03 15:40:27 -04:00
Joseph Huber b3335e8ed7 [Libomptarget][NFC] Clang format the AMDGPU plugin
Summary:
A previous patch did not format the plugin again after making changes.
Ensure that libomptarget stays formatted.
2022-08-03 15:18:16 -04:00
Siva Chandra f0bb276794 [libc] Disable the loader init_fini_array_test for non-x86_64 targets.
Loader for aarch64 will be extended in a future pass and this test will
be enabled back again.
2022-08-03 12:06:13 -07:00
Corentin Jabot a274219600 Revert "[Clang][C++20] Support capturing structured bindings in lambdas"
This reverts commit 44f2baa380.

Breaks self builds and seems to have conformance issues.
2022-08-03 21:00:29 +02:00
Augusto Noronha 1f64f8bcab [lldb] Fix 'FileCheck' spelling on symtab regex tests 2022-08-03 11:57:33 -07:00
Jonas Devlieghere 0f821339da
[lldb] Add assertStopReason helper function
Add a function to make it easier to debug a test failure caused by an
unexpected stop reason. This is similar to the assertState helper that
was added in ce825e4674.

Before:

  self.assertEqual(stop_reason, lldb.eStopReasonInstrumentation)
  AssertionError: 5 != 10

After:

  self.assertStopReason(stop_reason, lldb.eStopReasonInstrumentation)
  AssertionError: signal (5) != instrumentation (10)

Differential revision: https://reviews.llvm.org/D131083
2022-08-03 11:44:13 -07:00
Walter Erquinigo 3716107934 [NFC][intel pt] Improve troubleshooting message 2022-08-03 11:34:03 -07:00
Alex Bradbury 9e966dd298 [RISCV][test] Add test for ability to tailcall libcalls
Although there's good coverage of the libcalls within llvm/test/CodeGen,
it's useful to have tests for all ABI and hard/soft-float combinations
in order to properly test the logic that enables libcall tail calls
(which will be implemented in a follow-up patch).
2022-08-03 19:27:59 +01:00
Vincent Lee c77db81616 [CMake] Fix runtimes cross-compilation when using LLVM_USE_LINKER
This is motivated by https://reviews.llvm.org/D115852#3226050 where passing
`LLVM_USE_LINKER` in PASSTHROUGH_PREFIXES breaks cross-compilation
(e.g. targeting Windows on a Linux host). As suggested on that diff, implement
an override for it by allowing users to pass `RUNTIMES_${target}_LLVM_USE_LINKER`
to specify the linker for runtimes. Defaults to host linker if not specified.

Reviewed By: phosek, smeenai

Differential Revision: https://reviews.llvm.org/D131051
2022-08-03 11:24:09 -07:00
Felipe de Azevedo Piovezan a5a8a05c78 [SelectionDAG] Handle IntToPtr constants in dbg.value
The function `handleDebugValue` has custom logic to handle certain kinds
constants, namely integers, floats and null pointers. However, it does
not handle constant pointers created from IntToPtr ConstantExpressions.
This patch addresses the issue by replacing the Constant with its
integer operand.

A similar bug was addressed for GlobalISel in D130642.

Reviewed By: aprantl, #debug-info

Differential Revision: https://reviews.llvm.org/D130908
2022-08-03 14:10:05 -04:00
Aaron Ballman c9edf843fc Error instead of assert when making a _BitInt vector
We already correctly rejected:
typedef __attribute__((vector_size(16))) _BitInt(4) Ty;

but we would assert with:
typedef __attribute__((ext_vector_type(4))) _BitInt(4) Ty;

Now we issue the same error in both cases.
2022-08-03 14:05:09 -04:00
Fangrui Song 71e8f79601 [ubsan] Make TypeCheckKinds const. NFC
Move it from .data to .data.rel.ro
2022-08-03 11:02:22 -07:00
Corentin Jabot 44f2baa380 [Clang][C++20] Support capturing structured bindings in lambdas
This completes the implementation of P1091R3 and P1381R1.

This patch allow the capture of structured bindings
both for C++20+ and C++17, with extension/compat warning.

In addition, capturing an anonymous union member,
a bitfield, or a structured binding thereof now has a
better diagnostic.

We only support structured bindings - as opposed to other kinds
of structured statements/blocks. We still emit an error for those.

In addition, support for structured bindings capture is entirely disabled in
OpenMP mode as this needs more investigation - a specific diagnostic indicate the feature is not yet supported there.

Note that the rest of P1091R3 (static/thread_local structured bindings) was already implemented.

at the request of @shafik, i can confirm the correct behavior of lldb wit this change.

Fixes https://github.com/llvm/llvm-project/issues/54300
Fixes https://github.com/llvm/llvm-project/issues/54300
Fixes https://github.com/llvm/llvm-project/issues/52720

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D122768
2022-08-03 20:00:01 +02:00
Augusto Noronha 3aef968ec3 [lldb] Allow SymbolTable regex search functions to match mangled name
It may be useful to search symbol table entries by mangled instead
of demangled names. Add this optional functionality in the SymbolTable
functions.

Differential Revision: https://reviews.llvm.org/D130803
2022-08-03 10:55:32 -07:00
Siva Chandra Reddy f23076f6c5 [libc] Add init and fini array iteration to the loader.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D130966
2022-08-03 17:53:23 +00:00
Jonas Devlieghere 6a48dc092b
[lldb] Add missing newlines after LLDB_INSTRUMENT_VA
Add a newline after LLDB_INSTRUMENT_VA to match the output of lldb-instr
and keep everything consistent.
2022-08-03 10:51:16 -07:00
isuckatcs 10a7ee0bac [analyzer] Fix for the crash in #56873
In ExprEngine::bindReturnValue() we cast an SVal to DefinedOrUnknownSVal,
however this SVal can also be Undefined, which leads to an assertion failure.

Fixes: #56873

Differential Revision: https://reviews.llvm.org/D130974
2022-08-03 19:25:02 +02:00
Michał Górny 3426fc7318 Revert "[lldb] [gdb-remote] Send interrupt packets from async thread"
This reverts commit 446b61cff4.  Of course
it does not work on Windows.
2022-08-03 19:09:35 +02:00
Amy Huang f3bd773abd Replace pdb file used in llvm-symbolizer test with a smaller file.
Reduce the size of the test-columns.pdb file from 6MB to 72KB by not
including standard libraries when building. Also update the instructions
for building the exe/pdb files.

context https://reviews.llvm.org/D81950#3692893

Differential Revision: https://reviews.llvm.org/D131035
2022-08-03 09:58:26 -07:00
Ben Langmuir 6a79e2ff19 [clang] Add FileEntryRef::getNameAsRequested()
As progress towards having FileManager::getFileRef() return the path
as-requested by default, return a FileEntryRef that can use
getNameAsRequested() to retrieve this path, with the ultimate goal that
this should be the behaviour of getName() and clients should explicitly
request the "external" name if they need to (see comment in
FileManager::getFileRef). For now, getName() continues to return the
external path by looking through the redirects.

For now, the new function is only used in unit tests.

Differential Revision: https://reviews.llvm.org/D131004
2022-08-03 09:41:08 -07:00
Michał Górny 446b61cff4 [lldb] [gdb-remote] Send interrupt packets from async thread
Refactor the mechanism for sending interrupt packets to send them
from async thread (i.e. the same thread that sends the continue packet
preceding them and that waits for the response), rather than from
the thread requesting the interrupt.  This is going to become especially
important when using the vCtrlC packet as part of the non-stop protocol,
as -- unlike the simple ^c sent in the all-stop mode -- this packet
involves an explicit reply.

Suggested by Pavel Labath in D126614.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D131075
2022-08-03 18:40:25 +02:00
Adrian Vogelsgesang 3b217f2f12 [libc++] Implement `operator<=>` for `shared_ptr`
Implements part of:

* P1614R2 The Mothership has Landed

Fixes LWG3427

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D130852
2022-08-03 18:32:45 +02:00
Louis Dionne 144cea2ce9 [libc++] Mark -fexperimental-library test as unsupported on another AppleClang 2022-08-03 12:24:00 -04:00
Jennifer Yu a7bca18bc5 Fix assert during the call to getCanonicalDecl.
https://github.com/llvm/llvm-project/issues/56884

The root problem is in isOpenMPRebuildMemberExpr, it is only need to rebuild
for field expression.  No need for member function call.

The fix is to check field for member expression and skip rebuild for member
function call.

Differential Revision: https://reviews.llvm.org/D131024
2022-08-03 09:14:28 -07:00
Casey Carter 3a45677467 [libcxx][test] Silence narrowing warning 2022-08-03 09:10:47 -07:00
John Regehr 5b4f6d8b4b prevent llvm-reduce from duplicating values in switch cases when turning operands into zero or one 2022-08-03 10:06:45 -06:00
Nicolai Hähnle 5c7c83885f Revert "ManagedStatic: remove from DynamicLibrary"
This reverts commit 38817af6a7.

Buildbots report a Windows build error. Revert until I can look at it
more carefully.
2022-08-03 17:56:46 +02:00
Philip Reames 569a7f6aa3 [LV] Move definition of isPredicatedInst out of line and make it const [nfc] 2022-08-03 08:53:11 -07:00
Nicolai Hähnle 38817af6a7 ManagedStatic: remove from DynamicLibrary
Differential Revision: https://reviews.llvm.org/D129127
2022-08-03 17:43:52 +02:00
Yitzhak Mandelbaum 692e03039d [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.
This patch modifies context-sensitive analysis of functions to use a cache,
rather than recreate the `ControlFlowContext` from a function decl on each
encounter. However, this is just step 1 (of N) in adding support for a
configurable map of "modeled" function decls (see issue #56879). The map will go
from the actual function decl to the `ControlFlowContext` used to model it. Only
functions pre-configured in the map will be modeled in a context-sensitive way.

We start with a cache because it introduces the desired map, while retaining the
current behavior. Here, functions are mapped to their actual implementations
(when available).

Differential Revision: https://reviews.llvm.org/D131039
2022-08-03 15:17:49 +00:00
Philip Reames a1cab0daae [LV] Use cost base decision for uniform mem op strategy [nfc-ish]
This is mostly a stylistic change to make the uniform memop widening cost
code fit more naturally with the sourounding code.  Its not strictly
speaking NFC as I added in the store with invariant value case, and we
could in theory have a target where a gather/scatter is cheaper than a
single load/store... but it's probably NFC in practice.  Note that the
scatter/gather result can still be overriden later if the result is
uniform-by-parts.
2022-08-03 07:47:24 -07:00
Erich Keane bf6db18e52 Fix char8_t in C mode regression from fb65b179
When doing that NFC refactor, I'd messed up how char8_t was reported,
which resulted in it being considered a 'future' keyword, without the
corresponding diagnostic, which lead to an assert.  This patch corrects
the char8_t to ONLY be future in C++ mode.
2022-08-03 07:15:30 -07:00
Nico Weber 96faef0f6e [gn build] Set LLVM_TOOLS_INSTALL_DIR to bin for llvm-config
Matches the CMake build, and might help with a flaky test on Windows.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1348730#c2
for details.
2022-08-03 09:51:14 -04:00
Pavel Labath 69c39e2abc [lldb] Fix TestDeletedExecutable on linux
Currently, lldb-server was opening the executable file to determine the
process architecture (to differentiate between 32 and 64 bit
architecture flavours). This isn't a particularly trustworthy source of
information (the file could have been changed since the process was
started) and it is not always available (file could be deleted or
otherwise inaccessible).

Unfortunately, ptrace does not give us a direct API to access the
process architecture, but we can still infer it via some of its
responses -- given that the general purpose register set of 64-bit
applications is larger [citation needed] than the GPR set of 32-bit
ones, we can just ask for the application GPR set and check its size.

This is what this patch does.

Differential Revision: https://reviews.llvm.org/D130985
2022-08-03 15:44:19 +02:00
Erich Keane fb65b17932 [NFCI] Refactor how KeywordStatus is calculated
The getKeywordStatus function is a horrible mess of inter-dependent 'if'
statements that depend significantly on the ORDER of the checks.  This
patch removes the dependency on order by checking each set-flag only
once.

It does this by looping through each of the set bits, and checks each
individual flag for its effect, then combines them at the end.

This might slow down startup performance slightly, as there are only a
few hundred keywords, and a vast majority will only get checked 1x
still.

This patch ALSO removes the KEYWORD_CONCEPTS flag, because it has since
become synonymous with C++20.

Differential Revision: https://reviews.llvm.org/D131007
2022-08-03 06:41:43 -07:00
Jonas Paulsson 84831bdfed [SystemZ] Make 128 bit integers be aligned to 8 bytes.
The SystemZ ABI says that 128 bit integers should be aligned to only 8 bytes.

Reviewed By: Ulrich Weigand, Nikita Popov

Differential Revision: https://reviews.llvm.org/D130900
2022-08-03 15:39:54 +02:00
Louis Dionne b7fb856397 [libc++] Simplify how we define the linker script for libc++
Trying to be generic didn't work properly because we had to special-case
some interface libraries that we didn't want in the linker script. Instead,
only look at the ABI and the unwinding libraries explicitly.

This should solve the issue reported by @dim in [1].

[1]: https://discourse.llvm.org/t/15-0-0-rc1-has-been-tagged/64174/22

Differential Revision: https://reviews.llvm.org/D131037
2022-08-03 09:29:50 -04:00