platform/upstream/llvm.git
20 months ago[mlir] Introduce `replaceUsesOfWith` to `RewriterBase`
Guray Ozen [Wed, 16 Nov 2022 16:23:43 +0000 (17:23 +0100)]
[mlir] Introduce `replaceUsesOfWith` to `RewriterBase`

Finding uses of a value and replacing them with a new one is a common method. I have not seen an safe and easy shortcut that does that. This revision attempts to address that by intoroducing `replaceUsesOfWith` to `RewriterBase`.

Reviewed By: mehdi_amini

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

20 months ago[SME] Store buffer to the correct pointer when setting up lazy-save.
Sander de Smalen [Wed, 16 Nov 2022 15:03:03 +0000 (15:03 +0000)]
[SME] Store buffer to the correct pointer when setting up lazy-save.

This fixes a bug in 'allocateLazySaveBuffer' that led to the
buffer pointer being stored to the wrong address.

Reviewed By: david-arm

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

20 months ago[mlir][Linalg] Move patterns to remove dead arguments and results out of canonicaliza...
Mahesh Ravishankar [Wed, 16 Nov 2022 02:51:53 +0000 (02:51 +0000)]
[mlir][Linalg] Move patterns to remove dead arguments and results out of canonicalization.

The patterns to remove dead arguments and results of `linalg.generic`
operations are not necessarily canonicalizations. Instead a new entry
point `populateEraseUnusedOperandsAndResults` is added to allow using
these patterns when needed. The transformations that rely on this
pattern for cleanup now include these patterns explicitly.

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

20 months ago[mlir][sparse] bring CHECK tests back (but disabled)
Aart Bik [Wed, 16 Nov 2022 05:11:31 +0000 (21:11 -0800)]
[mlir][sparse] bring CHECK tests back (but disabled)

We have a strange nondeterministic failure on windows
by not getting the desired fill statement in the resulting
IR. Probably something wrong with our option passing or
pass construction?

https://github.com/llvm/llvm-project/issues/59016#issuecomment-1316410249

Reviewed By: bixia

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

20 months ago[include-cleaner] Defer decl->stdlib conversion into decl->location conversion
Kadir Cetinkaya [Wed, 16 Nov 2022 14:49:47 +0000 (15:49 +0100)]
[include-cleaner] Defer decl->stdlib conversion into decl->location conversion

We preserve decls for stdlib symbols after this patch in symbol. That
way we have a more unified view of stdlib and regular decls and can provide
reacher information in applications.

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

20 months agoGlobalISel: Fold some idempotent operations
Matt Arsenault [Wed, 16 Nov 2022 01:49:53 +0000 (17:49 -0800)]
GlobalISel: Fold some idempotent operations

This makes the existing fabs_fabs fold redundant, which
I thought was using more tablegen matching, but apparently not.
I'm not sure how to make match work with multiple opcodes. There
are a few more this could handle, but these are the ones that
legalization are more likely to introduce.

20 months ago[SLP]Fix PR58956: fix insertpoint for reduced buildvector graphs.
Alexey Bataev [Wed, 16 Nov 2022 14:30:47 +0000 (06:30 -0800)]
[SLP]Fix PR58956: fix insertpoint for reduced buildvector graphs.

If the graph is only the buildvector node without main operation, need
to inherit insrtpoint from the redution instruction. Otherwise the
compiler crashes trying to insert instruction at the entry block.

20 months ago[NFC] Fix typo in comment
zhongyunde [Wed, 16 Nov 2022 15:32:47 +0000 (23:32 +0800)]
[NFC] Fix typo in comment

Address comment in https://reviews.llvm.org/D137936

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

20 months ago[Concepts] Fix friend-checking to include NTTPs
Erich Keane [Wed, 16 Nov 2022 15:00:55 +0000 (07:00 -0800)]
[Concepts] Fix friend-checking to include NTTPs

More work for temp.friend p9, this fixes a previous bug where we didn't
properly consider a friend to depend on the enclosing template if it
only did so via an NTTP.

20 months ago[gn build] Port 332c4af35db9
LLVM GN Syncbot [Wed, 16 Nov 2022 15:19:13 +0000 (15:19 +0000)]
[gn build] Port 332c4af35db9

20 months agoRevert "[NFC] Make format() more amenable to format attributes"
Muhammad Omair Javaid [Wed, 16 Nov 2022 15:09:49 +0000 (19:09 +0400)]
Revert "[NFC] Make format() more amenable to format attributes"

This reverts commit cf239c2f1777eb94a4801a086acf1332a7d3cccf.
It has broken tools/llvm-dwarfdump/X86/simplified-template-names.s on
following buildbot:
https://lab.llvm.org/buildbot/#/builders/178/builds/3148

20 months ago[Lexer] Speedup LexTokenInternal
serge-sans-paille [Wed, 9 Nov 2022 22:13:51 +0000 (23:13 +0100)]
[Lexer] Speedup LexTokenInternal

Only reset "NeedsCleaning" flag in case of re-entrant call.
Do not needlessly blank IdentifierInfo. This information will be set
once the token type is picked.

This yields a nice 1% speedup when pre-processing sqlite amalgamation
through:

valgrind --tool=callgrind ./bin/clang -E sqlite3.c -o/dev/null

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

20 months ago[AMDGPU] Reinstate some dwordx3 tests
Jay Foad [Wed, 16 Nov 2022 14:57:01 +0000 (14:57 +0000)]
[AMDGPU] Reinstate some dwordx3 tests

20 months ago[AArch64][CodeGen] Add AArch64 support for complex deinterleaving
Nicholas Guy [Tue, 15 Nov 2022 11:58:04 +0000 (11:58 +0000)]
[AArch64][CodeGen] Add AArch64 support for complex deinterleaving

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

20 months ago[OMPT] Fix debug prefix not being defined
Joseph Huber [Wed, 16 Nov 2022 13:52:14 +0000 (07:52 -0600)]
[OMPT] Fix debug prefix not being defined

Summary:
This header file uses the `DP` prefixes but does not define
`DEBUG_PREFIX`. This patch adds a simple fix, but realistically the `DP`
system isn't ideal. Now that we have access to LLVM libraries and other
utilities we should consider rewriting all of the debugging and error
handling glue.

