464673 Commits

Author SHA1 Message Date
Pavel Labath
c30853460d [lldb] Rate limit progress reports -- different approach [WIP-ish]
Have the Progress class spawn a thread to periodically send progress
reports.

The reporting period could be made configurable, but for now I've
hardcoded it to 100ms. (This is the main WIP part)

It could be argued that creating a thread for progress reporting adds
overhead, but I would counter that by saying "If the task is so fast
that creating a thread noticably slows it down, then it really doesn't
need progress reporting".

For me, this speeds up DWARF indexing by about 1.5% (which is only
slightly above the error bars), but I expect it will have a much bigger
impact in situations where printing a single progress update takes a
nontrivial amount of time.

Differential Revision: https://reviews.llvm.org/D152364
2023-06-16 08:28:29 +02:00
Fangrui Song
11ebe3d906 [RISCV] relaxDwarfCallFrameFragment: remove unneeded relocations for relaxation
If `evaluateAsAbsolute(Value, Layout.getAssembler())` returns true, we
know the address delta is a constant and can suppress relocations
(usually SET6/SUB6).

While here, replace two evaluateKnownAbsolute calls (subtle; avoid if possible)
with evaluateAsAbsolute.
2023-06-15 23:26:25 -07:00
Jaroslav Sevcik
07b9e6ed0d [lldb] Fix handling of cfi_restore in the unwinder
Currently, lldb's unwinder ignores cfi_restore opcodes for registers
that are not set in the first row of the unwinding info. This prevents
unwinding of failed assertion in Chrome/v8 (https://github.com/v8/v8).
The attached test is an x64 copy of v8's function that failed to unwind
correctly (V8_Fatal).

This patch changes handling of cfi_restore to reset the location if
the first unwind table row does not map the restored register.

Differential Revision: https://reviews.llvm.org/D153043
2023-06-16 08:01:29 +02:00
Carlos Alberto Enciso
c0a986a60f [LICM] Sunk instructions with invalid source location.
Building the given test case with 'clang -O2 -g' the call to
'getInOrder' is sunk out of the loop by LICM, but the source
location is not dropped.

Reviewed By: aprantl, fdeazeve

Differential Revision: https://reviews.llvm.org/D152691
2023-06-16 06:25:27 +01:00
Jake Egan
985daceac9 [AIX][tests] Temporarily disable test index-with-module.m
This test is failing on AIX due to patch D151938. Disable it for now to get the bot green while we investigate.
2023-06-16 01:24:19 -04:00
Serguei Katkov
d119c386cd [CGP] Additional tests for removing operand of assume. NFC. 2023-06-16 11:52:46 +07:00
Jake Egan
f4b58f8d22 [AIX] Disable test for missing DWARF section
This new test is failing on AIX due to an unsupported DWARF section, so disable it (same rationale as patch D111336).
2023-06-16 00:35:00 -04:00
Kazuki Sakamoto
75e93ec720 [lldb][TerminalTest] Fix assertion failure
D152712 replaced `llvm::sys::RetryAfterSignal(-1, ::open)` with
`FileSystem::Instance().Open` for bionic in PseudoTerminal::OpenSecondary, and
FileSystem::Instance() is failing with assertion on arm Linux.

The assertion should be FileSystem re-initialization check, therefore the
hypothesis is that TerminalTest tests are initializing FileSystem instance
repeatedly.

Use SubsystemRAII<FileSystem> to ensure tearing down the FileSystem instance.

Differential Revision: https://reviews.llvm.org/D153091
2023-06-15 21:24:40 -07:00
Fangrui Song
96ed1bda29 [MC][test] Add some label difference tests 2023-06-15 20:40:14 -07:00
Sergei Barannikov
b70b96c0f5 [RegAlloc] Simplify RegAllocEvictionAdvisor::canReassign (NFC)
Use range-based for loops.
The return type has been changed to bool because the method is only
used in boolean contexts.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D152665
2023-06-16 05:39:56 +03:00
Sergei Barannikov
aa2d0fbc30 [MC] Add MCRegisterInfo::regunits for iteration over register units
Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D152098
2023-06-16 05:39:50 +03:00
Sergei Barannikov
6edfa6184a [MC] Merge MC[Sub,Super]RegIterator with mc_[sub,super]_reg_iterator
Turn MC*RegIterator into fully qualified iterators by deriving them from
iterator_adaptor_base. This makes mc_*_reg iterators redundant.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D152655
2023-06-16 05:39:44 +03:00
tianleli
8561283b10 [DAG] Unroll opereand when its type is illegal for ldexp.
Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D152997
2023-06-16 09:44:04 +08:00
Bing1 Yu
c7cbf563ce Revert "[CodeGen] Disable default copy ctor and copy assignment operator for class Array"
This reverts commit 466678b5202052dcd38fdfc3f764fb5d5de7c34b.
2023-06-16 09:42:36 +08:00
Fangrui Song
6746602bc6 [MC] Improve .subsection diagnostic 2023-06-15 18:35:51 -07:00
Jason Molenda
538df1d8a2 lldb [NFC] Add logging to Process when address masks are updated
To aid in integration testing/debugging. Verifying that the address
mask/addressable bits values from different sources are correctly
registered by lldb.
2023-06-15 17:38:45 -07:00
Kai Sasaki
43687da7a0
[mlir][doc] Fix the layout of the table for the tosa.cast permissible operations
We can make the table for the `tosa.cast` permissible operations readable by utilizing the markdown table format.

{F27924602}

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D152992
2023-06-16 08:59:40 +09:00
Aart Bik
5c03c056e0 [mlir][sparse] enhance element-wise fusion heuristics
We prevent merging a sparse-in/dense-out with dense-in
kernels because the result is usuall not sparsifiable.
Dense kernels and sparse kernels are still fused, obviously.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D153077
2023-06-15 16:48:40 -07:00
Kun Wu
9167dd46ba [mlir][sparse][gpu] recognizing sddmm pattern in GPU libgen path
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D151582
2023-06-15 23:48:11 +00:00
Evgenii Stepanov
ed552f2151 [scudo] Disable OddEvenTags by default.
Scudo has zero-tagged headers between any two allocation that will catch
a linear buffer overflow of up to 16 bytes. OddEvenTags extends this
guarantee to one chunk of the given SizeClass at the cost of the reduced
entropy for all heap tags (i.e. lower chance to catch use-after-free and
large overflows).

Given that the first 16 bytes are already deterministic, I feel this is
a bad tradeoff.

Differential Revision: https://reviews.llvm.org/D152984
2023-06-15 16:36:27 -07:00
Leonard Chan
17623e96b5 [compiler-rt] Go back to using the 32-bit allocator for Fuchsia+RISCV64
Due to logic in the 64-bit allocator, the smallest allocation we can
zx_vmar_allocate is 2^37 bytes, but this is too large to allocate for
the standalone lsan allocator on a 39-bit VMA. This leads to the
zx_vmar_allocate call when initially setting up the allocator to fail.
This is similar to what android experiences on a 64-bit system with a
small vma. (See sanitizer_allocator_test.cpp).

This effectively reverts f6c4808d95221a5838e14474d95c6fe85bb1488a and
has Fuchsia use the 32-bit allocator for RISCV.
2023-06-15 23:29:06 +00:00
Kirill Stoimenov
7ebfc36f7e [Sanitizers] Remove unused parameter from COMMON_INTERCEPTOR_MUNMAP_IMPL
This was a result of copy/paste from the MMAP interceptor which uses the parameter to swtich between mmap and mmap64.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D152980
2023-06-15 23:19:04 +00:00
Fangrui Song
4bdc7f7a33 [MC] Remove unneeded special cases from AttemptToFoldSymbolOffsetDifference 2023-06-15 16:12:10 -07:00
Alfred Persson Forsberg
63eb7c4e66 [scudo] Do not compile timing.cpp if LLVM_LIBC_INCLUDE_SCUDO=on
Temporary hack until LLVM libc supports inttypes.h print format macros

timing.h uses the PRId64 macro which is not included in llvm libc yet

Bug: https://github.com/llvm/llvm-project/issues/63317

Reviewed By: michaelrj, thesamesam, Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D152979
2023-06-16 00:09:39 +01:00
NAKAMURA Takumi
0cbbfb8c2e [CGCall] Prune ArgStruct [-Wunused-variable]
It has been unused since b92ccc355acb
2023-06-16 08:00:57 +09:00
Vladislav Dzhidzhoev
06a0ae6524 Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"
Got rid of non-determinism in MetadataLoader.cpp.

Authored-by: Kristina Bessonova <kbessonova@accesssoftek.com>

Differential Revision: https://reviews.llvm.org/D144004
2023-06-16 00:49:59 +02:00
Jason Molenda
6a8e2538af Add a fatal error for debug builds when disagreement about stepping
On one CI bot we're seeing a failure where the kernel reports that
we have completed an instruction step (via a mach exception) and
lldb doesn't think the thread was doing an instruction step.  It
takes the conservative approach of stopping at this point, breaking
tests.

This patch adds an llvm fatal error for debug builds where it will
log the state of the thread and the AArch64 ESR, to confirm what
the hardware reported as the exception so we can double check the
kernel's interpretation.

I'll change this to an lldbassert without the runtime details in
the string once we have an idea what is happening.  the hope is
that this will get hit on the CI bot soon.

Differential Revision: https://reviews.llvm.org/D153079
2023-06-15 15:41:37 -07:00
Chia-hung Duan
29aa587f1a [scudo] Group MappedUser/AllocatedUser into PagesInfo (NFC)
Create a new PagesInfo to contain all the information about pages. This
is the preparation of adding new lock for page operations.

Note that primary32 hasn't switched to MemMap. Will add PagesInfo later
when we move to MemMap in primary32.

Differential Revision: https://reviews.llvm.org/D149142
2023-06-15 22:38:48 +00:00
Chia-hung Duan
5beaa7339f [scudo] Group poppedBlocks/pushedBlocks into BlocksInfo (NFC)
Create a new BlocksInfo to contain a list of blocks, poppedBlocks and
pushedBlocks. This is the preparation of adding new lock for operations
on freelist.

Differential Revision: https://reviews.llvm.org/D149143
2023-06-15 22:38:48 +00:00
Oleksii Odynochenko
24563b8d26 [llvm-cov] Normalize paths by removing dots
We were producing inconsistent results when a file appeared multiple
times in gcno/gcda files if the instances had differing relative paths.

This patch unifies filenames, so coverage results are merged.

Patch by Oleksii Odynochenko. Thanks!

Differential Revision: https://reviews.llvm.org/D152453
2023-06-15 15:35:13 -07:00
Craig Topper
354530fe19 [RISCV] Prevent vsetvli insertion from deleting some vsetvli instructions
If the result register is used, it is not safe to delete.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D153076
2023-06-15 15:18:47 -07:00
Fangrui Song
d620ba0344 [MC] Remove unneeded isUndefined() for isSymbolRefDifferenceFullyResolved. NFC
The only caller `AttemptToFoldSymbolOffsetDifference` has performed the same
checks.
2023-06-15 15:07:04 -07:00
Alex Langford
e29cc5216a [lldb][NFCI] Remove use of ConstString from IOHandler
None of these need to be in the ConstString StringPool. For the most
part they are constant strings and do not require fast comparisons.

I did change IOHandlerDelegateMultiline slightly -- specifically, the
`m_end_line` member always has a `\n` at the end of it now. This was so
that `IOHandlerGetControlSequence` can always return a StringRef. This
did require a slight change to `IOHandlerIsInputComplete` where we must
drop the newline before comparing it against the input parameter.

Differential Revision: https://reviews.llvm.org/D151597
2023-06-15 14:57:20 -07:00
Alex Langford
8fb919a115 [lldb] Symtab::SectionFileAddressesChanged should clear the file address map instead of name map
Currently, `SectionFileAddressesChanged` clears out the `name_to_index`
map and sets `m_file_addr_to_index_compute` to false. This is strange,
as these two fields are used for different purposes. What we should be
doing is clearing the file address to index mapping.

There are 2 bugs here:
1. If we call SectionFileAddressesChanged after the name indexes have
   been computed, we end up with an empty name to index map, so lookups
   will fail. This doesn't happen today because we don't initialize the
   name indexes before calling this, but this is a refactor away from
   failing in this way.
2. Because we don't clear `m_file_addr_to_index` but still set it's
   computed flag to false, it ends up with twice the amount of
   information. One entry will be correct (since it was recalculated),
   one entry will be outdated.

rdar://110192434

Differential Revision: https://reviews.llvm.org/D152579
2023-06-15 14:46:46 -07:00
Simon Pilgrim
29293e6f9d [GlobalISel][X86] Add i128 add/sub test coverage for narrowing on x86_64 triples 2023-06-15 22:40:42 +01:00
Simon Pilgrim
46b8cbbe01 [GlobalIsel][X86] Avoid IMPLICIT_DEF in irregular types for CTTZ/CTLZ legalization tests
IMPLICIT_DEF can lead to some pretty weird G_UNMERGE_VALUES of long lists of s1 values, try to use a real source value instead
2023-06-15 22:28:38 +01:00
Artem Belevich
d028188412 [CUDA] Updated CUDA versions mentioned in CompileCudaWithLLVM.rst 2023-06-15 14:27:40 -07:00
Kazuki Sakamoto
b4d710e410 [lldb][Android] Use a lambda for calls to ::open in RetryAfterSignal
lldb-server for Android does not build with NDK r21 and above due to
RetryAfterSignal and Bionic ::open mismatch.
https://github.com/llvm/llvm-project/issues/54727

Apply the LLVM patch to LLDB.
0a0e411204

> In Bionic, open can be overloaded for _FORTIFY_SOURCE support, causing
> compile errors of RetryAfterSignal due to overload resolution. Wrapping
> the call in a lambda avoids this.

Differential Revision: https://reviews.llvm.org/D152712
2023-06-15 14:24:14 -07:00
Arthur Eubanks
278d65b2cf [SimplifyCFG] Add textual pass params for FoldTwoEntryPHINode and SimplifyCondBranch 2023-06-15 14:21:24 -07:00
Philip Reames
fc9b26440d [RISCV][InsertVSETVLI] Treat vmv.v.i as-if it were vmv.s.x when VL=1, and inactive lanes are undefined
A vmv.v.i/x splats the immediate to all active lanes. For the active lanes, this is the same as vmv.s.x which inserts one scalar into the low lane. If we can ignore all the inactive lanes (because they are known undefined), then the two are semantically equivalent. We already reason about compatible VL/VTYPE combinations for vmv.s.x, apply the same logic to vmv.v.i.

Unlike a vmv.s.x, we do need to be careful not to increase LMUL. A splat instruction is probably linear in LMUL, so restrict this to LMUL1.

Differential Revision: https://reviews.llvm.org/D152845
2023-06-15 14:10:04 -07:00
Peiming Liu
4e9526b9ea [mlir][sparse] using stable_sort to make sure the compiled code are consistent between different builds configuration
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D153074
2023-06-15 21:09:35 +00:00
Aart Bik
65bfd5cb25 [mlir][sparse] proper in-place SDDMM with spy function
This specific operation matches the cuSPARSE SDDMM semantics exactly.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D152969
2023-06-15 13:59:38 -07:00
Arthur Eubanks
405f91475b [SimplifyCFG] Check optforfuzzing attribute during in the pass implementation
Instead of setting the SimplifyCFGOptions options at the beginning of the pass.

Otherwise it always gets overriden by the pass and the value in SimplifyCFGOptions is ignored.
2023-06-15 13:57:51 -07:00
Fangrui Song
acc0224104 [MC] Remove an unneeded special case from MCObjectStreamer::flushPendingLabels
We always pass a non-null F to flushPendingLabels. Wait a bit before changing
the parameter to use a reference.
2023-06-15 13:52:20 -07:00
Joseph Huber
490958b9ea [libc][obvious] Actually return the value from malloc for NVPTX
Switching to this interface we neglected to actually write the output
from the malloc call to the RPC buffer. Fix this so the tests pass
again.

Differential Revision: https://reviews.llvm.org/D153069
2023-06-15 15:13:11 -05:00
Pranav Kant
ae7e6df15f [Bazel][mlir][tosa] Fix for 86c4972f5f6759b0ba85c568d934f9b8db8875a2 2023-06-15 19:50:19 +00:00
David Green
eb35786fa2 [ARM] Fix for invalid register in ReplaceConstByVPNOTs
This ensures a removed register does not get reused as we replace constant vpt
values.
2023-06-15 20:46:20 +01:00
Fangrui Song
2991c1cd5b [M68k] Use parseOptionalToken. NFC 2023-06-15 12:35:06 -07:00
Fangrui Song
e9035ea405 [CSKY] Use parseOptionalToken. NFC
Many code paths are untested.
Some "expected ..." messages are adjusted, otherwise NFC.
2023-06-15 12:31:14 -07:00
LLVM GN Syncbot
2cd4dc5979 [gn build] Port 3a7876f6e2b0 2023-06-15 19:11:21 +00:00