Commit Graph

432037 Commits

Author SHA1 Message Date
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
Louis Dionne 44b4f4df31 [libunwind] Remove unused substitution in AIX libunwind config
It must have been a copy-paste error, since cxx-include is never defined
by the libunwind config.

Differential Revision: https://reviews.llvm.org/D131030
2022-08-03 09:28:39 -04:00
Louis Dionne 3d5d44269c [libc++] More documentation improvements about running tests 2022-08-03 09:25:01 -04:00
David Truby 9a976f3661 [llvm] Always use TargetConstant for FP_ROUND ISD Nodes
This patch ensures consistency in the construction of FP_ROUND nodes
such that they always use ISD::TargetConstant instead of ISD::Constant.

This additionally fixes a bug in the AArch64 SVE backend where patterns
were matching against TargetConstant nodes and sometimes failing when
passed a Constant node.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D130370
2022-08-03 14:02:11 +01:00
Alex Bradbury 28f12a09ae [RISCV] Teach ComputeNumSignBitsForTargetNode about masked atomic intrinsics
An unnecessary sext.w is generated when masking the result of the
riscv_masked_cmpxchg_i64 intrinsic. Implementing handling of the
intrinsic in ComputeNumSignBitsForTargetNode allows it to be removed.

Although this isn't a particularly important optimisation, removing the
sext.w simplifies implementation of an additional cmpxchg-related
optimisation in D130192.

Although I can't produce a test with different codegen for the other
atomics intrinsics, these are added as well for completeness.

Differential Revision: https://reviews.llvm.org/D130191
2022-08-03 13:41:58 +01:00
Nicolai Hähnle d4cab87094 ManagedStatic: remove from CrashRecoveryContext
Differential Revision: https://reviews.llvm.org/D129126
2022-08-03 14:35:30 +02:00
Dmitry Preobrazhensky 05b3aadfff [AMDGPU][MC][GFX11] Correct v_dot2_f16_f16 and v_dot2_bf16_bf16
Enable SGPRs for the following operands of these opcodes:

- src operands of VOP3 variant.
- src2 operand of DPP variants.

Differential Revision: https://reviews.llvm.org/D130989
2022-08-03 15:08:23 +03:00
Dmitry Preobrazhensky ae553f9e49 [AMDGPU][MC][GFX10] Correct encoding of VOP3 v_cmpx* opcodes
Encode dst=EXEC but allow disassembler accept any dst value.

Differential Revision: https://reviews.llvm.org/D130978
2022-08-03 15:03:44 +03:00
Michele Scuttari e90deaf121 [MLIR] Reconciliation of chains of unrealized casts
The reconciliation pass has been improved to introduce the support for chains of casts, thus not limiting anymore the reconciliation to just consider pairs of unrealized casts.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D130711
2022-08-03 11:57:20 +00:00
Nicolai Hähnle 4cf0a9d4ae ManagedStatic: remove from Interpreter/ExternalFunctions
Differential Revision: https://reviews.llvm.org/D129124
2022-08-03 13:29:24 +02:00
Rainer Orth 75747e6e11 [mlir] Fix Analysis/Presburger/Utils.cpp compilation with GCC 11
As reported in Issue #56850, mlir/lib/Analysis/Presburger/Utils.cpp doesn't
compile on Solaris 11.4/SPARC with the bundled GCC 11, as seen when testing
LLVM 15.0.0 rc1:

  /var/llvm/reltest/llvm-15.0.0-rc1/rc1/llvm-project/mlir/include/mlir/Analysis/Presburger/MPInt.h:260:47:
error: inlining failed in call to ‘always_inline’ ‘int64_t
mlir::presburger::int64FromMPInt(const mlir::presburger::MPInt&)’: indirect
function call with a yet undetermined callee

This patch hacks around this and allowed the build to finish.

