Matt Arsenault [Thu, 26 Jan 2023 17:20:12 +0000 (13:20 -0400)]
AMDGPU: Combine down fcopysign f64 magnitude
Copy through the low bits and only apply an f32
copysign to the high half. This is effectively
what we do for codegen anyway, but this provides
some combine benefits. The cases involving constants
show some small improvements.
https://reviews.llvm.org/D142682
Paulo Matos [Mon, 6 Mar 2023 09:51:14 +0000 (10:51 +0100)]
Revert "[Docs] Add my Office Hours"
This reverts commit
b293de988059cac25c4ad84371be09107de7bbc4.
Florian Hahn [Mon, 6 Mar 2023 09:50:34 +0000 (10:50 +0100)]
[GlobalOpt] Add tests that only stores initializer, split test file.
Add an additional tests that stores the initializer, but the global
doesn't have a zeroinitializer. Also separate out the tests for storing
initializers.
Add extra tests for D144476.
Haojian Wu [Mon, 6 Mar 2023 09:33:54 +0000 (10:33 +0100)]
[include-fixer] Add the missing optional header to the STL header list.
Matthias Springer [Mon, 6 Mar 2023 08:24:39 +0000 (09:24 +0100)]
[mlir][IR] Trigger notifyOperationModified for replacements
Each user of the original value is modified in-place. Therefore, the corresponding notification should be triggered.
Also fixes a bug where `RewriterBase::mergeBlocks` did not notify the GreedyPatternRewriteDriver when replacing uses of block arguments. This function does not trigger "operation replaced" notifications, so the GreedyPatternRewriteDriver was not made aware of such IR changes.
Differential Revision: https://reviews.llvm.org/D144549
Nikita Popov [Fri, 3 Mar 2023 15:22:41 +0000 (16:22 +0100)]
[LowerTypeTests] Avoid creation of select constant expression
LowerTypeTests replaces weak declarations with an icmp+select
constant expressions. As this is not a relocatable expression,
it additionally promotes initializers using it to global ctors.
As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179,
I would like to remove the select constant expression, of which LTT
is now the last user. This is a bit tricky, because we now need to
replace a constant with an instruction, which might require
converting intermediate constant expression users to instructions as
well.
We do this using the convertUsersOfConstantsToInstructions() helper.
However, it needs to be slightly extended to also support expansion
of ConstantAggregates. These are important in this context, because
the promotion of initializers to global ctors will produce stores
of such aggregates.
Differential Revision: https://reviews.llvm.org/D145247
Max Kazantsev [Mon, 6 Mar 2023 08:13:55 +0000 (15:13 +0700)]
[SimpleLoopUnswtich] Support zext when injecting invariant conditions
This patch handles the following case: turn
```
if (x <u Invariant1) {
if (zext(x) <u Invariant2) {
...
}
}
```
into
```
if (x <u Invariant1) {
if (zext(Invariant1) <=u Invariant2) { // Unswitch here
// No check needed
} else {
if (zext(x) <u Invariant2) {
...
}
}
}
```
Differential Revision: https://reviews.llvm.org/D138015
Reviewed By: skatkov
Mariya Podchishchaeva [Mon, 6 Mar 2023 08:25:57 +0000 (03:25 -0500)]
[clang] Fix aggregate initialization inside lambda constexpr
Constant evaluator only considered access to `this` pointer to be
possible if `this` poitners was captured. However `this` can also appear if
there was a default member initializer.
Fixes https://github.com/llvm/llvm-project/issues/60936
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D144866
Valentin Clement [Mon, 6 Mar 2023 08:35:36 +0000 (09:35 +0100)]
[flang] Use AssignPolymorphic when LHS is polymorphic
Make use of the new runtime entry point for assignment to
LHS allocatable polymorphic.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D145324
Kai Luo [Mon, 6 Mar 2023 08:01:24 +0000 (16:01 +0800)]
Reland [AIX][BigArchive] Treat the archive is empty if the first child member offset is zero
If the archive contains free list and contains no member file, the buffer length doesn't equal to length of the header.
Reviewed By: Esme, DiggerLin, #powerpc
Differential Revision: https://reviews.llvm.org/D138986
Balázs Kéri [Mon, 6 Mar 2023 07:55:19 +0000 (08:55 +0100)]
[clang][ASTImporter] Add VaList declaration to lookup table.
The declaration of __builtin_va_list seems to be handled specially
by ASTContext and/or Sema. The normal AST traversal probably can
not find it, therefore it is not added to ASTImporterLookupTable.
If it is not added, errors can occur because a duplicated
VaList declaration is created at import. To fix the problem the
VaList declaration is added manually to ASTImporterLookupTable
at construction.
In special cases this declaration is inside a "invisible" 'std'
namespace that behaves the same way. This namespace must be added
to the table too.
Reviewed By: vabridgers, donat.nagy
Differential Revision: https://reviews.llvm.org/D144273
Siva Chandra [Mon, 6 Mar 2023 08:24:16 +0000 (00:24 -0800)]
[libc][Obvious] Add back CMake logic which was mistakenly deleted earlier.
Matthias Springer [Mon, 6 Mar 2023 08:11:42 +0000 (09:11 +0100)]
[mlir][IR][NFC] Move `walk` definitions to header file
This allows users to provide custom `Iterator` templates. A new iterator will be added in a subsequent change.
Also rename `makeRange` to `makeIterable` and add a test case for the reverse iterator.
Differential Revision: https://reviews.llvm.org/D144887
Max Kazantsev [Mon, 6 Mar 2023 08:11:56 +0000 (15:11 +0700)]
[NFC] Fix typo in comment
Matthias Springer [Fri, 3 Mar 2023 16:56:39 +0000 (17:56 +0100)]
[mlir][Interfaces] ReifyRankedShapedTypeOpInterface returns OpFoldResults
`reifyResultShapes` now returns `OpFoldResult`s instead of `Value`s. This is often more efficient because many transformations immediately attempt to extract a constant from the reified values.
Differential Revision: https://reviews.llvm.org/D145250
Siva Chandra Reddy [Sat, 4 Mar 2023 05:35:45 +0000 (05:35 +0000)]
[libc] Simplify integration tests by eliminating the artificial sysroot.
The test binaries are built like any other executable but with two
additional linker options -static and -nostdlib.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D145298
Muhammad Omair Javaid [Mon, 6 Mar 2023 07:25:52 +0000 (11:25 +0400)]
[LLVM] Remove XFAIL from merge-equivalent-ranges.ll
This patch removes XFAIL decorator from merge-equivalent-ranges.ll
test.
Merge equilant ranges is passing on aarch64-windows-msvc buildbot
since: https://lab.llvm.org/buildbot/#/builders/120/builds/4291
Kazu Hirata [Mon, 6 Mar 2023 06:48:28 +0000 (22:48 -0800)]
[APInt] Deprecate several functions
This patch deprecates:
- those functions that have been soft-deprecated
- countPopulation
Note that I've already migrated away from all known uses of these
functions.
Differential Revision: https://reviews.llvm.org/D144423
Chuanqi Xu [Mon, 6 Mar 2023 06:39:27 +0000 (14:39 +0800)]
[NFC] Add an invalid test case for C++20 Modules
Address https://github.com/llvm/llvm-project/issues/61150.
The test is intended to show the polluted operator&& will affect the ODR
checking and the ODR checking here is correct.
Carl Ritson [Mon, 6 Mar 2023 02:36:01 +0000 (11:36 +0900)]
[ValueMapper] Preserve poison types during value mapping
Poison needs to be treated directly during type remap otherwise
it will be considered an instance of undef.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D145317
Sameer Sahasrabuddhe [Mon, 6 Mar 2023 04:56:01 +0000 (10:26 +0530)]
[llvm] [NFC] fix comments describing GenericSSAContext
Tue Ly [Mon, 6 Mar 2023 05:06:03 +0000 (00:06 -0500)]
[libc][Obvious] Add errno entrypoint for macOS ARM64.
ShihPo Hung [Thu, 19 Jan 2023 02:02:27 +0000 (18:02 -0800)]
[CostModel][RISCV] Model code size cost for reduction
Since code-size cost doesn't scale linearly with LMUL,
this change is to separate it from throughput.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D142068
Hristo Hristov [Mon, 6 Mar 2023 00:04:52 +0000 (01:04 +0100)]
[libc++][spaceship][NFC] Marked `operator<=>` for `move_iterator` and `counted_iterator` as implemented
Apprarently implemented as part of:
- `move_iterator` - https://reviews.llvm.org/D117656
- `counted_iterator` - https://reviews.llvm.org/D106205
Reviewed By: #libc, philnik
Spies: libcxx-commits, yaxunl
Differential Revision: https://reviews.llvm.org/D145243
Matt Arsenault [Thu, 26 Jan 2023 16:18:47 +0000 (12:18 -0400)]
AMDGPU: Force sign operand of f64 fcopysign to f32
The fcopysign DAG operation, unlike the IR one, allows
different types for the sign and magnitude. We can reduce
the bitwidth of the high operand since only the sign bit matters.
The default combine only introduces mixed fcopysign
operand types from fpext/fptrunc. We effectively do this
already during selection, but doing it earlier in the combiner
should expose new combine opportunities (e.g. the existing tests
now eliminate the load of the low half of the double). Unfortunately
this isn't enough to handle the case I'm interested in just yet.
Yuanfang Chen [Sun, 5 Mar 2023 23:27:18 +0000 (15:27 -0800)]
[CodeGen] guarantee variable templates are initialized in the reverse instantiation order
Following up D127259.
Fixes https://github.com/llvm/llvm-project/issues/61028.
Matt Arsenault [Mon, 23 Jan 2023 19:42:59 +0000 (15:42 -0400)]
AMDGPU: Try to push fneg as integer into select
I initially attempted to select the source modifier from xor of
a sign mask. This proved to be more difficult since
foldBinOpIntoSelect does not consider free fneg of integers
and undoes the combine.
Nikolas Klauser [Mon, 19 Dec 2022 20:54:05 +0000 (21:54 +0100)]
[libc++] Update supported system versions
Reviewed By: ldionne, #libc, emaste, daltenty
Spies: fsb4000, daltenty, alvinhochun, goncharov, phosek, MaskRay, dalias, q66, thesamesam, emaste, libcxx-commits, arphaman, mstorsjo, #libc_vendors
Differential Revision: https://reviews.llvm.org/D140343
Matt Arsenault [Sun, 5 Mar 2023 20:13:23 +0000 (16:13 -0400)]
llvm-reduce: Use explicit output file in a test
The default argument behavior test tries to make use
of the default reduced.ll, so other tests should not try to
write to the same file.
Maybe fixes issue #61132.
Egor Suvorov [Sun, 5 Mar 2023 18:22:10 +0000 (18:22 +0000)]
[clang-tidy] altera-id-dependent-backward-branch: refactor test
This is a preparation for future fixes that need more tests.
* Put all "Inferred Assignments" testing at the end
* Group together ID-dependent variable/member testing
* Group together unused inferred assignments
* Use a literal instead of `get_local_size` which may have special meaning
* Create a new `struct` for each variable because analysis is done per field,
not per field per instance.
Depends on D145303
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D145304
Fangrui Song [Sun, 5 Mar 2023 17:46:42 +0000 (17:46 +0000)]
[sanitizer][NetBSD] Remove ioctl TIOCRCVFRAME and TIOCXMTFRAME
The two macros were removed by
https://mail-index.netbsd.org/source-changes/2022/12/21/msg142441.html
Close #61151
Mike Crowe [Sun, 5 Mar 2023 17:04:30 +0000 (17:04 +0000)]
[clang-tidy] Extract string header from redundant-string-cstr checker
In preparation for using the implementation of basic_string and
basic_string_view from redundant-string-cstr.cpp in other checks, let's
extract it to a header.
Using the existing <string.h> to provide size_t, using that to define
size_type and using it rather than the previous "size" type makes it
easier to provide the size() method later and makes the implementation
closer to the standard.
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D144216
David Green [Sun, 5 Mar 2023 16:52:24 +0000 (16:52 +0000)]
[AArch64] Add missing bf16 SVE extract vector patterns
Similar to the inserts, these are the same fp16 inserts but were missing
patterns.
David Green [Sun, 5 Mar 2023 16:24:43 +0000 (16:24 +0000)]
[AArch64] Add missing bf16 SVE insert vector patterns.
These should be identical to the fp16 SVE inserts but were missing from the
tests and tablegen patterns. They are always legal (not requiring +bf16),
although there are some other issues around bf16 legalization currently.
Egor Suvorov [Sun, 5 Mar 2023 15:44:26 +0000 (15:44 +0000)]
clang-tidy altera-id-dependent-backward-branch: print notes after warning
In Clang notes are typically printed after a corresponding warning, not before.
For example, all notes issued before the first warning are ignored.
Running `clang-tidy --checks=-*,altera-id-dependent-backward-branch a.cpp` on the following code:
```
long get_local_id(int);
void error() {
int ThreadID = get_local_id(0);
for (int i = 0; i < ThreadID; i++) {
}
for (int i = 0; i < ThreadID; i++) {
}
}
```
results in two warnings and a single note in between.
Reviewed By: carlosgalvezp
Differential Revision: https://reviews.llvm.org/D145303
Jacques Pienaar [Sun, 5 Mar 2023 15:37:58 +0000 (07:37 -0800)]
[mlir][scf] Relax type requirement on for
scf.for loop was restricted to only operate on Index type since
splitting out from affine.for. Relax requirement to allow for signless
integer types additionally. This allows specifying explicitly different
bitwidths for different loops as well as specialize from index to iN
while still using scf.for.
Differential Revision: https://reviews.llvm.org/D145288
Nikolas Klauser [Sun, 5 Mar 2023 13:09:32 +0000 (14:09 +0100)]
[libc++][NFC] Add consteval to ranges::__get_wider_signed::__call
Luís Marques [Sun, 5 Mar 2023 12:16:28 +0000 (12:16 +0000)]
[Support] Implement findModulesAndOffsets on Apple 64-bit platforms
To have line number information in stack traces (per stack frame) it's
necessary to implement findModulesAndOffsets.
Differential Revision: https://reviews.llvm.org/D142282
Timm Bäder [Sun, 5 Mar 2023 12:18:13 +0000 (13:18 +0100)]
Revert "[clang][Interp] Support destructors"
This reverts commit
78e4237460bf58f3d6b75f275e0424f38e3b1d04.
This breaks the memory sanitizer builder:
https://lab.llvm.org/buildbot/#/builders/5/builds/31959
Florian Hahn [Sun, 5 Mar 2023 11:08:54 +0000 (12:08 +0100)]
[VPlan] VPWidenCallRecipe has side-effects if the call has.
Handle VPWidenCallRecipe in VPRecipeBase::mayHaveSideEffects by
delegating to the underlying call.
Timm Bäder [Thu, 5 Jan 2023 12:40:54 +0000 (13:40 +0100)]
[clang][Interp] Support destructors
Use the existing local variable cleanup infrastructure to implement
destruction.
Differential Revision: https://reviews.llvm.org/D137070
Timm Bäder [Thu, 5 Jan 2023 12:38:57 +0000 (13:38 +0100)]
[clang][Interp][NFCI] Support more expression in initializers
Kazu Hirata [Sun, 5 Mar 2023 08:48:53 +0000 (00:48 -0800)]
[X86] Precommit tests
This patch precommits more tests for:
https://github.com/llvm/llvm-project/issues/60802
Jay Foad [Sun, 5 Mar 2023 08:12:02 +0000 (08:12 +0000)]
[AMDGPU] More precise limit on SALU cycles in s_delay_alu instructions
This just tweaks the fix for D145232 to make the limit more precise, so
that we could actually emit a delay of 3 SALU cycles (the maximum) if we
had any SALU instructions that required it.
Siva Chandra Reddy [Fri, 3 Mar 2023 21:24:09 +0000 (21:24 +0000)]
[libc] Switch signal and termios to libc_errno.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D145274
Dave Lee [Sun, 5 Mar 2023 01:14:50 +0000 (17:14 -0800)]
[lldb] Remove unused portion of GetFunctionMethodInfo signature (NFC)
This applies to IsClassMethod as well.
Siva Chandra Reddy [Sun, 5 Mar 2023 02:58:45 +0000 (02:58 +0000)]
[libc][Obvious] Add the LIBC_INLINE tag to a function define in a.h file.
Siva Chandra Reddy [Sun, 5 Mar 2023 00:23:48 +0000 (00:23 +0000)]
[libc][NFC] Remove allocator definition in the api-test.
The integration tests already have allocators so we will get all of them
from there.
Tulio Leao [Sat, 4 Mar 2023 22:56:15 +0000 (00:56 +0200)]
Fix broken link on Clang documentation page
While browsing the latest [clang manual](https://clang.llvm.org/docs/ReleaseNotes.html), I came across this warning and clicked, but it leads to a broken page, apparently because it's missing the trailing `/`. Seems to be the only place where it's missing in the whole of LLVM monorepo.
{
F26690053}
{
F26690057}
Reviewed By: brenoguim, royjacobson
Differential Revision: https://reviews.llvm.org/D145047
Kazu Hirata [Sat, 4 Mar 2023 20:20:04 +0000 (12:20 -0800)]
[X86] Add non-BMI tests to bit_ceil.ll
Shao-Ce SUN [Sat, 4 Mar 2023 17:55:55 +0000 (01:55 +0800)]
[OpenMP][CUDA] Get rid of redundant macro def
Resolve warning of `TARGET_NAME` macro redefinition.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D145307
Mark de Wever [Sat, 4 Mar 2023 17:28:13 +0000 (18:28 +0100)]
Revert "[CMake] Bumps minimum version to 3.20.0."
Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.
This reverts commit
44c6b905f8527635e49bb3ea97dea315f92d38ec.
Timm Bäder [Thu, 2 Mar 2023 10:05:45 +0000 (11:05 +0100)]
Re-land "[clang][Interp] Implement C++ Range-for loops"
Differential Revision: https://reviews.llvm.org/D140803
Mark de Wever [Fri, 17 Feb 2023 17:55:48 +0000 (18:55 +0100)]
[libc++][format] Fixes formatting vector<bool>
Formatting a const qualified vector<bool> fails to work on libc++. This
is due to our non-conforming type for vector<bool>::const_reference. The
type is a __bit_const_reference<vector> instead of a bool. (This is
fixed in ABI v2.)
This fixes this formatter and enables the test written for it.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D144279
Mark de Wever [Sun, 12 Feb 2023 18:46:13 +0000 (19:46 +0100)]
[libc++][format] Addresses LWG3833.
LWG3833 Remove specialization template<size_t N> struct formatter<const charT[N], charT>
Depends on D143845
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D143850
Mark de Wever [Mon, 6 Feb 2023 20:43:35 +0000 (21:43 +0100)]
[libc++] Addresses LWG3103.
LWG3103 Errors in taking subview of span should be ill-formed where possible
Note that the real work was already done before, including tests.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D143432
Mark de Wever [Tue, 21 Feb 2023 19:09:21 +0000 (20:09 +0100)]
[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
Craig Topper [Sat, 4 Mar 2023 06:15:32 +0000 (22:15 -0800)]
[LoopInterchange] Remove unused RecurrenceDescriptor object. NFC
Joyce Brum [Sat, 4 Mar 2023 05:34:25 +0000 (21:34 -0800)]
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
Med Ismail Bennani [Sat, 4 Mar 2023 03:44:44 +0000 (19:44 -0800)]
[lldb] Simplify error string in ScriptedInterface (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
LLVM GN Syncbot [Sat, 4 Mar 2023 03:33:20 +0000 (03:33 +0000)]
[gn build] Port
3014a1c5a130
Med Ismail Bennani [Fri, 3 Mar 2023 20:35:42 +0000 (12:35 -0800)]
[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>
Med Ismail Bennani [Fri, 17 Feb 2023 01:34:37 +0000 (17:34 -0800)]
[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>
Med Ismail Bennani [Sat, 4 Mar 2023 03:30:56 +0000 (19:30 -0800)]
[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>
Med Ismail Bennani [Thu, 16 Feb 2023 23:15:52 +0000 (15:15 -0800)]
[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>
Med Ismail Bennani [Fri, 3 Mar 2023 23:17:59 +0000 (15:17 -0800)]
[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>
Med Ismail Bennani [Fri, 3 Mar 2023 23:27:07 +0000 (15:27 -0800)]
[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>
Med Ismail Bennani [Tue, 31 Jan 2023 00:53:39 +0000 (16:53 -0800)]
[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>
Med Ismail Bennani [Sat, 4 Mar 2023 02:52:15 +0000 (18:52 -0800)]
[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>
Derek Schuff [Thu, 2 Mar 2023 23:52:25 +0000 (15:52 -0800)]
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
Jacques Pienaar [Sat, 4 Mar 2023 01:06:48 +0000 (17:06 -0800)]
[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
isuckatcs [Fri, 10 Feb 2023 17:07:31 +0000 (18:07 +0100)]
[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
Maksim Sabianin [Fri, 3 Mar 2023 23:20:27 +0000 (15:20 -0800)]
[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
Keith Smiley [Fri, 3 Mar 2023 21:27:03 +0000 (13:27 -0800)]
[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 https://github.com/llvm/llvm-project/commit/
f3994e4dfa0214b2a09a0e327ba37e6b38bbcdb3
Fixes https://github.com/llvm/llvm-project/issues/61031
Differential Revision: https://reviews.llvm.org/D145273
LLVM GN Syncbot [Fri, 3 Mar 2023 23:01:08 +0000 (23:01 +0000)]
[gn build] Port
0eb59cab95a0
Matt Arsenault [Thu, 2 Mar 2023 09:44:05 +0000 (05:44 -0400)]
APFloat: Add classify
Matt Arsenault [Fri, 24 Feb 2023 22:27:40 +0000 (18:27 -0400)]
Attributor: Fix typos
Matt Arsenault [Fri, 3 Mar 2023 22:50:34 +0000 (18:50 -0400)]
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)
Matt Arsenault [Thu, 2 Mar 2023 09:47:52 +0000 (05:47 -0400)]
ADT: Move some FPClassTest utility functions out of instcombine
Matt Arsenault [Fri, 24 Feb 2023 14:35:49 +0000 (10:35 -0400)]
ADT: Move FPClassTest printing functions to common place
Rahul Kayaith [Thu, 2 Mar 2023 21:06:44 +0000 (16:06 -0500)]
[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
David Green [Fri, 3 Mar 2023 22:00:41 +0000 (22:00 +0000)]
[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.
Keith Smiley [Fri, 3 Mar 2023 20:08:33 +0000 (12:08 -0800)]
[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
Michael Buch [Fri, 3 Mar 2023 21:40:06 +0000 (21:40 +0000)]
[lldb][test] NativePDB/ast-types: fix expected pointer format
Format changed in `
b642fd5ee250247ccefb38099169b4ee8ac4112b`
Differential Revision: https://reviews.llvm.org/D145241
Jeffrey Byrnes [Thu, 2 Mar 2023 00:29:03 +0000 (16:29 -0800)]
[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
Jay Foad [Fri, 3 Mar 2023 12:12:15 +0000 (12:12 +0000)]
[AMDGPU] Fix invalid instid value in s_delay_alu instruction
Differential Revision: https://reviews.llvm.org/D145232
Jordan Rupprecht [Fri, 3 Mar 2023 20:59:56 +0000 (12:59 -0800)]
[bazel] Fix errno dep location: libc_function_deps -> deps
Jordan Rupprecht [Fri, 3 Mar 2023 20:55:03 +0000 (12:55 -0800)]
[bazel] Add errno dep to stdlib tests
In addition run buildifier.
Argyrios Kyrtzidis [Fri, 3 Mar 2023 18:35:23 +0000 (10:35 -0800)]
[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
Fangrui Song [Fri, 3 Mar 2023 20:48:16 +0000 (12:48 -0800)]
[ELF] Add single quotes around out of range errors
to match the convention we use for other diagnostics.
Fangrui Song [Fri, 3 Mar 2023 20:35:05 +0000 (12:35 -0800)]
[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
Jessica Clarke [Fri, 3 Mar 2023 20:19:15 +0000 (20:19 +0000)]
[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.
Jessica Clarke [Fri, 3 Mar 2023 20:18:18 +0000 (20:18 +0000)]
[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.
Jessica Clarke [Fri, 3 Mar 2023 20:14:31 +0000 (20:14 +0000)]
[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.
Amir Ayupov [Fri, 3 Mar 2023 19:58:59 +0000 (11:58 -0800)]
[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
Alex Brachet [Fri, 3 Mar 2023 19:51:46 +0000 (19:51 +0000)]
[libc] Fix strspn
Alex Brachet [Fri, 3 Mar 2023 19:45:03 +0000 (19:45 +0000)]
[llvm-driver] Allow llvm driver binary to be called anything
Florian Hahn [Fri, 3 Mar 2023 19:30:30 +0000 (20:30 +0100)]
[VPlan] Add test with intrinsic without side-effects (NFC).
Extra test coverage for mayHaveSideEffects for VPWidenCallRecipe.
Philip Reames [Fri, 3 Mar 2023 19:10:26 +0000 (11:10 -0800)]
[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
Arthur Eubanks [Fri, 3 Mar 2023 17:43:53 +0000 (09:43 -0800)]
[test] Precommit test for D145210