20 months ago[lit] Add `target=<triple>` as a feature keyword
Paul Robinson [Fri, 4 Nov 2022 13:08:35 +0000 (06:08 -0700)]
[lit] Add `target=<triple>` as a feature keyword

As proposed first in D107162 and later in discourse at
https://discourse.llvm.org/t/rfc-lits-requires-and-triples/66041

Modified a couple of lit's own tests to use this; left others as-is,
because for now triple substrings still work in UNSUPPORTED/XFAIL.

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

20 months ago[AMDGPU][GFX11] Refactor VOPD operands handling
Dmitry Preobrazhensky [Wed, 16 Nov 2022 13:26:48 +0000 (16:26 +0300)]
[AMDGPU][GFX11] Refactor VOPD operands handling

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

20 months ago[AArch64][MachineCombiner] Use MIMetadata to copy pcsections metadata to reassociated...
David Green [Wed, 16 Nov 2022 13:22:48 +0000 (13:22 +0000)]
[AArch64][MachineCombiner] Use MIMetadata to copy pcsections metadata to reassociated instructions.

D134260/D138107 exposed that the MachineCombiner was not copying
pcsections metadata where it should. This patch switches the MIBuild
methods to use MIMetadata that can copy the debug loc and pcsections at
the same time.

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

20 months ago[Libomptarget] Build plugins-nextgen/common/PluginInterface with protected visibility
Kevin Sala [Wed, 16 Nov 2022 13:11:00 +0000 (07:11 -0600)]
[Libomptarget] Build plugins-nextgen/common/PluginInterface with protected visibility

Summary:
This commit sets the default visibility of PluginInterface's symbols (in
nextgen plugins) as protected. This prevents symbols from a plugin
library to be preempted by another plugin library's symbol. It applies
the same fix introduced by D136365.

Issue reported by @ggeorgakoudis.

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

20 months ago[DAG] simplifySelect - add support for vselect(0, T, F) -> F fold
Simon Pilgrim [Wed, 16 Nov 2022 13:11:04 +0000 (13:11 +0000)]
[DAG] simplifySelect - add support for vselect(0, T, F) -> F fold

We still need to add handling for the non-zero T fold (which requires getBooleanContents handling)

20 months ago[libc][benchmark] Fix wrong BatchSize leading to data not fitting in L1.
Guillaume Chatelet [Wed, 16 Nov 2022 11:01:02 +0000 (11:01 +0000)]
[libc][benchmark] Fix wrong BatchSize leading to data not fitting in L1.

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

20 months ago[MLIR][Tensor] Clean-up `ops.mlir` test (NFC)
Lorenzo Chelini [Tue, 15 Nov 2022 09:39:07 +0000 (10:39 +0100)]
[MLIR][Tensor] Clean-up `ops.mlir` test (NFC)

Split input file was not used.

Reviewed By: springerm

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

20 months ago[AArch64] Add GPR rr instructions to isAssociativeAndCommutative
David Green [Wed, 16 Nov 2022 12:39:13 +0000 (12:39 +0000)]
[AArch64] Add GPR rr instructions to isAssociativeAndCommutative

This adds some more scalar instructions that are both associative and
commutative to isAssociativeAndCommutative, allowing the machine
combiner to reassociate them to reduce critical path length.

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

20 months ago[AArch64] Mark all instructions that read/write FPCR as doing so
John Brawn [Fri, 5 Nov 2021 10:11:00 +0000 (10:11 +0000)]
[AArch64] Mark all instructions that read/write FPCR as doing so

All instructions that can raise fp exceptions also read FPCR, with the
only other instructions that interact with it being the MSR/MRS to
write/read FPCR.

Introducing an FPCR register also requires adjusting
invalidateWindowsRegisterPairing in AArch64FrameLowering.cpp to use
the encoded value of registers instead of their enum value, as the
enum value is based on the alphabetical order of register names and
now FPCR is placed between FP and LR.

This change unfortunately means a large number of mir tests need to
be adjusted due to instructions now requiring an implicit fpcr operand
to be present.

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