Tested on `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D131060
2022-08-03 11:48:44 +02:00
Johannes Reifferscheid 3e9e43b48e Fix compiler error: init-statements in if/switch.
Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D131061
2022-08-03 11:36:41 +02:00
Fraser Cormack 646e2f4803 [VP] Rename VP int<->float conversion ISD opcodes
These should be named like the non-VP versions for consistency.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D130967
2022-08-03 10:04:38 +01:00
Phoebe Wang c2066d19cd [X86][MC] Always emit `rep` prefix for `bsf`
`BMI` new instruction `tzcnt` has better performance than `bsf` on new
processors. Its encoding has a mandatory prefix '0xf3' compared to
`bsf`. If we force emit `rep` prefix for `bsf`, we will gain better
performance when the same code run on new processors.

GCC has already done this way: https://c.godbolt.org/z/6xere6fs1

Fixes #34191

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D130956
2022-08-03 17:09:36 +08:00
Johannes Reifferscheid 7ae5d00afa Fix a stack overflow in ScalarEvolution.
Unfortunately, this overflow is extremely hard to reproduce reliably (in fact, I was unable to do so). The issue is that:

- getOperandsToCreate sometimes skips creating an SCEV for the LHS
- then, createSCEV is called for the BinaryOp
- ... which calls getNoWrapFlagsFromUB
- ... which under certain circumstances calls isSCEVExprNeverPoison
- ... which under certain circumstances requires the SCEVs of all operands

For certain deep dependency trees, this causes a stack overflow.

Reviewed By: bkramer, fhahn

Differential Revision: https://reviews.llvm.org/D129745
2022-08-03 11:08:01 +02:00
Timm Bäder f4b9c0735e [clang][NFC] Try to fix the docs build 2022-08-03 10:52:02 +02:00
Markus Böck 34e814a00c [CMake] Make split-file an utility instead of tool
`split-file` is essentially a development tool used for writing tests. Other related tooling for this purpose such as `FileCheck`, `count`, `not` and more are already created via `add_llvm_utility` instead of `add_llvm_tool`. The later is more meant as LLVM tools used as part of a toolchain (eg. `llvm-ar`), not for tools for the development of LLVM itself.

The main semantic difference this makes is that `split-file` is now built and installed via the `LLVM_INSTALL_UTILS` and `LLVM_BUILD_UTILS` instead of `LLVM_BUILD_TOOLS` and `LLVM_INSTALL_TOOLS` cmake flags. That way one can use `LLVM_BUILD_TOOLS=OFF LLVM_INSTALL_UTILS=ON` and have `split-file` installed along side the other testing tools.

Differential Revision: https://reviews.llvm.org/D130977
2022-08-03 10:47:14 +02:00
Nicolai Hähnle 2fe3589acd ManagedStatic: remove from PluginLoader
Differential Revision: https://reviews.llvm.org/D129123
2022-08-03 10:41:58 +02:00
Nicolai Hähnle 48c401a60e ManagedStatic: remove from TimeProfiler
Differential Revision: https://reviews.llvm.org/D129121
2022-08-03 10:41:58 +02:00
Timm Bäder 11e52ecf74 [clang] Short-circuit trivial constructors when evaluating arrays
VisitCXXConstructExpr() will later do something similar, but for large
arrays, we should try to do it once an not for every element.

Fixes #56774

Differential Revision: https://reviews.llvm.org/D130791
2022-08-03 10:38:15 +02:00
Dawid Jurczak 3d51e2727d [NFC] Remove some boilerplate from SmallVector unit tests
In SmallVector unit test, referring test suite members every time using 'this'
(due to how non-dependent name lookups works) is quite cumbersome and can be improved with aliases.
Some test cases already use this approach, in this change we expand that approach to whole test file.

Differential Revision: https://reviews.llvm.org/D129990
2022-08-03 10:32:15 +02:00
Jannik Silvanus d0bfebda5b [Docs] Improve cycle and closed path definitions
Improve the cycle definition, by avoiding usage of not yet defined
or only vaguely defined terminology inside definitions.
More precisely, the existing definition defined "outermost cycles",
and then proceeded to use the term "cycles" for further definitions,
which in turn were used to actually define "cycles".

Now, instead only define "cycles". This does not change the meaning
of a cycle, which depends on the chosen surrounding (subgraph) of a CFG.

Also mention the function CFG in the first definition, because later
later definitions require it anyways.

Also slightly improve the definition of a closed path, by explicitly
requiring the inner nodes to be distinct.

Differential Revision: https://reviews.llvm.org/D130891
2022-08-03 10:28:13 +02:00
Alexander Belyaev 3285f94244 [mlir] Disable `misc-const-correctness` clang-tidy check.
https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html
2022-08-03 10:18:43 +02:00
Liu, Chen3 5bbb0a831f [X86] Using `X86MemOperand` instead of `Operand` for `i32mem_TC` and `i64mem_TC`
To fix build fail when X86_GEN_FOLD_TABLES is enabled.

Differential Revision: https://reviews.llvm.org/D131049
2022-08-03 16:17:51 +08:00
Nikita Popov b128e057c1 [AA] Make ModRefInfo a bitmask enum (NFC)
Mark ModRefInfo as a bitmask enum, which allows using normal
& and | operators on it. This supersedes various functions like
unionModRef() and intersectModRef(). I think this makes the code
cleaner than going through helper functions...

Differential Revision: https://reviews.llvm.org/D130870
2022-08-03 10:05:55 +02:00
Max Kazantsev 34ae308c73 [SCEV] Use context to strengthen flags of BinOps
Sometimes SCEV cannot infer nuw/nsw from something as simple as
```
  len in [0, MAX_INT]
...
  iv = phi(0, iv.next)
  guard(iv <s len)
  guard(iv <u len)
  iv.next = iv + 1
```
just because flag strenthening only relies on definition and does not use local facts.
This patch adds support for the simplest case: inference of flags of `add(x, constant)`
if we can contextually prove that `x <= max_int - constant`.

In case if it has negative CT impact, we can add an option to switch it off. I woudln't
expect that though.

Differential Revision: https://reviews.llvm.org/D129643
Reviewed By: apilipenko
2022-08-03 14:08:57 +07:00
Stanislav Gatev 817dd5e3fd [clang][dataflow] Rename member to make it clear that it isn't stable
Rename `DataflowAnalysisContext::getStableStorageLocation(QualType)`
to `createStorageLocation`, to make it clear that it doesn't return
a stable storage location.

Differential Revision: https://reviews.llvm.org/D131021

Reviewed-by: ymandel, xazax.hun, gribozavr2
2022-08-03 06:25:02 +00:00
Utkarsh Saxena 9ef11616b2 Add foldings for multi-line comment.
Differential Revision: https://reviews.llvm.org/D130081
2022-08-03 08:19:12 +02:00
jacquesguan 752c9d0dab [mlir][Math] Add constant folder for AtanOp.
This patch adds constant folder for AtanOp which only supports single and double precision floating-point.

Differential Revision: https://reviews.llvm.org/D130983
2022-08-03 14:10:02 +08:00