Commit Graph

453589 Commits

Author SHA1 Message Date
Mark de Wever
44c6b905f8 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi

Differential Revision: https://reviews.llvm.org/D144509
2023-03-04 12:40:57 +01:00
Craig Topper
fac4c476b9 [LoopInterchange] Remove unused RecurrenceDescriptor object. NFC 2023-03-03 22:15:32 -08:00
Joyce Brum
829b8912cd feat: harden permissions for all github workflows
Signed-off-by: Joyce Brum <joycebrum@google.com>

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D144119
2023-03-03 21:34:27 -08:00
Med Ismail Bennani
c0b4ca107a [lldb] Simplify error string in ScriptedInterface (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 20:18:28 -08:00
LLVM GN Syncbot
e55190cb53 [gn build] Port 3014a1c5a1 2023-03-04 03:33:20 +00:00
Med Ismail Bennani
ebdbc26a3e [lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation
When using SBProcess::GetScriptedImplementation in python, if the
process has a valid implementation, we returned a reference of the
object without incrementing the reference counting. That causes the
interpreter to crash after accessing the reference several times.

This patch address this by incrementing the reference count when passing
the valid object reference.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
efc52361dd [lldb] Improve error reporting in ScriptedInterface
This patch improve error reporting in the Scripted Interface.

Previously, it would only log the content of the Status object and
overwrite it with the error_msg function parameter.

This patch changes that to append the Status object content to the
`error_msg` string.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
f190ec6882 [lldb/Plugins] Add memory writing capabilities to Scripted Process
This patch adds memory writing capabilities to the Scripted Process plugin.

This allows to user to get a target address and a memory buffer on the
python scripted process implementation that the user can make processing
on before performing the actual write.

This will also be used to write trap instruction to a real process
memory to set a breakpoint.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
e02a355f98 [lldb/Plugins] Clean-up Scripted Process interface requirements (NFC)
The goal of the simple patch is to clean-up the scripted process
interface by removing methods that were introduced with the interface
originally, but that were never really implemented (get_thread_with_id &
get_registers_for_thread).

This patch also changes `get_memory_region_containing_address` to have a
base implementation (that retunrs `None`), instead of forcing the user
to override it in their derived class.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
b9d4c94a60 [lldb/Plugins] Add Attach capabilities to ScriptedProcess
This patch adds process attach capabilities to the ScriptedProcess
plugin. This doesn't really expects a PID or process name, since the
process state is already script, however, this allows to create a
scripted process without requiring to have an executuble in the target.

In order to do so, this patch also turns the scripted process related
getters and setters from the `ProcessLaunchInfo` and
`ProcessAttachInfo` classes to a `ScriptedMetadata` instance and moves
it in the `ProcessInfo` class, so it can be accessed interchangeably.

This also adds the necessary SWIG wrappers to convert the internal
`Process{Attach,Launch}InfoSP` into a `SB{Attach,Launch}Info` to pass it
as argument the scripted process python implementation and convert it
back to the internal representation.

rdar://104577406

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
3014a1c5a1 [lldb] Add scripted process launch/attach option to {,platform }process commands
This patch does several things:

First, it refactors the `CommandObject{,Platform}ProcessObject` command
option class into a separate `CommandOptionsProcessAttach` option group.

This will make sure both the `platform process attach` and `process attach`
command options will always stay in sync without having with duplicate
them each time. But more importantly, making this class an `OptionGroup`
allows us to combine with a `OptionGroupPythonClassWithDict` to add
support for the scripted process managing class name and user-provided
dictionary options.

This patch also improves feature parity between `ProcessLaunchInfo` and
`ProcessAttachInfo` with regard to ScriptedProcesses, by exposing the
various getters and setters necessary to use them through the SBAPI.

This is foundation work for adding support to "attach" to a process from
the scripted platform.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
2d5348be25 [lldb/Plugins] Add ScriptedProcess::GetCapabilities affordance (NFC)
This patch introduces a new method to the Scripted Process interface,
GetCapabilities.

This returns a dictionary that contains a list of flags that the
ScriptedProcess instance supports. This can be used for instance, to
force symbol lookup, when loading dynamic libraries in the scripted process.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:02 -08:00
Med Ismail Bennani
e6cac17b56 [lldb] Extend SWIG SBProcess interface with WriteMemoryAsCString method
This patch tries to address an interoperability issue when writing
python string into the process memory.

Since the python string is not null-terminated, it would still be
written to memory however, when trying to read it again with
`SBProcess::ReadCStringFromMemory`, the memory read would fail, since
the read string doens't contain a null-terminator, and therefore is not
a valid C string.

To address that, this patch extends the `SBProcess` SWIG interface to
expose a new `WriteMemoryAsCString` method that is only exposed to the
SWIG target language. That method checks that the buffer to write is
null-terminated and otherwise, it appends a null byte at the end of it.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-03-03 19:33:01 -08:00
Derek Schuff
c7af9ae577 Reapply: [WebAssembly] Implement build-id feature
Implement the --build-id flag similarly to ELF, and generate a
build_id section according to the WebAssembly tool convention
specified in https://github.com/WebAssembly/tool-conventions/pull/183

The default style ("fast" aka "tree") hashes the contents of the
output and (unlike ELF) generates a v5 UUID based on the hash (using a
random namespace). It also supports generating a random v4 UUID, a
sha1 hash, and a user-specified string (as ELF does).

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

Fix MSVC build by std::copy on the underying buffer rather than
directly from std::array to llvm::MutableArrayRef
2023-03-03 17:15:55 -08:00
Jacques Pienaar
1a1dc440da [mlir] Update signal failure error message
User was confused by previous wording when pass was reported as failing
due to signal in unrelated thread being caught.

Differential Revision: https://reviews.llvm.org/D145213
2023-03-03 17:06:48 -08:00
isuckatcs
d65379c8d4 [analyzer] Remove the loop from the exploded graph caused by missing information in program points
This patch adds CFGElementRef to ProgramPoints
and helps the analyzer to differentiate between
two otherwise identically looking ProgramPoints.

Fixes #60412

Differential Revision: https://reviews.llvm.org/D143328
2023-03-04 02:01:45 +01:00
Maksim Sabianin
b056c1cb1b [StripDebugInfo] Reuse DebugInfoFinder for findind Live CUs
Previous search does not take into account @llvm.dbg.* intrinsics
and debug types information while DebugInfoFinder takes into account
such information.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D145239
2023-03-03 16:21:30 -08:00
Keith Smiley
a65678b35b
[lld-macho] Avoid running LTO pipeline for no files
If no bitcode files are given as inputs but -object_path_lto is passed
we should avoid running the LTO pipeline.

This mirrors this patch from the ELF port f3994e4dfa

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

Differential Revision: https://reviews.llvm.org/D145273
2023-03-03 15:28:59 -08:00
LLVM GN Syncbot
5ccdf2afde [gn build] Port 0eb59cab95 2023-03-03 23:01:08 +00:00
Matt Arsenault
71f1ea2c15 APFloat: Add classify 2023-03-03 18:54:58 -04:00
Matt Arsenault
ba215246dc Attributor: Fix typos 2023-03-03 18:54:42 -04:00
Matt Arsenault
ce3d93e4be AMDGPU: Use static constexpr instead of static const
Not sure why this was broken, but I was seeing this linker error:

ld64.lld: error: undefined symbol: (anonymous namespace)::AMDGPUInsertDelayAlu::DelayInfo::SALU_CYCLES_MAX
>>> referenced by AMDGPUInsertDelayAlu.cpp:129 (/Users/matt/src/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp:129)
2023-03-03 18:50:34 -04:00
Matt Arsenault
18fa83ed36 ADT: Move some FPClassTest utility functions out of instcombine 2023-03-03 18:20:47 -04:00
Matt Arsenault
0eb59cab95 ADT: Move FPClassTest printing functions to common place 2023-03-03 18:20:47 -04:00
Rahul Kayaith
55cf53fd0f [mlir][Parser] Make parse{Attribute,Type} null-terminate input
`parseAttribute` and `parseType` require null-terminated strings as
input, but this isn't great considering the argument type is
`StringRef`. This changes them to copy to a null-terminated buffer by
default, with a `isKnownNullTerminated` flag added to disable the
copying.

closes #58964

Reviewed By: rriddle, kuhar, lattner

Differential Revision: https://reviews.llvm.org/D145182
2023-03-03 17:03:27 -05:00
David Green
ae12e57a77 [AArch64] Add missing bf16 load insert pattern
We have LDRHui load patterns but would fail to select from unscaled offsets.
This adds the missing pattern.
2023-03-03 22:00:41 +00:00
Keith Smiley
6578e0d1d0
[lld-macho] Remove duplicate minimum version info
At some point PlatformInfo's Target changed types to a type that also
has minimum deployment target info. This caused ambiguity if you tried
to get the target triple from the Target, as the actual minimum version
info was being stored separately. This bulk of this change is changing
the parsing of these values to support this.

Differential Revision: https://reviews.llvm.org/D145263
2023-03-03 13:47:01 -08:00
Michael Buch
96e39fdbb9 [lldb][test] NativePDB/ast-types: fix expected pointer format
Format changed in `b642fd5ee250247ccefb38099169b4ee8ac4112b`

Differential Revision: https://reviews.llvm.org/D145241
2023-03-03 21:41:18 +00:00
Jeffrey Byrnes
b89236a96f [AMDGPU] Vectorize misaligned global loads & stores
Based on experimentation on gfx906,908,90a and 1030, wider global loads / stores are more performant than multiple narrower ones independent of alignment -- this is especially true when combining 8 bit loads / stores, in which case speedup was usually 2x across all alignments.

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

Change-Id: I6ee6c76e6ace7fc373cc1b2aac3818fc1425a0c1
2023-03-03 13:18:25 -08:00
Jay Foad
7442f8635b [AMDGPU] Fix invalid instid value in s_delay_alu instruction
Differential Revision: https://reviews.llvm.org/D145232
2023-03-03 21:08:26 +00:00
Jordan Rupprecht
ebb94ecb95 [bazel] Fix errno dep location: libc_function_deps -> deps 2023-03-03 12:59:56 -08:00
Jordan Rupprecht
fc840808e6 [bazel] Add errno dep to stdlib tests
In addition run buildifier.
2023-03-03 12:55:03 -08:00
Argyrios Kyrtzidis
5e035651fd [clang/Diagnostic] Use optional to disambiguate between a StoredDiagMessage that is not set vs set as empty string
"But when would you have a completely empty diagnostic message", you ask dear reader?
That is when there is an empty "#warning" in code.

rdar://106155415

Differential Revision: https://reviews.llvm.org/D145256
2023-03-03 12:48:48 -08:00
Fangrui Song
b30b1f173c [ELF] Add single quotes around out of range errors
to match the convention we use for other diagnostics.
2023-03-03 12:48:16 -08:00
Fangrui Song
ffa1118330 [ELF] Mention section name for STT_SECTION in reportRangeError()
D73518 mentioned non-STT_SECTION symbol names. This patch extends the code to
handle STT_SECTION symbols, where we report the section name.
This change helps at least the following cases with very little code.

* Whether a out-of-range relocation is due to code or data.
* For a relocation in .debug_info, which referenced `.debug_*` section (due to DWARF32 limitation) causes the problem.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D145199
2023-03-03 12:35:05 -08:00
Jessica Clarke
3a748cd01b [RISCV][NFC] Add PIC RUN/CHECK lines for jumptable.ll test
The omission of checking our PIC jump table code generation is a bit of
an oversight, so belatedly add this coverage.
2023-03-03 20:19:15 +00:00
Jessica Clarke
6e8bcaafba [RISCV][NFC] Unify CHECK lines for jumptable.ll @below_threshold test
These are all identical across XLEN and code model since they're not
using a jump table, so unify them rather than having multiple copies.
2023-03-03 20:18:18 +00:00
Jessica Clarke
e0fe8e6412 [RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w
Sign-extending the input is irrelevant to the test in question, which
merely needs some arbitrary input to switch on. This also removes the
only difference between the RV32I and RV64I cases for @below_threshold
and will allow unifying them.
2023-03-03 20:14:31 +00:00
Amir Ayupov
1e1dfbb94a [BOLT][Instrumentation] Preserve red zone for functions with tail calls only
Allow a function with tail calls only to clobber its red zone.

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

Reviewed By: #bolt, yota9

Differential Revision: https://reviews.llvm.org/D145202
2023-03-03 12:02:17 -08:00
Alex Brachet
96ff21243e [libc] Fix strspn 2023-03-03 19:51:46 +00:00
Alex Brachet
92d3c3294a [llvm-driver] Allow llvm driver binary to be called anything 2023-03-03 19:45:03 +00:00
Florian Hahn
1df8de238b
[VPlan] Add test with intrinsic without side-effects (NFC).
Extra test coverage for mayHaveSideEffects for VPWidenCallRecipe.
2023-03-03 20:30:30 +01:00
Philip Reames
04ed64e42f [RISCV][llvm-tblgen] Support conditional definitions using !exists clauses
The core part of this change is an extension to the tablegen language to allow conditional definition of records using if-statements based on !exists conditions.

The RISCV td file change is mostly to illustrate the potential use of conditional definitions. I am deliberately not maximally simplifying in this change to make merging with downstream code (or simply rebasing while this on review) easier.

Some background to make the change understandable.

TableGen does not have an if statement internally. It has if expressions - in the form of TernInitOp with IF opcode - and foreach statements. It implements an if-statement as a foreach which iterates either 0 or 1 times.

Foreach nodes are then evaluated via unrolling inside the parser. Specifically, they are evaluated, at latest, when the outermost multiclass or loop containing them reaches end of scope. The unrolled statements remain (potentially) unresolved after unrolling, but the number of iterations must be known at this point.

An !exists clause can only evaluate at final evaluation. (Specifically, forward references to definitions are allowed - up to the end of the containing scope at least.) The existing code did not set the final flag on the resolver, and thus would leave the !exists clause in an unresolved state. This would then cause an error since we don't know how many iterations on which to unroll the (synthetic) foreach loop.

I chose to only finally-evaluate the condition of the if-expression. This allows us to pick an arm at scope exit without inhibiting definitions in the arm from having self references.

Differential Revision: https://reviews.llvm.org/D145108
2023-03-03 11:29:47 -08:00
Arthur Eubanks
bd80dbf284 [test] Precommit test for D145210 2023-03-03 11:22:32 -08:00
Michael Jones
04a9c62554 [libc] move stdlib and stdio to new errno pattern
Fixes https://github.com/llvm/llvm-project/issues/61071

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145191
2023-03-03 11:15:36 -08:00
Vadim Paretsky
56e8fd6f6a [llvm-lib] update ReleaseNotes for llvm-lib's new support for generating
an import library from a definition file

Differential Revision:https://reviews.llvm.org/D145140
2023-03-03 10:54:27 -08:00
Jeffrey Tan
83263aeceb Add HitCount into Breakpoint statistics
Turns out breakpoint statistics is missing hitCount.
This patches adds the hitCount field.

Differential Revision: https://reviews.llvm.org/D145203
2023-03-03 10:28:56 -08:00
Daniel Thornburgh
072e07a9d5 [llvm-cov] Optionally fail on missing binary ID
This adds the --check-binary-id flag that makes sure that an object file
is available for every binary ID mentioned in the given profile. This
should help make the tool more robust in CI environments where it's
expected that coverage mappings should be available for every object
contributing to the profile.

Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D144308
2023-03-03 10:24:21 -08:00
Jan Svoboda
3ac8d32210 [clang][deps] Fix test failing on AIX
Introduced in 86405450, caused by AIX defaulting to `-fno-integrated-as`.
2023-03-03 10:22:39 -08:00
zhijian
e16713d877 Remove extraneous characters when printing the timestamp for an XCOFF object file.
Summary:

The llvm-readobj prints extra characters for the timestamp when --file-headers is used with an XCOFF file. This change updates the format string used to print the time. In addition, the timestamp is printed in the local timezone, and a thread-safe call is used to convert the time.

Summit the patch on behalf of Stephen Peckham.

Reviewers: James Henderson, Digger Lin
Differential Revision: https://reviews.llvm.org/D144281
2023-03-03 13:18:58 -05:00