platform/upstream/llvm.git
13 months ago[AIX][tests] Temporarily disable test index-with-module.m
Jake Egan [Fri, 16 Jun 2023 05:22:21 +0000 (01:22 -0400)]
[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.

13 months ago[CGP] Additional tests for removing operand of assume. NFC.
Serguei Katkov [Fri, 16 Jun 2023 04:12:53 +0000 (11:12 +0700)]
[CGP] Additional tests for removing operand of assume. NFC.

13 months ago[AIX] Disable test for missing DWARF section
Jake Egan [Fri, 16 Jun 2023 04:32:26 +0000 (00:32 -0400)]
[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).

13 months ago[lldb][TerminalTest] Fix assertion failure
Kazuki Sakamoto [Fri, 16 Jun 2023 00:33:36 +0000 (17:33 -0700)]
[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

13 months ago[MC][test] Add some label difference tests
Fangrui Song [Fri, 16 Jun 2023 03:40:14 +0000 (20:40 -0700)]
[MC][test] Add some label difference tests

13 months ago[RegAlloc] Simplify RegAllocEvictionAdvisor::canReassign (NFC)
Sergei Barannikov [Mon, 12 Jun 2023 02:03:21 +0000 (05:03 +0300)]
[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

13 months ago[MC] Add MCRegisterInfo::regunits for iteration over register units
Sergei Barannikov [Sun, 21 May 2023 01:28:33 +0000 (04:28 +0300)]
[MC] Add MCRegisterInfo::regunits for iteration over register units

Reviewed By: foad

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

13 months ago[MC] Merge MC[Sub,Super]RegIterator with mc_[sub,super]_reg_iterator
Sergei Barannikov [Sun, 11 Jun 2023 19:32:23 +0000 (22:32 +0300)]
[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

13 months ago[DAG] Unroll opereand when its type is illegal for ldexp.
tianleli [Fri, 16 Jun 2023 01:15:43 +0000 (09:15 +0800)]
[DAG] Unroll opereand when its type is illegal for ldexp.

Reviewed By: pengfei

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

13 months agoRevert "[CodeGen] Disable default copy ctor and copy assignment operator for class...
Bing1 Yu [Fri, 16 Jun 2023 01:42:36 +0000 (09:42 +0800)]
Revert "[CodeGen] Disable default copy ctor and copy assignment operator for class Array"

This reverts commit 466678b5202052dcd38fdfc3f764fb5d5de7c34b.

13 months ago[MC] Improve .subsection diagnostic
Fangrui Song [Fri, 16 Jun 2023 01:35:51 +0000 (18:35 -0700)]
[MC] Improve .subsection diagnostic

13 months agolldb [NFC] Add logging to Process when address masks are updated
Jason Molenda [Fri, 16 Jun 2023 00:37:42 +0000 (17:37 -0700)]
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.

13 months ago[mlir][doc] Fix the layout of the table for the tosa.cast permissible operations
Kai Sasaki [Thu, 15 Jun 2023 23:59:31 +0000 (08:59 +0900)]
[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

13 months ago[mlir][sparse] enhance element-wise fusion heuristics
Aart Bik [Thu, 15 Jun 2023 21:10:24 +0000 (14:10 -0700)]
[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

13 months ago[mlir][sparse][gpu] recognizing sddmm pattern in GPU libgen path
Kun Wu [Thu, 15 Jun 2023 23:48:06 +0000 (23:48 +0000)]
[mlir][sparse][gpu] recognizing sddmm pattern in GPU libgen path

Reviewed By: aartbik

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

13 months ago[scudo] Disable OddEvenTags by default.
Evgenii Stepanov [Wed, 14 Jun 2023 23:58:20 +0000 (16:58 -0700)]
[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

13 months ago[compiler-rt] Go back to using the 32-bit allocator for Fuchsia+RISCV64
Leonard Chan [Thu, 15 Jun 2023 23:14:05 +0000 (23:14 +0000)]
[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.

13 months ago[Sanitizers] Remove unused parameter from COMMON_INTERCEPTOR_MUNMAP_IMPL
Kirill Stoimenov [Thu, 15 Jun 2023 22:59:37 +0000 (22:59 +0000)]
[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

13 months ago[MC] Remove unneeded special cases from AttemptToFoldSymbolOffsetDifference
Fangrui Song [Thu, 15 Jun 2023 23:12:10 +0000 (16:12 -0700)]
[MC] Remove unneeded special cases from AttemptToFoldSymbolOffsetDifference

13 months ago[scudo] Do not compile timing.cpp if LLVM_LIBC_INCLUDE_SCUDO=on
Alfred Persson Forsberg [Thu, 15 Jun 2023 23:08:57 +0000 (00:08 +0100)]
[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

13 months ago[CGCall] Prune ArgStruct [-Wunused-variable]
NAKAMURA Takumi [Thu, 15 Jun 2023 23:00:00 +0000 (08:00 +0900)]
[CGCall] Prune ArgStruct [-Wunused-variable]

It has been unused since b92ccc355acb

13 months agoReland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 10:22:16 +0000 (12:22 +0200)]
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

13 months agoAdd a fatal error for debug builds when disagreement about stepping
Jason Molenda [Thu, 15 Jun 2023 22:39:01 +0000 (15:39 -0700)]
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

13 months ago[scudo] Group MappedUser/AllocatedUser into PagesInfo (NFC)
Chia-hung Duan [Thu, 8 Jun 2023 03:20:52 +0000 (03:20 +0000)]
[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

13 months ago[scudo] Group poppedBlocks/pushedBlocks into BlocksInfo (NFC)
Chia-hung Duan [Thu, 8 Jun 2023 03:20:40 +0000 (03:20 +0000)]
[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

13 months ago[llvm-cov] Normalize paths by removing dots
Oleksii Odynochenko [Thu, 15 Jun 2023 20:52:22 +0000 (13:52 -0700)]
[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

13 months ago[RISCV] Prevent vsetvli insertion from deleting some vsetvli instructions
Craig Topper [Thu, 15 Jun 2023 22:18:47 +0000 (15:18 -0700)]
[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

13 months ago[MC] Remove unneeded isUndefined() for isSymbolRefDifferenceFullyResolved. NFC
Fangrui Song [Thu, 15 Jun 2023 22:07:04 +0000 (15:07 -0700)]
[MC] Remove unneeded isUndefined() for isSymbolRefDifferenceFullyResolved. NFC

The only caller `AttemptToFoldSymbolOffsetDifference` has performed the same
checks.

13 months ago[lldb][NFCI] Remove use of ConstString from IOHandler
Alex Langford [Fri, 26 May 2023 22:50:26 +0000 (15:50 -0700)]
[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

13 months ago[lldb] Symtab::SectionFileAddressesChanged should clear the file address map instead...
Alex Langford [Fri, 9 Jun 2023 19:31:56 +0000 (12:31 -0700)]
[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

13 months ago[GlobalISel][X86] Add i128 add/sub test coverage for narrowing on x86_64 triples
Simon Pilgrim [Thu, 15 Jun 2023 21:40:42 +0000 (22:40 +0100)]
[GlobalISel][X86] Add i128 add/sub test coverage for narrowing on x86_64 triples

13 months ago[GlobalIsel][X86] Avoid IMPLICIT_DEF in irregular types for CTTZ/CTLZ legalization...
Simon Pilgrim [Thu, 15 Jun 2023 19:06:58 +0000 (20:06 +0100)]
[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

13 months ago[CUDA] Updated CUDA versions mentioned in CompileCudaWithLLVM.rst
Artem Belevich [Thu, 15 Jun 2023 21:26:21 +0000 (14:26 -0700)]
[CUDA] Updated CUDA versions mentioned in CompileCudaWithLLVM.rst

13 months ago[lldb][Android] Use a lambda for calls to ::open in RetryAfterSignal
Kazuki Sakamoto [Mon, 12 Jun 2023 15:30:45 +0000 (08:30 -0700)]
[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.
https://github.com/llvm/llvm-project/commit/0a0e411204a2baa520fd73a8d69b664f98b428ba

> 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

13 months ago[SimplifyCFG] Add textual pass params for FoldTwoEntryPHINode and SimplifyCondBranch
Arthur Eubanks [Thu, 15 Jun 2023 21:06:15 +0000 (14:06 -0700)]
[SimplifyCFG] Add textual pass params for FoldTwoEntryPHINode and SimplifyCondBranch

13 months ago[RISCV][InsertVSETVLI] Treat vmv.v.i as-if it were vmv.s.x when VL=1, and inactive...
Philip Reames [Thu, 15 Jun 2023 21:00:57 +0000 (14:00 -0700)]
[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

13 months ago[mlir][sparse] using stable_sort to make sure the compiled code are consistent betwee...
Peiming Liu [Thu, 15 Jun 2023 21:04:46 +0000 (21:04 +0000)]
[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

13 months ago[mlir][sparse] proper in-place SDDMM with spy function
Aart Bik [Wed, 14 Jun 2023 22:18:00 +0000 (15:18 -0700)]
[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

13 months ago[SimplifyCFG] Check optforfuzzing attribute during in the pass implementation
Arthur Eubanks [Thu, 15 Jun 2023 20:55:42 +0000 (13:55 -0700)]
[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.

13 months ago[MC] Remove an unneeded special case from MCObjectStreamer::flushPendingLabels
Fangrui Song [Thu, 15 Jun 2023 20:52:20 +0000 (13:52 -0700)]
[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.

13 months ago[libc][obvious] Actually return the value from `malloc` for NVPTX
Joseph Huber [Thu, 15 Jun 2023 20:12:10 +0000 (15:12 -0500)]
[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

13 months ago[Bazel][mlir][tosa] Fix for 86c4972f5f6759b0ba85c568d934f9b8db8875a2
Pranav Kant [Thu, 15 Jun 2023 19:50:08 +0000 (19:50 +0000)]
[Bazel][mlir][tosa] Fix for 86c4972f5f6759b0ba85c568d934f9b8db8875a2

13 months ago[ARM] Fix for invalid register in ReplaceConstByVPNOTs
David Green [Thu, 15 Jun 2023 19:46:20 +0000 (20:46 +0100)]
[ARM] Fix for invalid register in ReplaceConstByVPNOTs

This ensures a removed register does not get reused as we replace constant vpt
values.

13 months ago[M68k] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 19:35:06 +0000 (12:35 -0700)]
[M68k] Use parseOptionalToken. NFC

13 months ago[CSKY] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 19:31:14 +0000 (12:31 -0700)]
[CSKY] Use parseOptionalToken. NFC

Many code paths are untested.
Some "expected ..." messages are adjusted, otherwise NFC.

13 months ago[gn build] Port 3a7876f6e2b0
LLVM GN Syncbot [Thu, 15 Jun 2023 19:11:21 +0000 (19:11 +0000)]
[gn build] Port 3a7876f6e2b0

13 months ago[BOLT] Sort BranchData in DataAggregator
Amir Ayupov [Thu, 15 Jun 2023 19:08:07 +0000 (12:08 -0700)]
[BOLT] Sort BranchData in DataAggregator

Align perf reader to fdata behavior by sorting BranchData after reading samples,
in the same way as DataReader:
https://github.com/llvm/llvm-project/blob/20c66a0c66340f44f04b6526e45bcc5d872d480a/bolt/lib/Profile/DataReader.cpp#L1239

Namely, that order affects CallSiteInfo annotations which determine the
construction order of CallGraph, which in turn affects function reordering.

Reviewed By: #bolt, rafauler

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

13 months agoRecommit "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for...
Craig Topper [Thu, 15 Jun 2023 19:03:25 +0000 (12:03 -0700)]
Recommit "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for VP_SIGN/ZERO_EXTEND."

I have fixed an existing DAGCombiner bug that caused the previous assertion failure.
See 7163539466d7e8930416e55dd9fd29891f8239f2.

Original message

We don't have VP_ANY_EXTEND or VP_SIGN_EXTEND_INREG yet so I've
deviated a little from the non-VP lowering.

My goal was to fix the crashes that occurs on these test cases without this patch.

Reviewed By: fakepaper56

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

13 months ago[LoongArch] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 19:01:16 +0000 (12:01 -0700)]
[LoongArch] Use parseOptionalToken. NFC

13 months agoFix MLIR build with SHARED_LIBS=ON, add missing cmake dependency
Mehdi Amini [Thu, 15 Jun 2023 18:57:35 +0000 (20:57 +0200)]
Fix MLIR build with SHARED_LIBS=ON, add missing cmake dependency

13 months ago[Xtensa] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 18:51:52 +0000 (11:51 -0700)]
[Xtensa] Use parseOptionalToken. NFC

13 months ago[DAGCombiner] When combining (sext_inreg (zext X), VT) -> (sext X) don't pass along...
Craig Topper [Thu, 15 Jun 2023 18:42:21 +0000 (11:42 -0700)]
[DAGCombiner] When combining (sext_inreg (zext X), VT) -> (sext X) don't pass along the sext_inreg VT.

ISD::SIGN_EXTEND is only supposed to have one operand, but we
were creating it with 2 operands.

Since we basically never check for extra operands this went
unnoticed.

13 months agoFix test breakage in 879e88693338657aec092db749ddfcb582c65491.
Zequan Wu [Thu, 15 Jun 2023 18:45:19 +0000 (14:45 -0400)]
Fix test breakage in 879e88693338657aec092db749ddfcb582c65491.

13 months ago[libc++][NFC] Reformat params.py
Louis Dionne [Tue, 13 Jun 2023 17:44:51 +0000 (10:44 -0700)]
[libc++][NFC] Reformat params.py

After the Black reformatting changes, the code became pretty hard to
read and inconsistently formatted. This fixes that.

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

13 months ago[MSP430] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 18:45:22 +0000 (11:45 -0700)]
[MSP430] Use parseOptionalToken. NFC

13 months ago[mlir][tosa] Improve lowering support for tosa.concat
Spenser Bauman [Thu, 15 Jun 2023 18:22:53 +0000 (11:22 -0700)]
[mlir][tosa] Improve lowering support for tosa.concat

The existing lowering for tosa.concat fails in some instances when the
output shape contains more information the input shapes. The result is
an illegal tensor.empty operation.

This change bases the output shape on the original tosa.concat
operation, while querying the input tensor shapes to build the slicing
operations.

Reviewed By: rsuderman

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

13 months ago[RISCV] Use parseOptionalToken. NFC
Fangrui Song [Thu, 15 Jun 2023 18:35:00 +0000 (11:35 -0700)]
[RISCV] Use parseOptionalToken. NFC

13 months ago[libc] Disable the strtod and strtold tests on NVPTX
Joseph Huber [Thu, 15 Jun 2023 18:00:45 +0000 (13:00 -0500)]
[libc] Disable the strtod and strtold tests on NVPTX

These tests have a single line that fails with a value off-by-one, see
https://lab.llvm.org/buildbot/#/builders/46/builds/50055/steps/12/logs/stdio .
Disable these for now so we can figure out what the error is later.

Reviewed By: lntue

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

13 months ago[libc++][PSTL] Implement std::is_partitioned
Nikolas Klauser [Tue, 13 Jun 2023 17:50:38 +0000 (10:50 -0700)]
[libc++][PSTL] Implement std::is_partitioned

Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

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

13 months ago[AMDGPU] Fix VOPD dependency checks during combine
Stanislav Mekhanoshin [Wed, 14 Jun 2023 18:37:44 +0000 (11:37 -0700)]
[AMDGPU] Fix VOPD dependency checks during combine

Check superreg/subreg defs of an instruction when checking for
dependencies. This may cause some regressions, but better be
safe than sorry. Changed tests are affected because of the
implicit-defs of the superregs.

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

13 months ago[mlir][linalg] Fix linalg.conv vectorization for mixed int-fp types
Rob Suderman [Thu, 15 Jun 2023 17:53:28 +0000 (10:53 -0700)]
[mlir][linalg] Fix linalg.conv vectorization for mixed int-fp types

We always assume mixed same type values. Instead of ExtF or ExtSI, we
need SIToFp when the values must be promoted.

Reviewed By: dcaballe

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

13 months ago[libc++] Add tests to make sure that stable algorithms work without memory available
Nikolas Klauser [Thu, 15 Jun 2023 15:40:42 +0000 (08:40 -0700)]
[libc++] Add tests to make sure that stable algorithms work without memory available

Reviewed By: #libc, ldionne

Spies: power-llvm-team, ldionne, libcxx-commits, arichardson, mstorsjo

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

13 months ago[lldb] Introduce DynamicRegisterInfo::CreateFromDict
Alex Langford [Fri, 9 Jun 2023 23:27:49 +0000 (16:27 -0700)]
[lldb] Introduce DynamicRegisterInfo::CreateFromDict

I want to add some error handling to DynamicRegisterInfo because there
are many operations that can fail and many of these operations do not
give meaningful information back to the caller.

To begin that process, I want to add a static method that is responsible
for creating a DynamicRegisterInfo from a StructuredData::Dictionary
(and ArchSpec). This is meant to replace the equivalent constructor
because constructors are ill-equipped to perform error handling.

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

13 months ago[MLIR][Tosa] Pass encoding through `tosa-to-linalg`
rikhuijzer [Thu, 15 Jun 2023 16:42:17 +0000 (18:42 +0200)]
[MLIR][Tosa] Pass encoding through `tosa-to-linalg`

As pointed out by @Sinclair-Dee in
https://github.com/llvm/llvm-project/issues/62304, the `tosa-to-linalg`
conversion ignored the `encoding` attribute.

Also, this patch avoids an assertion error crash on unranked tensors.
Instead, the conversion now throws a "failed to legalize" error.

Fixes #62304 and fixes #63165.

Reviewed By: mehdi_amini

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

13 months ago[mlir][sparse][gpu] enable sm80+ sparsity integration test only when explicitly set
Kun Wu [Thu, 15 Jun 2023 17:05:37 +0000 (17:05 +0000)]
[mlir][sparse][gpu] enable sm80+ sparsity integration test only when explicitly set

Reviewed By: aartbik

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

13 months ago[6/6][Clang][RISCV] Replace indexed segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 09:49:24 +0000 (02:49 -0700)]
[6/6][Clang][RISCV] Replace indexed segment store with tuple type interfaces

Depends on D152138.

This is the 6th commit of the patch-set.

This patch makes the indexed segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[5/6][Clang][RISCV] Replace indexed segment load with tuple type interfaces
eopXD [Mon, 5 Jun 2023 09:22:30 +0000 (02:22 -0700)]
[5/6][Clang][RISCV] Replace indexed segment load with tuple type interfaces

Depends on D152137.

This is the 5th commit of the patch-set.

This patch makes the indexed segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[4/6][Clang][RISCV] Replace strided segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 08:50:11 +0000 (01:50 -0700)]
[4/6][Clang][RISCV] Replace strided segment store with tuple type interfaces

Depends on D152136.

This is the 4th commit of the patch-set.

This patch makes the strided segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[3/6][Clang][RISCV] Replace strided segment load with tuple type interfaces
eopXD [Mon, 5 Jun 2023 08:39:21 +0000 (01:39 -0700)]
[3/6][Clang][RISCV] Replace strided segment load with tuple type interfaces

Depends on D152135.

This is the 3rd commit of the patch-set.

This patch makes the strided segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[2/6][Clang][RISCV] Replace unit-stride segment store with tuple type interfaces
eopXD [Mon, 5 Jun 2023 07:57:51 +0000 (00:57 -0700)]
[2/6][Clang][RISCV] Replace unit-stride segment store with tuple type interfaces

Depends on D152134.

This is the 2nd commit of the patch-set.

This patch makes the unit-stride segment store intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months ago[1/6][Clang][RISCV] Replace unit-stride (fault-first) segment load with tuple type...
eopXD [Mon, 5 Jun 2023 07:46:20 +0000 (00:46 -0700)]
[1/6][Clang][RISCV] Replace unit-stride (fault-first) segment load with tuple type interfaces

Depends on D152079.

This patch-set aims to replace the existing segment load/store
intrinsics with tuple-type segment load/store intrinsics. That is, we
are removing in the segment load/store intrinsics.

This is the 1st commit of the patch-set.

This patch makes the unit-stride segment load intrinsics and
unit-stride fault-first segment load intrinsics to use tuple
types.

Reviewed By: rogfer01

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

13 months agoRevert "Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local impor...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 17:36:36 +0000 (19:36 +0200)]
Revert "Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)""

This reverts commit fcc3981626821addc6c77b98006d02030b8ceb7f,
since Bitcode-upgrading code doesn't seem to be deterministic.

13 months ago[ELF] << >>: make RHS less than 64
Fangrui Song [Thu, 15 Jun 2023 17:34:33 +0000 (10:34 -0700)]
[ELF] << >>: make RHS less than 64

The left/right shift linker script operators may trigger UB.
E.g. in linkerscript/end-overflow-check.test, the initial REGION1__PADDED_SR_SHIFT is
uint64_t(-3), cause the following expression to trigger an out-of-range shift in
a ubsan build of lld.

    REGION1__PADDED_SR_SIZE = MAX(1 << REGION1__PADDED_SR_SHIFT, 32);

Protect such UBs by making RHS less than 64.

13 months ago[mlir][sparse] merger extension to support sparsifying arith::CmpI/CmpF operation
Peiming Liu [Mon, 12 Jun 2023 21:47:26 +0000 (21:47 +0000)]
[mlir][sparse] merger extension to support sparsifying arith::CmpI/CmpF operation

Reviewed By: aartbik

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

13 months ago[InstCombine] Verify CmpInst is equality in `foldICmpPow2Test`; PR63327
Noah Goldstein [Thu, 15 Jun 2023 16:37:33 +0000 (11:37 -0500)]
[InstCombine] Verify CmpInst is equality in `foldICmpPow2Test`; PR63327

When D152728 hoisted the code to a helper function, it moved the call
to the helper outside of `foldICmpEquality`, so an equality check is
needed in the helper.

Reviewed By: nikic, fhahn

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

13 months agoRevert "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for...
Alan Zhao [Thu, 15 Jun 2023 17:20:03 +0000 (10:20 -0700)]
Revert "[SelectionDAG][RISCV] Add very basic PromoteIntegerResult/Op support for VP_SIGN/ZERO_EXTEND."

This reverts commit 6bf79fb09416b02b3f8589a4998610d70c185dae.

Reason: causes Clang to crash during Chrome debug builds: https://crbug.com/1455144

13 months agoAMDGPU: Add baseline test for propagating amdgpu-waves-per-eu
Matt Arsenault [Sat, 3 Jun 2023 20:44:19 +0000 (16:44 -0400)]
AMDGPU: Add baseline test for propagating amdgpu-waves-per-eu

13 months agoFix NATVIS for some Clang types
Aaron Ballman [Thu, 15 Jun 2023 16:59:36 +0000 (12:59 -0400)]
Fix NATVIS for some Clang types

This updates the definition for ExplicitSpecifier and
DeclarationNameExtra.

13 months agoCleanup the MLIR LSP doc to remove references to the passes
Mehdi Amini [Thu, 15 Jun 2023 16:42:58 +0000 (18:42 +0200)]
Cleanup the MLIR LSP doc to remove references to the passes

The MLIR LSP server initially had plans to support running passes from the
client, but this was never implemented. The doc unnecessarily advise to
register passes and makes reference to LSP server having some interaction
with passes.

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

13 months agoAdd dsymutil dwarf5 tests for darwin
Shubham Sandeep Rastogi [Thu, 1 Jun 2023 20:46:54 +0000 (13:46 -0700)]
Add dsymutil dwarf5 tests for darwin

The first test, dwarf5-macho.test checks to make sure that dsymutil
generates the correct headers and sections for a macho binary with
DWARF v5 in it.

The second test, dwarf5-dwarf4-combination-macho.test checks that
dsymutil generates the correct headers and sections for a macho binary
with which was linked with one object file with DWARF v4 and the other
with DWARF v5 in it.

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

13 months ago[DebugInfo] Fix detection of hash collision in Apple Accel tables
Felipe de Azevedo Piovezan [Fri, 9 Jun 2023 21:40:32 +0000 (17:40 -0400)]
[DebugInfo] Fix detection of hash collision in Apple Accel tables

The current implementation was ignoring the possibility of collisions.

Differential Revision: D152586

13 months ago[lld-macho] Switch to new tool ID
Keith Smiley [Wed, 14 Jun 2023 15:51:30 +0000 (08:51 -0700)]
[lld-macho] Switch to new tool ID

As of Xcode 15 there is now a tool ID for LLD, likely driven by Apple's
tests with using LLD for their CAS work in clang. This updates LLD to
use the correct ID, and updates the object library so that llvm-objdump
prints it correctly.

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

13 months agoRevert "[DebugInfo] Fix detection of hash collision in Apple Accel tables"
Felipe de Azevedo Piovezan [Thu, 15 Jun 2023 16:36:58 +0000 (12:36 -0400)]
Revert "[DebugInfo] Fix detection of hash collision in Apple Accel tables"

Committed a slightly older patch without the proper link to the review.

This reverts commit 42874f66475548541cd871d5790116b2bc68b89a.

13 months ago[DebugInfo] Fix detection of hash collision in Apple Accel tables
Felipe de Azevedo Piovezan [Fri, 9 Jun 2023 21:40:32 +0000 (17:40 -0400)]
[DebugInfo] Fix detection of hash collision in Apple Accel tables

The current implementation was ignoring the possibility of collisions.

13 months ago[gn] port 05634f7346a5 (bolt -> JITLink)
Nico Weber [Thu, 15 Jun 2023 16:16:11 +0000 (09:16 -0700)]
[gn] port 05634f7346a5 (bolt -> JITLink)

13 months ago[gn] port 98f70e94e0592
Nico Weber [Thu, 15 Jun 2023 16:22:12 +0000 (09:22 -0700)]
[gn] port 98f70e94e0592

13 months ago[gn] port 80e4ccab794c
Nico Weber [Thu, 15 Jun 2023 16:15:46 +0000 (09:15 -0700)]
[gn] port 80e4ccab794c

13 months agoReland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 16:12:00 +0000 (18:12 +0200)]
Reland "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

Run split-dwarf-local-impor3.ll only on x86_64-linux.

13 months ago[libc++][modules] Adds the C++23 std module.
Mark de Wever [Tue, 28 Feb 2023 19:29:26 +0000 (20:29 +0100)]
[libc++][modules] Adds the C++23 std module.

The patch is based on D144994.

D151030 added the module definitions for the module std.
This patch wires in the module and enables the basic testing.

Some notable features are missing:
- There is no test that libc++ can be fully imported as a module.
- This lacks the parts for the std.compat module.
- The module is not shipped with libc++.

Implements parts of
- P2465R3 Standard Library Modules std and std.compat

Reviewed By: ldionne, aaronmondal, #libc

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

13 months ago[libc++][modules] Update the .cppm files.
Mark de Wever [Thu, 15 Jun 2023 16:12:06 +0000 (18:12 +0200)]
[libc++][modules] Update the .cppm files.

There are some minor fixes in the definiton and it is synced with
upstream changes.

This has been reviewed as part of D151814.

13 months agoRevert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported...
Vladislav Dzhidzhoev [Thu, 15 Jun 2023 16:04:32 +0000 (18:04 +0200)]
Revert "[DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)"

This reverts commit d80fdc6fc1a6e717af1bcd7a7313e65de433ba85.
split-dwarf-local-impor3.ll fails because of an issue with
Dwo sections emission on Windows platform.

13 months ago[libc] Export GPU extensions to `libc` for external use
Joseph Huber [Tue, 6 Jun 2023 16:10:44 +0000 (11:10 -0500)]
[libc] Export GPU extensions to `libc` for external use

The GPU port of the LLVM C library needs to export a few extensions to
the interface such that users can interface with it. This patch adds the
necessary logic to define a GPU extension. Currently, this only exports
a `rpc_reset_client` function. This allows us to use the server in
D147054 to set up the RPC interface outside of `libc`.

Depends on https://reviews.llvm.org/D147054

Reviewed By: sivachandra

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

13 months ago[libc] Begin implementing a library for the RPC server
Joseph Huber [Mon, 5 Jun 2023 20:32:38 +0000 (15:32 -0500)]
[libc] Begin implementing a library for the RPC server

This patch begins providing a generic static library that wraps around
the raw `rpc.h` interface. As discussed in the corresponding RFC,
https://discourse.llvm.org/t/rfc-libc-exporting-the-rpc-interface-for-the-gpu-libc/71030,
we want to begin exporting RPC services to external users. In order to
do this we decided to not expose the `rpc.h` header by wrapping around
its functionality. This is done with a C-interface as we make heavy use
of callbacks and allows us to provide a predictable interface.

Reviewed By: JonChesterfield, sivachandra

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

13 months ago[Hexagon] Do not track reserved regs in RDF optimizations
Krzysztof Parzyszek [Tue, 6 Jun 2023 14:08:08 +0000 (07:08 -0700)]
[Hexagon] Do not track reserved regs in RDF optimizations

13 months ago[libc++] Merge _LIBCPP_FUNC_VIS, _LIBCPP_TYPE_VIS and _LIBCPP_EXCEPTION_ABI into...
Nikolas Klauser [Wed, 14 Jun 2023 17:17:50 +0000 (10:17 -0700)]
[libc++] Merge _LIBCPP_FUNC_VIS, _LIBCPP_TYPE_VIS and _LIBCPP_EXCEPTION_ABI into _LIBCPP_EXPORTED_FROM_ABI

These macros are always defined identically, so we can simplify the code a bit by merging them.

Reviewed By: ldionne, #libc

Spies: libcxx-commits, krytarowski, smeenai

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

13 months agoHIP: Add a few more cmath header tests
Matt Arsenault [Tue, 13 Jun 2023 23:05:54 +0000 (19:05 -0400)]
HIP: Add a few more cmath header tests

13 months agoOpenMP: Add a new test for constantexpr evaluation of math headers
Matt Arsenault [Tue, 13 Jun 2023 22:18:32 +0000 (18:18 -0400)]
OpenMP: Add a new test for constantexpr evaluation of math headers

13 months ago[libc++abi] Avoid including source files into unittest_demangle
Louis Dionne [Tue, 13 Jun 2023 21:56:08 +0000 (14:56 -0700)]
[libc++abi] Avoid including source files into unittest_demangle

That is not necessary to test what we're testing, and in fact including
abort_message.cpp into that file caused some link errors if we didn't
link some of the dependencies of libc++abi directly into the test.

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

13 months ago[AArch64] Address post-commit comments from D150482.
Florian Hahn [Thu, 15 Jun 2023 15:38:09 +0000 (16:38 +0100)]
[AArch64] Address post-commit comments from D150482.

Address @v01dXYZ's comments, thanks!

13 months agoReland "[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size."
Zequan Wu [Thu, 15 Jun 2023 15:33:02 +0000 (11:33 -0400)]
Reland "[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size."

This reland 5d54213ee557a86fae82af0f75498adf02f24e82 with fixes.