20 months ago[Assignment Tracking][11/*] Update RemoveRedundantDbgInstrs
OCHyams [Wed, 16 Nov 2022 12:20:12 +0000 (12:20 +0000)]
[Assignment Tracking][11/*] Update RemoveRedundantDbgInstrs

The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

Update the RemoveRedundantDbgInstrs utility to avoid sometimes losing
information when deleting dbg.assign intrinsics.

removeRedundantDbgInstrsUsingBackwardScan - treat dbg.assign intrinsics that
are not linked to any instruction just like dbg.values. That is, in a block of
contiguous debug intrinsics, delete all other than the last definition for a
fragment. Leave linked dbg.assign intrinsics in place.

removeRedundantDbgInstrsUsingForwardScan - Don't delete linked dbg.assign
intrinsics and don't delete the next intrinsic found even if it would otherwise
be eligible for deletion.

remomveUndefDbgAssignsFromEntryBlock - Delete undef and unlinked dbg.assign
intrinsics encountered in the entry block that come before non-undef
non-unlinked intrinsics for the same variable.

Reviewed By: jmorse

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

20 months ago[clang][Driver] allow tilde in user config dir
Michał Górny [Wed, 16 Nov 2022 12:20:02 +0000 (13:20 +0100)]
[clang][Driver] allow tilde in user config dir

This patch allows users to configure clang with option
e.g. `-DCLANG_CONFIG_FILE_USER_DIR=~/.config/clang` or invoke clang
with `--config-user-dir=~/.config/clang`.

Patch merged on behalf of @paperchalice (LJC)

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

20 months ago[JITLink][RISCV] Add R_RISCV_LO12_S relocation support
luxufan [Wed, 16 Nov 2022 11:27:17 +0000 (19:27 +0800)]
[JITLink][RISCV] Add R_RISCV_LO12_S relocation support

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

Reviewed By: Hahnfeld

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

20 months ago[X86] combineConcatVectorOps - don't concat(vselect,vselect) if the concatenated...
Simon Pilgrim [Wed, 16 Nov 2022 11:44:09 +0000 (11:44 +0000)]
[X86] combineConcatVectorOps - don't concat(vselect,vselect) if the concatenated selection mask isn't legal

One of the crash regression tests now exposes an existing issue with SelectionDAG::simplifySelect not folding vselect with constant masks

Fixes #59003

20 months ago[AArch64] Lower fixed-length vector_shuffle to SVE splat if possible
Benjamin Maxwell [Wed, 16 Nov 2022 11:20:48 +0000 (11:20 +0000)]
[AArch64] Lower fixed-length vector_shuffle to SVE splat if possible

This adds an extra case to check if a vector_shuffle for a fixed-length
vector that's being lowered to SVE, is just a splat. Doing this avoids
a round trip to the stack and back for a few cases.

Reviewed By: c-rhodes

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

20 months agoRevert "Restore "[MemProf] ThinLTO summary support" with fixes"
Jeremy Morse [Wed, 16 Nov 2022 10:24:53 +0000 (10:24 +0000)]
Revert "Restore "[MemProf] ThinLTO summary support" with fixes"

This reverts commit 00c22351ba697dbddb4b5bf0ad94e4bcea4b316b.
This reverts commit 98ed423361de2f9dc0113a31be2aa04524489ca9.

Seemingly MSVC has some kind of issue with this patch, in terms of linking:

  https://lab.llvm.org/buildbot/#/builders/123/builds/14137

I'll post more detail on D135714 momentarily.

20 months agoRevert "Send statistics in initialized event"
Pavel Labath [Wed, 16 Nov 2022 10:51:47 +0000 (11:51 +0100)]
Revert "Send statistics in initialized event"

The test is failing on linux.

This reverts commits 7fe3586cda5b683766ec6b6d5ca2d98c2baaf162 and
d599ac41aabddeb2442db7b31faacf143d63abe4.

20 months ago[AArch64][CodeGen] Remove redundant vector negations before concat
Benjamin Maxwell [Wed, 16 Nov 2022 10:45:48 +0000 (10:45 +0000)]
[AArch64][CodeGen] Remove redundant vector negations before concat

This adds a new canonicalization rule to replace concats of truncated
negations with a negation of the concatenated truncates, e.g.

    (concat_vectors (v4i16 (truncate (not (v4i32)))),
                    (v4i16 (truncate (not (v4i32)))))
   ->
    (not (concat_vectors (v4i16 (truncate (v4i32))),
                         (v4i16 (truncate (v4i32)))))

Doing this allows avoiding redundant negations being emitted in
certain cases.

Reviewed By: peterwaller-arm

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

20 months ago[X86] vselect-avx.ll - add AVX512 test coverage
Simon Pilgrim [Wed, 16 Nov 2022 11:12:15 +0000 (11:12 +0000)]
[X86] vselect-avx.ll - add AVX512 test coverage

Ensure we test predicate selects as well

20 months ago[libc][NFC] move memmove implementation
Guillaume Chatelet [Tue, 25 Oct 2022 14:36:06 +0000 (14:36 +0000)]
[libc][NFC] move memmove implementation

Moving memmove implementation to its own file for symmetry with other mem functions.

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

20 months ago[libc] deprecate LLVM_LIBC_MEMCPY_X86_USE_ONLY_REPMOVSB
Guillaume Chatelet [Tue, 25 Oct 2022 15:18:46 +0000 (15:18 +0000)]
[libc] deprecate LLVM_LIBC_MEMCPY_X86_USE_ONLY_REPMOVSB

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

20 months ago[libc] remove mem functions dead code
Guillaume Chatelet [Tue, 25 Oct 2022 11:09:59 +0000 (11:09 +0000)]
[libc] remove mem functions dead code

Let's wait a bit for https://reviews.llvm.org/D136595 to settle before
cleaning up. Just in case we would need to revert.

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

20 months ago[AArch64][ARM] add Armv8.9-a/Armv9.4-a identifier support
Ties Stuij [Wed, 16 Nov 2022 09:47:55 +0000 (09:47 +0000)]
[AArch64][ARM] add Armv8.9-a/Armv9.4-a identifier support

For both ARM and AArch64 add support for specifying -march=armv8.9a/armv9.4a to
clang. Add backend plumbing like target parser and predicate support.

For a summary of Amv8.9/Armv9.4 features, see:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022

For detailed information, consult the Arm Architecture Reference Manual for
A-profile architecture:
https://developer.arm.com/documentation/ddi0487/latest/

People who contributed to this patch:
- Keith Walker
- Ties Stuij

Reviewed By: tmatheson

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

20 months ago[NFC][SelectionDAG][DebugInfo] Refactor DanglingDebugInfo class
OCHyams [Wed, 16 Nov 2022 10:10:24 +0000 (10:10 +0000)]
[NFC][SelectionDAG][DebugInfo] Refactor DanglingDebugInfo class

Hide the underlying DbgValueInst by adding methods to extract the necessary
information and by adding a raw_ostream &operator<< overload to print it.

Remove the DebugLoc field as this is always the same as the DbgValueInst's
DebugLoc (see D136247).

Reviewed By: StephenTozer

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

20 months ago[NFC][SelectionDAG][DebugInfo] Remove duplicate parameter from handleDebugValue
OCHyams [Wed, 16 Nov 2022 09:59:35 +0000 (09:59 +0000)]
[NFC][SelectionDAG][DebugInfo] Remove duplicate parameter from handleDebugValue

handleDebugValue has two DebugLoc parameters that appear to always take the
same value. Remove one of the duplicate parameters. See phabricator review for
more detail.

Reviewed By: StephenTozer

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

20 months agoAdd Float8E4M3FN type to MLIR.
Reed [Wed, 16 Nov 2022 09:24:24 +0000 (10:24 +0100)]
Add Float8E4M3FN type to MLIR.

The paper https://arxiv.org/abs/2209.05433 introduces two new FP8 dtypes: E5M2 (called Float8E5M2 in LLVM) and E4M3 (called Float8E4M3FN in LLVM). Support for Float8E5M2 in APFloat and MLIR was added in https://reviews.llvm.org/D133823. Support for Float8E4M3FN in APFloat was added in https://reviews.llvm.org/D137760. This change adds Float8E4M3FN to MLIR as well.

There is an RFC for adding the FP8 dtypes here: https://discourse.llvm.org/t/rfc-add-apfloat-and-mlir-type-support-for-fp8-e5m2/65279.

This change is identical to the MLIR changes in the patch that added Float8E5M2, except that Float8E4M3FN is added instead.

Reviewed By: stellaraccident, bkramer, rriddle

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

20 months ago[mlir][linalg] Fix bug in InferStaticShapeOfOperands pattern
Vladislav Vinogradov [Thu, 10 Nov 2022 10:23:44 +0000 (13:23 +0300)]
[mlir][linalg] Fix bug in InferStaticShapeOfOperands pattern

The pattern tries to deduce static shape from `tensor.cast` producer of linalg operation operands.
The original code unconditionally casts type of the `tensor.cast` source to `RankedTensorType`.
But the `tensor.cast` can also operate on `UnrankedTensorType`, so this cast either fail on assertion
in debug build or introduce UB in release build.

The patch replaces unconditional cast with `dyn_cast` and check for the cast result.

Reviewed By: mravishankar

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

20 months ago[clang][Parse][NFC] Remove unused DenseMap
Timm Bäder [Wed, 16 Nov 2022 08:28:48 +0000 (09:28 +0100)]
[clang][Parse][NFC] Remove unused DenseMap

20 months ago[clang][NFC] Remove unused CastForMoving parameter
Timm Bäder [Mon, 14 Nov 2022 15:35:23 +0000 (16:35 +0100)]
[clang][NFC] Remove unused CastForMoving parameter

Nothing ever passes a third parameter to CastForMoving.

20 months ago[WebAssembly] multivalue stackify fix
Samuel Parker [Tue, 15 Nov 2022 09:15:32 +0000 (09:15 +0000)]
[WebAssembly] multivalue stackify fix

Don't attempt to move a multivalue def past one of it's prior uses.

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

20 months ago[clang][Interp][NFC] Use constexpr if in OffsetHelper
Timm Bäder [Wed, 9 Nov 2022 11:48:43 +0000 (12:48 +0100)]
[clang][Interp][NFC] Use constexpr if in OffsetHelper

Add here is a template parameter, so we can do this.

20 months ago[mlir] [transform] Fix for RAUW error in transform gpu dialect
Guray Ozen [Tue, 15 Nov 2022 17:49:35 +0000 (18:49 +0100)]
[mlir] [transform] Fix for RAUW error in transform gpu dialect

The given test fails due to error below.

The following error is why the test is failing. One `memref.store` and two `memref.load` are consumers of the loop index for which I do RAUW. `memref.store` is first in the list. If I RAUW on this the loop of `llvm::make early inc range(threadIdx.getUsers())` does not return two `memref.load` as users. They remain unchanged. I'm not really certain why.

This change applies RAUW after collecting the users. If a better solution exists, I would be happy to implement it.

```
mlir-opt: ...llvm-project/mlir/include/mlir/IR/UseDefLists.h:175: mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList() [OperandType = mlir::OpOperand]: Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```

Reviewed By: springerm

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

20 months ago[MC][LoongArch] Fix needsRelocateWithSymbol() implementation
Youling Tang [Wed, 16 Nov 2022 07:52:27 +0000 (15:52 +0800)]
[MC][LoongArch] Fix needsRelocateWithSymbol() implementation

LoongArch should be `section plus offset`, so use the generic implementation
of `llvm/lib/MC/MCELFObjectTargetWriter.cpp` to return `false` directly, like
x86 and aarch64.

```
$ cat test.c
static int __attribute__((section(".text.another"))) test(int a, int b)
{
return a + b;
}
static int a = 1, b = 2;

int foo()
{
test(a, b);
return 0;
}

$ gcc -c test.c
$ readelf -Wr test.o

Relocation section '.rela.text' at offset 0x2a0 contains 5 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
0000000000000010  0000000300000047 R_LARCH_PCALA_HI20     0000000000000000 .data + 0
0000000000000014  0000000300000048 R_LARCH_PCALA_LO12     0000000000000000 .data + 0
0000000000000018  0000000300000047 R_LARCH_PCALA_HI20     0000000000000000 .data + 4
000000000000001c  0000000300000048 R_LARCH_PCALA_LO12     0000000000000000 .data + 4
0000000000000028  0000000500000042 R_LARCH_B26            0000000000000000 .text.another + 0

Relocation section '.rela.eh_frame' at offset 0x318 contains 2 entries:
    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
000000000000001c  0000000500000063 R_LARCH_32_PCREL       0000000000000000 .text.another + 0
000000000000003c  0000000200000063 R_LARCH_32_PCREL       0000000000000000 .text + 0
```

Reviewed By: SixWeining, MaskRay

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

20 months agoAMDGPU/GlobalISel: Fix shift tests using out of bounds offsets
Matt Arsenault [Mon, 14 Nov 2022 23:13:21 +0000 (15:13 -0800)]
AMDGPU/GlobalISel: Fix shift tests using out of bounds offsets

20 months agoDAG: Fix assert on load casted to vector with attached range metadata
Matt Arsenault [Sat, 12 Nov 2022 19:33:29 +0000 (11:33 -0800)]
DAG: Fix assert on load casted to vector with attached range metadata

AMDGPU legalizes i64 loads to loads of <2 x i32>, leaving the
i64 MMO with attached range metadata alone. The known bit width
was using the scalar element type, and asserting on a mismatch.

20 months ago[AMDGPU][GISel] Smaller code for scalar 32 to 64-bit extensions
Jay Foad [Fri, 6 Aug 2021 12:09:47 +0000 (13:09 +0100)]
[AMDGPU][GISel] Smaller code for scalar 32 to 64-bit extensions

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

20 months ago[LoongArch] Add immediate operand validity check for __builtin_loongarch_dbar
gonglingqin [Wed, 16 Nov 2022 05:59:52 +0000 (13:59 +0800)]
[LoongArch] Add immediate operand validity check for __builtin_loongarch_dbar

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

20 months ago[LLDB] Xfail TestVSCode_eventStatistic.py on Arm/AArch64 Linux
Muhammad Omair Javaid [Wed, 16 Nov 2022 06:36:31 +0000 (10:36 +0400)]
[LLDB] Xfail TestVSCode_eventStatistic.py on Arm/AArch64 Linux

This patch marks TestVSCode_eventStatistic.py as xfail on Arm/AArch64
Linux platform. test_initialized_event testcase is failing. See buildbot
logs below:

https://lab.llvm.org/buildbot/#/builders/17/builds/30199
https://lab.llvm.org/buildbot/#/builders/96/builds/31528

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

20 months ago[AMDGPU] Remove the assertion for MUBUF instruction with voffset
Christudasan Devadasan [Sat, 12 Nov 2022 13:29:48 +0000 (18:59 +0530)]
[AMDGPU] Remove the assertion for MUBUF instruction with voffset

Currently, there is an assertion that limits the MUBUF instruction
with voffset used for a VGPR spill inside kernel functions when
the frame pointer is really used. It seemed more like an unwanted
limitation and hence removing the assertion.

Reviewed By: arsenm

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

20 months ago[Driver] Enable nested configuration files
Serge Pavlov [Thu, 20 Oct 2022 05:24:50 +0000 (12:24 +0700)]
[Driver] Enable nested configuration files

Users may partition parameters specified by configuration file and put
different groups into separate files. These files are inserted into the
main file using constructs `@file`. Relative file names in it are
resolved relative to the including configuration file and this is not
convenient in some cases. A configuration file, which resides in system
directory, may need to include a file with user-defined parameters and
still provide default definitions if such file is absent.

To solve such problems, the option `--config=` is allowed inside
configuration files. Like `@file` it results in insertion of
command-line arguments but the algorithm of file search is different and
allows overriding system definitions with user ones.

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

20 months agoInstSimplify: Fold arithmetic_fence as idempotent
Matt Arsenault [Wed, 16 Nov 2022 02:18:21 +0000 (18:18 -0800)]
InstSimplify: Fold arithmetic_fence as idempotent

20 months agoIR: Make arithmetic_fence a DefaultAttrs intrinsic
Matt Arsenault [Wed, 16 Nov 2022 02:24:26 +0000 (18:24 -0800)]
IR: Make arithmetic_fence a DefaultAttrs intrinsic

20 months ago[gn build] Port 617277e7cbda
LLVM GN Syncbot [Wed, 16 Nov 2022 06:08:50 +0000 (06:08 +0000)]
[gn build] Port 617277e7cbda

20 months ago[VP][RISCV] Add vp.nearbyint and RISC-V support.
Yeting Kuo [Wed, 9 Nov 2022 01:40:24 +0000 (09:40 +0800)]
[VP][RISCV] Add vp.nearbyint and RISC-V support.

nearbyint has the property to execute without exception.
For not modifying fflags, the patch added new machine opcode
PseudoVFROUND_NOEXCEPT_V that expands vfcvt.x.f.v and vfcvt.f.x.v between a pair
of frflags and fsflags.

Reviewed By: craig.topper

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

20 months ago[clang-format][NFC] Improve documentation of FixNamespaceComments
Björn Schäpers [Sat, 12 Nov 2022 04:51:19 +0000 (05:51 +0100)]
[clang-format][NFC] Improve documentation of FixNamespaceComments

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

20 months ago[clang-format][NFC] Improve documentation on ReflowComments
Björn Schäpers [Fri, 11 Nov 2022 21:19:03 +0000 (22:19 +0100)]
[clang-format][NFC] Improve documentation on ReflowComments

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

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

20 months ago[clang-format][NFC] Moved configuration parsing tests in own file
Björn Schäpers [Fri, 11 Nov 2022 08:00:49 +0000 (09:00 +0100)]
[clang-format][NFC] Moved configuration parsing tests in own file

I want to reduce the size of ForatTest.cpp with its still wopping 25k
lines it is a burden on the compiler and editor (mine is clangd
powered).

This are tests which are really serving a different purpose than
formatting.

I've copied the code and made the following changes:
- Dropped the ; at the end of some macros, all macro "invocations"
  already have their own ;.
- Dropped the _F, we don't need a fxiture here.

Differential Revisison: https://reviews.llvm.org/D137823

20 months ago[AArch64InstPrinter] Print TargetAddress as an uint64_t
Woody Lin [Wed, 2 Nov 2022 10:51:14 +0000 (18:51 +0800)]
[AArch64InstPrinter] Print TargetAddress as an uint64_t

Outputs readable addresses by printed 'TargetAddress' as an uint64_t
value.

`bl     -0x37efd56628` => `bl     0xffffffc8102a99d8`

Reviewed By: dmgreen

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

20 months ago[mlir][sparse] avoid single small vector, set exact number 3
Aart Bik [Tue, 15 Nov 2022 23:37:31 +0000 (15:37 -0800)]
[mlir][sparse] avoid single small vector, set exact number 3

Reviewed By: wrengr

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

20 months agoRevert "[pgo] Avoid introducing relocations by using private alias"
Paul Kirth [Wed, 16 Nov 2022 03:36:54 +0000 (03:36 +0000)]
Revert "[pgo] Avoid introducing relocations by using private alias"

This reverts commit 2b8917f8ad792c4c484975b82039bbdebe556881.

This breaks with lld and gold

20 months ago[VP][RISCV] Add vp.bswap and RISC-V support.
Yeting Kuo [Mon, 14 Nov 2022 09:58:18 +0000 (17:58 +0800)]
[VP][RISCV] Add vp.bswap and RISC-V support.

The patch also added function expandVPBSWAP to expand ISD::VP_BSWAP nodes.

Reviewed By: craig.topper

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

20 months ago[RISCV] Improve formatting of Sched lists in tablegen. NFC
Craig Topper [Wed, 16 Nov 2022 02:59:12 +0000 (18:59 -0800)]
[RISCV] Improve formatting of Sched lists in tablegen. NFC

20 months agoSend statistics in initialized event
George Hu [Wed, 16 Nov 2022 00:29:54 +0000 (16:29 -0800)]
Send statistics in initialized event

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

20 months ago[mlir][Transforms] CSE of ops with a single block.
Mahesh Ravishankar [Tue, 20 Sep 2022 00:49:01 +0000 (00:49 +0000)]
[mlir][Transforms] CSE of ops with a single block.

Currently CSE does not support CSE of ops with regions. This patch
extends the CSE support to ops with a single region.

Differential Revision: https://reviews.llvm.org/D134306
Depends on D137857

20 months ago[X86][AMX] Fix the shape dependency issue.
Luo, Yuanke [Mon, 14 Nov 2022 02:20:15 +0000 (10:20 +0800)]
[X86][AMX] Fix the shape dependency issue.

AMX shape should be defined before AMX intrinsics. However for below
case, the shape a.row is defined after tile load of b. If we transform
`load b` to `@llvm.x86.tileloadd64 intrinsic`, the shape dependency
doesn't meet.
```
void test_tile_dpbsud(__tile1024i a, __tile1024i b, __tile1024i c) {
  __tile_dpbsud(&c, a, b);
}
```
This patch is to store the tile b to stack and reloaded it after the
def of b.row. It would cause redundant store/load, but it is simple
to avoid generating invalid IR.
The better way may hoist `def b.row` before tile load instruction,
but it seems more complicated to recursively hoist its operands.

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

20 months ago[RISCV] Don't use zero-stride vector load for gather if not optimized
wangpc [Wed, 16 Nov 2022 02:42:18 +0000 (10:42 +0800)]
[RISCV] Don't use zero-stride vector load for gather if not optimized

We may form a zero-stride vector load when lowering gather to strided
load. As what D137699 has done, we use `load+splat` for this form if
there is no optimized implementation.
We restrict this to unmasked loads currently in consideration of the
complexity of hanlding all falses masks.

Reviewed By: reames

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

20 months ago[RISCV] Remove some unneeded widening FP vector pseudo instructions. NFC
Craig Topper [Wed, 16 Nov 2022 02:00:22 +0000 (18:00 -0800)]
[RISCV] Remove some unneeded widening FP vector pseudo instructions. NFC

We don't need LMUL=8 versions of these.

Reviewed By: michaelmaitland

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

20 months ago[RISCV] Refactor getDefaultVLOps. NFC.
Han-Kuan Chen [Mon, 14 Nov 2022 03:08:46 +0000 (19:08 -0800)]
[RISCV] Refactor getDefaultVLOps. NFC.

Current getDefaultVLOps can only deduce VL from a MVT. However,
sometimes users have already known VL value. This commit will provide a
uniform interface to get VL instead of calling DAG.getConstant.

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

20 months ago[PowerPC] Fix strict load-conversion recognition
Qiu Chaofan [Wed, 16 Nov 2022 01:59:39 +0000 (09:59 +0800)]
[PowerPC] Fix strict load-conversion recognition

Direct-move instructions are usually more efficient than load then store
for conversion. But direct moves are not needed when the source register
was just loaded from some address.

The pattern has already been recognized, but the source value of strict
nodes are not the first (that's the chain), but the second.

Reviewed By: shchenz

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

20 months agoRevert "[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on...
Michael Maitland [Wed, 16 Nov 2022 02:01:19 +0000 (18:01 -0800)]
Revert "[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV"

This reverts commit b88b8307bf9e24f53e7ef3052abf2c506ff55fd2.

20 months ago[mlir][sparse] move SparseTensorReader functions into the _mlir_ciface_ section
wren romano [Wed, 16 Nov 2022 00:31:01 +0000 (16:31 -0800)]
[mlir][sparse] move SparseTensorReader functions into the _mlir_ciface_ section

This is a reposting of D137737, which got reverted when D137735 did.  There are no changes other than rebasing.

Reviewed By: aartbik

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

20 months ago[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV
Michael Maitland [Fri, 4 Nov 2022 15:51:39 +0000 (08:51 -0700)]
[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV

On x86 and AArch, SIMD instructions encode all of the scheduling information in the instruction
itself. For example, VADD.I16 q0, q1, q2 is a neon instruction that operates on 16-bit integer
elements stored in 128-bit Q registers, which leads to eight 16-bit lanes in parallel. This kind
of information impacts how the instruction takes to execute and what dependencies this may cause.

On RISCV however, the data that impacts scheduling is encoded in CSR registers such as vtype or
vl, in addition with the instruction itself. But MCA does not track or use the data in these
registers. This patch fixes this problem by introducing Instruments into MCA.

* Replace `CodeRegions` with `AnalysisRegions`
* Add `Instrument` and `InstrumentManager`
* Add `InstrumentRegions`
* Add RISCV Instrument and `InstrumentManager`
* Parse `Instruments` in driver
* Use instruments to override schedule class
* RISCV use lmul instrument to override schedule class
* Fix unit tests to pass empty instruments
* Add -ignore-im clopt to disable this change

A prior version of this patch was commited in. It was reverted in
5e82ee5373211db8522181054800ccd49461d9d82323a4ee610f5e1db74d362af4c6fb8c704be8f6 reverted
that change because the unit test files caused build errors. This commit adds the original changes
and the fixed test files.

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

20 months ago[mlir][Translation] Allow specifying an expected input alignment for "ToMLIR" transla...
River Riddle [Tue, 15 Nov 2022 02:16:28 +0000 (18:16 -0800)]
[mlir][Translation] Allow specifying an expected input alignment for "ToMLIR" translations

This allows for ensuring that alignment requirements on translation
inputs are satisfied.

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

20 months ago[Sema] Use the value category of the base expression when creating an
Akira Hatanaka [Wed, 16 Nov 2022 01:13:33 +0000 (17:13 -0800)]
[Sema] Use the value category of the base expression when creating an
ExtVectorElementExpr

This fixes a bug where an lvalue ExtVectorElementExpr was created when
the base expression was an ObjC property dot operator.

This reverts 220d08d942ab0df3211388e602ed34fa6139ca61.

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

20 months ago[lldb] Fix simple template names and template params with scope qualifiers
Arthur Eubanks [Mon, 7 Nov 2022 21:07:26 +0000 (13:07 -0800)]
[lldb] Fix simple template names and template params with scope qualifiers

Followup to D134378.

With PrintingPolicy::SuppressScope, we'd also not print the scope in template params. The intention was only to skip the scope for the class because we expect template params to be fully qualified when comparing them for simple template names.

Instead, use `NamedDecl::getNameForDiagnostic` if we're dealing with a tag, which is what we actually use when emitting debug info in clang. That already has an option to suppress the scope on the base name.

Reviewed By: dblaikie

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

20 months ago[mlir][sparse] fix memory leakage in concatenate rewriter.
Peiming Liu [Wed, 16 Nov 2022 00:00:33 +0000 (00:00 +0000)]
[mlir][sparse] fix memory leakage in concatenate rewriter.

Reviewed By: aartbik

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

20 months ago[bazel] Remove reference to file removed in 70dc3b811e4926fa2c88bd3b53b29c46fcba1a90
Benjamin Kramer [Tue, 15 Nov 2022 23:35:12 +0000 (00:35 +0100)]
[bazel] Remove reference to file removed in 70dc3b811e4926fa2c88bd3b53b29c46fcba1a90

20 months ago[libc] [Obvious] Cleanup.
Raman Tenneti [Tue, 15 Nov 2022 23:26:36 +0000 (15:26 -0800)]
[libc] [Obvious] Cleanup.

+ Avoid the `clockid` var and just passed `long(CLOCK_REALTIME)`
  to the syscall.

Reviewed By: rtenneti

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

20 months ago[lldb-vscode] Send Selected Statistics Dump in Terminated Event
Wanyi Ye [Sat, 10 Sep 2022 18:27:09 +0000 (11:27 -0700)]
[lldb-vscode] Send Selected Statistics Dump in Terminated Event

This patch will gather debug info & breakpoint info from the statistics dump (from `(SBTarget.GetStatistics())` func) and send to DAP in terminated event.

The statistics content can be huge (especially the `modules`) and dumping in full JSON can create delay in the IDE's debugging UI. (For more details, please read: https://github.com/llvm/llvm-project/commit/7bbd0fba986c241162b77b7e424ad82bc7e17b41 ). Hence, we will filter out large contents before returning it in terminated event.

It will keep all the metadata fields (those starts with "total"). For large contents, it uses the opt-out strategy. Currently it only removes the "modules" field. This way every time a new top-level field being added, we will be able to capture them from DAP log without changing lldb-vscode.

The DAP terminated event should look like
```
{
  "event":"terminated",
  "seq":0,
  "statistics": {
    "memory": <JSON string>
    "targets": <JSON string>, // it's a JSON array, breakpoints info included in each target
    <metadata_key: value> // pairs
  },
  "type":"event"
}
```

All the info above will be append to statistics field in the terminated event

Test Plan

Debugged a simple hello world program from VSCode. Exit debug session in two ways: 1) run to program exit; 2) user initiated debug session end (quit debugging before program exit).
Check DAP log and see both debug sessions have statistics returned in terminated event.

Here's an example when debugging the test program:

```
{"event":"terminated","seq":0,"statistics":{"memory":"{\"strings\":{\"bytesTotal\":1843200,\"bytesUnused\":897741,\"bytesUsed\":945459}}","targets":"[{\"breakpoints\":[{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"NameMask\":[56],\"Offset\":0,\"SkipPrologue\":true,\"SymbolNames\":[\"foo\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":1,\"internal\":false,\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.002232},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Column\":0,\"Exact\":false,\"FileName\":\"/data/users/wanyi/llvm-sand/external/llvm-project/lldb/test/API/tools/lldb-vscode/terminated-event/main.cpp\",\"Inlines\":true,\"LineNumber\":5,\"Offset\":0,\"SkipPrologue\":true},\"Type\":\"FileAndLine\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":2,\"internal\":false,\"numLocations\":0,\"numResolvedLocations\":0,\"resolveTime\":0.23203799999999999},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Language\":\"c\",\"NameMask\":[4,4,4,4,4,4],\"Offset\":0,\"SkipPrologue\":false,\"SymbolNames\":[\"_dl_debug_state\",\"rtld_db_dlactivity\",\"__dl_rtld_db_dlactivity\",\"r_debug_state\",\"_r_debug_state\",\"_rtld_debug_state\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"SearchFilter\":{\"Options\":{\"ModuleList\":[\"/usr/lib64/ld-2.28.so\"]},\"Type\":\"Modules\"}}},\"id\":-1,\"internal\":true,\"kindDescription\":\"shared-library-event\",\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.00026699999999999998}],\"expressionEvaluation\":{\"failures\":0,\"successes\":0},\"firstStopTime\":0.087458974999999994,\"frameVariable\":{\"failures\":0,\"successes\":0},\"launchOrAttachTime\":0.052953161999999998,\"moduleIdentifiers\":[94554748126576,94554747837792,94554747149216,139800112130176,139800112161056,139800112206064,139800112340224,139800112509552,139800112236528],\"signals\":[{\"SIGSTOP\":1}],\"sourceMapDeduceCount\":0,\"stopCount\":8,\"targetCreateTime\":0.00057700000000000004,\"totalBreakpointResolveTime\":0.234537}]","totalDebugInfoByteSize":1668056,"totalDebugInfoEnabled":3,"totalDebugInfoIndexLoadedFromCache":0,"totalDebugInfoIndexSavedToCache":0,"totalDebugInfoIndexTime":0.027963000000000002,"totalDebugInfoParseTime":0.34354800000000002,"totalModuleCount":10,"totalModuleCountHasDebugInfo":3,"totalSymbolTableIndexTime":0.056050000000000003,"totalSymbolTableParseTime":0.23930000000000001,"totalSymbolTableStripped":0,"totalSymbolTablesLoadedFromCache":0,"totalSymbolTablesSavedToCache":0},"type":"event"}
```

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

20 months ago[libc] disable flakey tests
Michael Jones [Tue, 15 Nov 2022 21:50:27 +0000 (13:50 -0800)]
[libc] disable flakey tests

The mprotect test has been failing and causing significant buildbot
noise. Given that this is a simple functions it's more important that
the buildbot errors be useful than having more thorough tests for this
function.

Reviewed By: sivachandra, lntue

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

20 months ago[mlir][sparse] cleanup small vector constant hints
Aart Bik [Tue, 15 Nov 2022 22:15:35 +0000 (14:15 -0800)]
[mlir][sparse] cleanup small vector constant hints

Following advise from

https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h

This revision removes the size hints from SmallVector (unless we are
certain of the resulting number of elements). Also, this replaces
SmallVector references with SmallVectorImpl references.

Reviewed By: Peiming

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

20 months ago[libc] cleanup changes to gettimeofday.
Raman Tenneti [Tue, 15 Nov 2022 22:14:20 +0000 (14:14 -0800)]
[libc] cleanup changes to gettimeofday.

+ Deleted duplicate definitions of StructTimeVal and StructTimeValPtr.
+ Caled syscall  clock_gettime to get timespec data.
+ Added tests to test for sleeping 200 and 1000 microseconds.
+ Fixed comments from https://reviews.llvm.org/D137881

Reviewed By: sivachandra

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

20 months ago[BOLT-TESTS] Follow-up to D131919
Amir Ayupov [Tue, 15 Nov 2022 22:44:32 +0000 (14:44 -0800)]
[BOLT-TESTS] Follow-up to D131919

googletest was moved to third-party. Update path in BOLT's CMakeCache.

Reviewed By: #bolt, maksfb

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

20 months ago[LSR] Check if terminating value is safe to expand before transformation
eopXD [Fri, 28 Oct 2022 09:07:17 +0000 (02:07 -0700)]
[LSR] Check if terminating value is safe to expand before transformation

According to report by @JojoR, the assertion error was hit hence we need
to have this check before the actual transformation.

Reviewed By: Meinersbur, #loopoptwg

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

20 months ago[gn build] Port a16bd4f9f25e
LLVM GN Syncbot [Tue, 15 Nov 2022 22:46:53 +0000 (22:46 +0000)]
[gn build] Port a16bd4f9f25e

20 months ago[gn build] Port 4be39288f506
LLVM GN Syncbot [Tue, 15 Nov 2022 22:46:52 +0000 (22:46 +0000)]
[gn build] Port 4be39288f506

20 months ago[mlir][sparse] Fix rewriting for convert op and concatenate op.
bixia1 [Tue, 15 Nov 2022 21:24:15 +0000 (13:24 -0800)]
[mlir][sparse] Fix rewriting for convert op and concatenate op.

Fix a problem in convert op rewriting where it used the original index for
ToIndicesOp.

Extend the concatenate op rewriting to handle dense destination and dynamic
shape destination.

Make the concatenate op integration test run on the codegen path.

Reviewed By: Peiming

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

20 months agoNFC test if rosetta is installed before running x86 binary on AS
Jason Molenda [Tue, 15 Nov 2022 22:43:20 +0000 (14:43 -0800)]
NFC test if rosetta is installed before running x86 binary on AS

Rosetta 2 is not installed by default in a fresh macOS installation
on Apple Silicon, so x86 binaries cannot be run.  CI bots are often
in this state.  Update this test to check for the rosetta debugserver,
which our debugserver also hardcodes the path of, before trying to
run an x86 process on AS systems.

20 months ago[ObjC] Fix an assertion failure in EvaluateLValue
Akira Hatanaka [Tue, 15 Nov 2022 21:55:12 +0000 (13:55 -0800)]
[ObjC] Fix an assertion failure in EvaluateLValue

Look through parentheses when determining whether the expression is a
@selector expression.

20 months ago[Clang][Sema] Refactor category declaration under CheckForIncompatibleAttributes...
eopXD [Mon, 7 Nov 2022 17:47:09 +0000 (09:47 -0800)]
[Clang][Sema] Refactor category declaration under CheckForIncompatibleAttributes. NFC

This change would allow extension of new categories be aware of adding
more code here.

This patch also updates the comments, which was originally missing the
vector predicate.

Reviewed By: mikerice

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

20 months ago[TargetLowering][RISCV][ARM][AArch64][Mips] Reduce the number of AND mask constants...
Craig Topper [Tue, 15 Nov 2022 22:36:01 +0000 (14:36 -0800)]
[TargetLowering][RISCV][ARM][AArch64][Mips] Reduce the number of AND mask constants used by BSWAP expansion.

We can reuse constants if we use SRL followed by AND and AND followed by SHL.
Similar was done to bitreverse previously.

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

20 months ago[AggressiveInstCombine] Remove legacy PM pass
Arthur Eubanks [Mon, 31 Oct 2022 21:50:38 +0000 (14:50 -0700)]
[AggressiveInstCombine] Remove legacy PM pass

As part of legacy PM optimization pipeline removal.

This shouldn't be used in codegen pipelines so it should be ok to remove.

Reviewed By: asbirlea

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

20 months agoNFC test if rosetta debugserver exists before testing rosetta
Jason Molenda [Tue, 15 Nov 2022 22:33:50 +0000 (14:33 -0800)]
NFC test if rosetta debugserver exists before testing rosetta

A fresh install of macOS does not have Rosetta 2 installed by
default; the CI bots are often in this state, resulting in a
test failure.  debugserver already hardcodes the filepath of
the Rosetta 2 debugserver; test if that file exists before
running the Rosetta test.

20 months ago[opt] Print deprecation warning for use of legacy syntax with new pass manager
Arthur Eubanks [Sun, 23 Oct 2022 20:42:13 +0000 (13:42 -0700)]
[opt] Print deprecation warning for use of legacy syntax with new pass manager

And a possible opt invocation plus a link to more extensive documentation.

Reviewed By: asbirlea

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

20 months ago[lldb/test] Fix app_specific_backtrace_crashlog.test (NFC)
Med Ismail Bennani [Tue, 15 Nov 2022 22:23:26 +0000 (14:23 -0800)]
[lldb/test] Fix app_specific_backtrace_crashlog.test (NFC)

This patch changes app_specific_backtrace_crashlog.test's crashlog file
extension from `ips` to `txt. This should prevent the test from opening
Console.app when being run.

This should also fix a test failure caused by missing symbols.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
20 months ago[RISCV] Move GlobalISEL specific files to sub-directory [nfc]
Philip Reames [Tue, 15 Nov 2022 21:50:39 +0000 (13:50 -0800)]
[RISCV] Move GlobalISEL specific files to sub-directory [nfc]