platform/upstream/llvm.git
14 months ago[libc++][NFC] Use _LIBCPP_STD_VER instead of __cpp_lib_atomic_is_always_lock_free
Nikolas Klauser [Fri, 12 May 2023 03:24:30 +0000 (20:24 -0700)]
[libc++][NFC] Use _LIBCPP_STD_VER instead of __cpp_lib_atomic_is_always_lock_free

Reviewed By: #libc, ldionne, Mordante

Spies: Mordante, libcxx-commits

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

14 months agoASan: fix potential use-after-free in backtrace interceptor
Thurston Dang [Fri, 12 May 2023 23:27:53 +0000 (23:27 +0000)]
ASan: fix potential use-after-free in backtrace interceptor

Various ASan interceptors may corrupt memory if passed a
pointer to freed memory (https://github.com/google/sanitizers/issues/321).
This patch fixes the issue for the backtrace interceptor,
by calling REAL(backtrace) with a known-good scratch buffer,
and performing an addressability check on the user-provided
buffer prior to writing to it.

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

14 months ago[Docs] Minor Fixups in Advanced Builds Documentation
Aiden Grossman [Sat, 13 May 2023 22:43:39 +0000 (15:43 -0700)]
[Docs] Minor Fixups in Advanced Builds Documentation

This patch changes two instances of an ampersand to a written out and
for more consistency with the rest of the file and brevity. In addition,
the last `cmake --build` reference is removed, again for consistency
with the rest of the file which shows the ninja invocations. This cmake
invocation also passed in the `--parallel` flag which doesn't make sense
with ninja using all threads by default.

This was changed in the previous patch to touch this line
(https://reviews.llvm.org/D88990), but if we want to change this, it
should be done across the entire file.

14 months ago[SelectionDAG] Use `computeKnownBits` if `Op` is not recognized by `isKnownNeverZero`
Noah Goldstein [Sat, 13 May 2023 17:58:55 +0000 (12:58 -0500)]
[SelectionDAG] Use `computeKnownBits` if `Op` is not recognized by `isKnownNeverZero`

The current logic is pretty limitted unless the `Op` is a
constant. This at least covers more obvious cases.

Reviewed By: craig.topper, foad

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

14 months ago[SelectionDAG] Limit max recursion in `isKnownNeverZero` and `isKnownToBeAPowerOfTwo`
Noah Goldstein [Tue, 25 Apr 2023 17:53:33 +0000 (12:53 -0500)]
[SelectionDAG] Limit max recursion in `isKnownNeverZero` and `isKnownToBeAPowerOfTwo`

Both of these functions recursively call themselves so it makes sense
to limit that upper bound.

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

14 months ago[InstCombine] Add simplifications for div/rem with `i1` operands; PR62607
Noah Goldstein [Sat, 13 May 2023 17:58:16 +0000 (12:58 -0500)]
[InstCombine] Add simplifications for div/rem with `i1` operands; PR62607

This is generally handled already in early CSE.

If a specialized pipeline is used, however, its possible for `i1`
operand with known-zero denominator to slip through. Generally the
known-zero denominator is caught and poison is returned, but if it is
indirect enough (known zero through a phi node) we can miss this case
in `InstructionSimplify` and then miss handling `i1`. This is because
`i1` is current handled with the following check:
    `if(Known.countMinLeadingZeros() == Known.getBitWidth() - 1)`

which only works on the assumption we don't know the denominator to be
zero. If we know the denominator to be zero, this check fails:
https://github.com/llvm/llvm-project/issues/62607

This patch simply adds an explicit `if(Known.isZero) return poison;`
which fixes the issue.

Alive2 Link for tests:
    https://alive2.llvm.org/ce/z/VTw54n

Reviewed By: nikic

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

14 months ago[X86] Invert transforming `(x * (Pow2_Ceil(C1) - (1 << C0))) & C1` -> `(-x << C0...
Noah Goldstein [Sat, 13 May 2023 17:58:03 +0000 (12:58 -0500)]
[X86] Invert transforming `(x * (Pow2_Ceil(C1) - (1 << C0))) & C1` -> `(-x << C0) & C1`

We can detect the case under the following circumstances:
Take `(Pow2_Ceil(C1) - (1 << C0))` as `C2`.
    1) `C2` is NOT a power of 2.
    2) `C2 + LeastSignificantBit(C2)` is a nonzero power of 2.
    3) `C2 u>= C1`

The motivation is the middle end transforms:
    `(-x << C0) & C1`
to
    `(x * (Pow2_Ceil(C1) - (1 << C2))) & C1`

As it saves IR instructions. On X86 the two instruction, `sub` and
`shl`, and better than the `mul` so we want to undo the transform.

This comes up when shifting a bit-mask by a byte-misalignment i.e:
    `y << ((-(uintptr)x * 8) & 63)`

Alive2 Proofs (including all cases with undefs in the vector):
https://alive2.llvm.org/ce/z/f-65b6

Reviewed By: RKSimon, pengfei

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

14 months ago[X86] Add tests for inverting `(x * (Pow2_Ceil(C1) - (1 << C0))) & C1` -> `(-x <...
Noah Goldstein [Wed, 10 May 2023 19:49:23 +0000 (14:49 -0500)]
[X86] Add tests for inverting `(x * (Pow2_Ceil(C1) - (1 << C0))) & C1` -> `(-x << C0) & C1`; NFC

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

14 months ago[cmake] Disable GCC lifetime DSE
Sam James [Sat, 13 May 2023 19:34:05 +0000 (20:34 +0100)]
[cmake] Disable GCC lifetime DSE

LLVM data structures like llvm::User and llvm::MDNode rely on
the value of object storage persisting beyond the lifetime of the
object (#24952).  This is not standard compliant and causes a runtime
crash if LLVM is built with GCC and LTO enabled (#57740).  Until
these issues are fixed, we need to disable dead store eliminations
eliminations based on object lifetime.

Bug: https://github.com/llvm/llvm-project/issues/24952
Bug: https://github.com/llvm/llvm-project/issues/57740
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106943
Reviewed By: MaskRay, thesamesam, nikic

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

14 months ago[Clang][CMake] Use perf-training for Clang-BOLT
Amir Ayupov [Sat, 13 May 2023 17:34:50 +0000 (10:34 -0700)]
[Clang][CMake] Use perf-training for Clang-BOLT

Leverage perf-training flow for BOLT profile collection, enabling reproducible
BOLT optimization. Remove the use of bootstrapped build for profile collection.

Test Plan:
- Regular (single-stage) build
```
$ cmake ... -C .../clang/cmake/caches/BOLT.cmake
$ ninja clang-bolt
...
[21/24] Instrumenting clang binary with BOLT
[21/24] Generating BOLT profile for Clang
[23/24] Merging BOLT fdata
Profile from 2 files merged.
[24/24] Optimizing Clang with BOLT
...
          1291202496 : executed instructions (-1.1%)
            27005133 : taken branches (-71.5%)
...
```
- Two stage build (ThinLTO+InstPGO)
```
$ cmake ... -C .../clang/cmake/caches/BOLT.cmake -C .../clang/cmake/caches/BOLT-PGO.cmake
$ ninja clang-bolt
$ ninja stage2-clang-bolt
...
[2756/2759] Instrumenting clang binary with BOLT
[2756/2759] Generating BOLT profile for Clang
[2758/2759] Merging BOLT fdata
[2759/2759] Optimizing Clang with BOLT
...
BOLT-INFO: 7092 out of 184104 functions in the binary (3.9%) have non-empty execution profile
           756531927 : executed instructions (-0.5%)
            15399400 : taken branches (-40.3%)
...
```

Reviewed By: beanz

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

14 months ago[gn] port 88c1242ed7e1 (begone, LLVMExegesisARMTests)
Nico Weber [Sat, 13 May 2023 15:16:23 +0000 (17:16 +0200)]
[gn] port 88c1242ed7e1 (begone, LLVMExegesisARMTests)

14 months ago[LV] Move selecting vectorization factor logic to LVP (NFC).
Florian Hahn [Sat, 13 May 2023 11:28:10 +0000 (12:28 +0100)]
[LV] Move selecting vectorization factor logic to LVP (NFC).

Split off from D143938. This moves the planning logic to select the
vectorization factor to LoopVectorizationPlanner as a step towards only
computing costs for individual VFs in LoopVectorizationCostModel and do
planning in LVP.

Reviewed By: Ayal

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

14 months ago[VPlan] Change LoopVectorizationPlanner::TTI to be const reference (NFC)
Florian Hahn [Sat, 13 May 2023 11:27:53 +0000 (12:27 +0100)]
[VPlan] Change LoopVectorizationPlanner::TTI to be const reference (NFC)

14 months ago[MLIR] NFC. Pass affine copy options by const ref
Uday Bondhugula [Sat, 13 May 2023 10:06:12 +0000 (15:36 +0530)]
[MLIR] NFC. Pass affine copy options by const ref

NFC. Pass affine copy options by const ref.

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

14 months agoReland "[CMake] Bumps minimum version to 3.20.0."
Mark de Wever [Sat, 13 May 2023 09:42:25 +0000 (11:42 +0200)]
Reland "[CMake] Bumps minimum version to 3.20.0."

The owner of the last two failing buildbots updated CMake.

This reverts commit e8e8707b4aa6e4cc04c0cffb2de01d2de71165fc.

14 months ago[llvm-jitlink] Pass object features when creating MCSubtargetInfo
Job Noorman [Sat, 13 May 2023 09:36:46 +0000 (11:36 +0200)]
[llvm-jitlink] Pass object features when creating MCSubtargetInfo

The reason for this patch is to allow the MCDisassembler used in tests
to disassemble instructions that are only available when a specific
feature is enabled.

For example, on RISC-V it's currently not possible to use
decode_operand() on a compressed instruction. This patch fixes this.

Reviewed By: lhames

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

14 months ago[NFC][libc++][format] Tests formatter requirements.
Mark de Wever [Sat, 6 May 2023 15:04:26 +0000 (17:04 +0200)]
[NFC][libc++][format] Tests formatter requirements.

Like done D149543 this validates the other formatter specializations.

Reviewed By: #libc, ldionne

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

14 months ago[LV] Move getVScaleForTuning out of LoopVectorizationCostModel (NFC).
Florian Hahn [Sat, 13 May 2023 09:17:09 +0000 (10:17 +0100)]
[LV] Move getVScaleForTuning out of LoopVectorizationCostModel (NFC).

Split off refactoring from D150197 to reduce diff.

14 months ago[Docs][llvm-exegesis] Specify supported platforms and architectures
Aiden Grossman [Sat, 13 May 2023 09:05:22 +0000 (09:05 +0000)]
[Docs][llvm-exegesis] Specify supported platforms and architectures

Currently, there is no documentation on what platforms and architectures
llvm-exegesis is supported on. This patch adds in user-facing
documentation in the CommandGuide about what architectures are supported
as well as developer facing documentation detailing the technical
reasons for why certain platforms are supported and some aren't.

This is a follow-up after discussion in
https://discourse.llvm.org/t/clarification-on-platform-support-for-llvm-exegesis/70206.

Reviewed By: kpdev42

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

14 months ago[llvm-exegesis] Remove Assembler Tests
Aiden Grossman [Sat, 13 May 2023 08:56:42 +0000 (08:56 +0000)]
[llvm-exegesis] Remove Assembler Tests

The Assembler tests have been disabled for years in tree and at this
point don't test anything other than common MC infrastructure that is
already tested in other parts of the tree. This patch removes them due
to the mentioned reasons.

Reviewed By: courbet

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

14 months ago[Clang][Docs] Fix man page build
Aiden Grossman [Sat, 13 May 2023 08:49:52 +0000 (08:49 +0000)]
[Clang][Docs] Fix man page build

This patch fixes the man page build. It currently doesn't work as
SOURCE_DIR isn't set correctly (just undefined) within the
add_sphinx_target function. This patch also moves around the creation of
targets for autogenerated rst files so that both the man page and html
build can depend upon them as before only the html build depended on
them.

Fixes #62540

Reviewed By: tstellar

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

14 months ago[Matrix] Add shape verification.
Florian Hahn [Sat, 13 May 2023 08:40:16 +0000 (09:40 +0100)]
[Matrix] Add shape verification.

At the moment, lower-matrix-intrinsics accepts mis-matches between
shapes for operations. See shape-verification.ll for an example where
@llvm.matrix.column.major.load specifies 6x1 and then the use
(@llvm.matrix.multiply) specifies the operand to have 1x6.

This patch adds verification for shapes to check if shapes match.

Reviewed By: thegameg

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

14 months ago[test] Driver/ftime-trace.cpp: work around -Wmsvc-not-found
Fangrui Song [Sat, 13 May 2023 07:22:05 +0000 (00:22 -0700)]
[test] Driver/ftime-trace.cpp: work around -Wmsvc-not-found

There may be one extra warning. Just make the check less strict.
```
clang: warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]
clang: warning: argument unused during compilation: '-ftime-trace' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-ftime-trace=e' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-ftime-trace-granularity=1' [-Wunused-command-line-argument]
```

14 months ago[ELF] Simplify getSectionRank and rewrite comments
Fangrui Song [Sat, 13 May 2023 06:58:39 +0000 (23:58 -0700)]
[ELF] Simplify getSectionRank and rewrite comments

Replace some RF_ flags with integer literals.
Rewrite the isWrite/isExec block to make the code block order reflect
the section order.
Rewrite some imprecise comments.

This is NFC, if we don't count invalid cases such as non-writable TLS
and non-writable RELRO.

14 months ago[llvm] Fix typos in documentation
Kazu Hirata [Sat, 13 May 2023 06:47:46 +0000 (23:47 -0700)]
[llvm] Fix typos in documentation

14 months ago[gn build] Port b97859b67416
LLVM GN Syncbot [Sat, 13 May 2023 06:40:42 +0000 (06:40 +0000)]
[gn build] Port b97859b67416

14 months ago[RISCV] Teach doPeepholeMaskedRVV to handle FMA instructions.
Craig Topper [Sat, 13 May 2023 06:36:27 +0000 (23:36 -0700)]
[RISCV] Teach doPeepholeMaskedRVV to handle FMA instructions.

This lets us remove some isel patterns.

Reviewed By: fakepaper56

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

14 months agodocs: Document procedure for updating pull requests
Tom Stellard [Sat, 13 May 2023 06:35:10 +0000 (23:35 -0700)]
docs: Document procedure for updating pull requests

See discussion in #56637.

Reviewed By: ldionne, jhenderson

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

14 months agoworkflows/release-tasks: Remove stray backslash
Tom Stellard [Sat, 13 May 2023 06:33:44 +0000 (23:33 -0700)]
workflows/release-tasks: Remove stray backslash

Reviewed By: thieta

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

14 months agoRevert "[RISCV][llvm-mca] Add mca tests for riscv lmul instruments"
Vitaly Buka [Sat, 13 May 2023 06:26:59 +0000 (23:26 -0700)]
Revert "[RISCV][llvm-mca] Add mca tests for riscv lmul instruments"

Memory leaks https://lab.llvm.org/buildbot/#/builders/5/builds/33657

This reverts commit 1e317c3f819c7b42f8b45383438004193d3344d4.

14 months agogithub: Remove pull request template
Tom Stellard [Sat, 13 May 2023 06:29:02 +0000 (23:29 -0700)]
github: Remove pull request template

We've opened up pull requests for libcxx so we don't need this template
any more.  Also, the repo-lockdown job already adds the same comment
when closing pull requests.

Reviewed By: ldionne

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

14 months ago[ELF] Remove remnant ranks for PPC64 ELFv1 special sections
Fangrui Song [Sat, 13 May 2023 06:21:14 +0000 (23:21 -0700)]
[ELF] Remove remnant ranks for PPC64 ELFv1 special sections

14 months agoworkflows/repo-lockdown: Ignore libcxx and related sub-directories
Tom Stellard [Sat, 13 May 2023 06:19:56 +0000 (23:19 -0700)]
workflows/repo-lockdown: Ignore libcxx and related sub-directories

https://discourse.llvm.org/t/opening-up-prs-experimentally-for-a-subset-of-the-llvm-project/70375/11

Reviewed By: ldionne

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

14 months ago[clang-tidy] Modernize RangeDescriptor (NFC)
Kazu Hirata [Sat, 13 May 2023 06:19:19 +0000 (23:19 -0700)]
[clang-tidy] Modernize RangeDescriptor (NFC)

14 months ago[clang] Fix typos in documentation
Kazu Hirata [Sat, 13 May 2023 06:19:17 +0000 (23:19 -0700)]
[clang] Fix typos in documentation

14 months agoASan: unbreak Windows build by limiting backtrace* tests to glibc
Thurston Dang [Sat, 13 May 2023 05:56:28 +0000 (05:56 +0000)]
ASan: unbreak Windows build by limiting backtrace* tests to glibc

My newly added backtrace test (https://reviews.llvm.org/D150491)
broke the Windows buildbot (https://lab.llvm.org/buildbot/#/builders/127/builds/48103)
because they do not have execinfo.h.
I expect the same will happen with the backtrace_symbols test (https://reviews.llvm.org/D150498) as well.

This patch does a quick fix by restricting the test scope to glibc-2.27.
(A tricker fix would take into account SANITIZER_INTERCEPT_BACKTRACE,
which is defined as (SI_FREEBSD || SI_NETBSD || SI_GLIBC || SI_SOLARIS))

14 months agoASan: add backtrace_symbols test and clarify code is correct
Thurston Dang [Sat, 13 May 2023 00:00:31 +0000 (00:00 +0000)]
ASan: add backtrace_symbols test and clarify code is correct

This is another patch for https://github.com/google/sanitizers/issues/321
(sanitizer interceptors can write to freed memory, causing corruption),
in this case for backtrace_symbols.

backtrace_symbols is already correct, hence this patch removes the
TODO note. Additionally, this patch adds a test case for it.

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

14 months ago[Clang][LoongArch] Add GPR alias handling without `$` prefix
Weining Lu [Sat, 13 May 2023 04:06:37 +0000 (12:06 +0800)]
[Clang][LoongArch] Add GPR alias handling without `$` prefix

Currenlty there is a mismatch between LoongArch gcc and clang about
handling register name in inlineasm, i.e. gcc allows both `$`-prefixed
and non-prefiexed names for GPRs while clang only allows `$`-prefixed
one. This patch fixes this mismatch by adding non-prefixed GPR names
in clang.

Take `$r4` for example. With this patch, clang accepts `$r4`, `r4`,
`$a0` and `a0` like what gcc does.

Reviewed By: xen0n

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

14 months agoAdd 'REQUIRES: asserts' to test added in D150002 (53a4adc) because it tests for a...
Douglas Yung [Sat, 13 May 2023 02:01:52 +0000 (19:01 -0700)]
Add 'REQUIRES: asserts' to test added in D150002 (53a4adc) because it tests for a crash that is caused by an assertion failure.

14 months agoReplace None with std::nullopt in comments (NFC)
Kazu Hirata [Sat, 13 May 2023 01:33:26 +0000 (18:33 -0700)]
Replace None with std::nullopt in comments (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

14 months ago[X86][AsmParser] Reapply "Refactor code and optimize more instructions from VEX3...
Shengchen Kan [Sun, 7 May 2023 14:20:36 +0000 (22:20 +0800)]
[X86][AsmParser] Reapply "Refactor code and optimize more instructions from VEX3 to VEX2"

This was reverted in d4994d0e7922 b/c a bolt test failed after the
encoding changed.

Relanded the patch with the updated test.

14 months ago[libc][math] Implement fast division / modulus for UInt / (uint32_t * 2^e).
Tue Ly [Fri, 12 May 2023 19:53:59 +0000 (15:53 -0400)]
[libc][math] Implement fast division / modulus for UInt / (uint32_t * 2^e).

This is to improve a performance bottleneck of printf for long double.

Reviewed By: michaelrj

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

14 months ago[RISCVGatherScatterLowering] Use InstSimplifyFolder
Philip Reames [Sat, 13 May 2023 00:28:19 +0000 (17:28 -0700)]
[RISCVGatherScatterLowering] Use InstSimplifyFolder

Main value of this is simplifying code, and making a few of the tests easier to read.

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

14 months agoReapply "[RISCVGatherScatterLowering] Minor code cleanup [NFC]"
Philip Reames [Sat, 13 May 2023 00:25:26 +0000 (17:25 -0700)]
Reapply "[RISCVGatherScatterLowering] Minor code cleanup [NFC]"

This was reverted in 4e84149c0aea0e9f16c51cc92f50d90992b13d57 due to a problem report which has been confirmed to be misattributed.

Original commit message:

Use a switch to avoid repeat tests on the opcode, and factor out some common code out of another switch.  (Not all branches had both common bits, but the one which didn't left the values unchanged and their starting value is the respective operand - so storing it back is a nop.)

14 months agoRevert "[SuffixTree] Add suffix tree statistics"
Jessica Paquette [Sat, 13 May 2023 00:09:26 +0000 (17:09 -0700)]
Revert "[SuffixTree] Add suffix tree statistics"

This reverts commit d3a6a05b1f95564f2c66f885a83cf0dbe1a004a9.

Some bots don't like it.

Boo.

14 months ago[SuffixTree] Add suffix tree statistics
Jessica Paquette [Fri, 12 May 2023 23:21:43 +0000 (16:21 -0700)]
[SuffixTree] Add suffix tree statistics

Sometimes you want to see how much is being allocated in your data structure
in general.

Add statistics that show how many internal and leaf nodes have been allocated
in the suffix tree over the course of its construction.

Also add a testcase that shows that we actually get these stats out when we're
outlining stuff.

The test shows that we get the expected O(n) leaf nodes, a split, and so on.

14 months ago[mlir][openacc] Add canonicalization pattern for acc.host_data
Valentin Clement [Fri, 12 May 2023 23:56:35 +0000 (16:56 -0700)]
[mlir][openacc] Add canonicalization pattern for acc.host_data

Add if condition removal pattern for acc.host_data in a same way as
acc.enter_data, acc.exit_data and acc.update.

The condition is removed from the op if it is a true constant. If
it is a false constant then the region is inlined before the op
and the op is removed.

Reviewed By: vzakhari

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

14 months ago[LV] Use interface routines instead of internal variables
Philip Reames [Fri, 12 May 2023 23:26:32 +0000 (16:26 -0700)]
[LV] Use interface routines instead of internal variables

This makes a (possible) change to the internal representation easier in the future, and makes the code easier to read now.

14 months agoRevert "[X86][AsmParser] Refactor code and optimize more instructions from VEX3 to...
Alan Zhao [Fri, 12 May 2023 23:08:35 +0000 (16:08 -0700)]
Revert "[X86][AsmParser] Refactor code and optimize more instructions from VEX3 to VEX2"

This reverts commit c13ed1cc75781fccc7cec91017e84341c3047229.

Reason: causes bolt tests to fail: https://crbug.com/1445243

14 months agoRevert "[RISCVGatherScatterLowering] Minor code cleanup [NFC]"
Philip Reames [Fri, 12 May 2023 23:03:38 +0000 (16:03 -0700)]
Revert "[RISCVGatherScatterLowering] Minor code cleanup [NFC]"

This reverts commit 13984608992246e42e66c019f09764650d60af63.  A problem was reported - the attribution seems slightly questionable, but this is low enough value after 297e06c that reverting is easy.

14 months agoASan: add testcase for backtrace interceptor
Thurston Dang [Fri, 12 May 2023 22:47:54 +0000 (22:47 +0000)]
ASan: add testcase for backtrace interceptor

It is a known, longstanding issue that some ASan interceptors
may write to freed memory, causing corruption
(https://github.com/google/sanitizers/issues/321). This patch
adds a testcase for the backtrace interceptor (one of the
known cases).

Reviewed By: vitalybuka

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

14 months ago[AMDGPU] Emit predefined macro `__AMDGCN_CUMODE__`
Yaxun (Sam) Liu [Mon, 6 Mar 2023 01:25:56 +0000 (20:25 -0500)]
[AMDGPU] Emit predefined macro `__AMDGCN_CUMODE__`

Predefine __AMDGCN_CUMODE__ as 1 or 0 when compilation assumes CU or WGP modes.

If WGP mode is not supported, ignore -mno-cumode and emit a warning.

This is needed for implementing device functions like __smid
(https://github.com/ROCm-Developer-Tools/hipamd/blob/312dff7b794337aa040be0691acc78e9f968a8d2/include/hip/amd_detail/amd_device_functions.h#L957)

Reviewed by: Matt Arsenault, Artem Belevich, Brian Sumner

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

14 months ago[MemProf] Set hot/cold new values with option
Teresa Johnson [Fri, 12 May 2023 21:57:58 +0000 (14:57 -0700)]
[MemProf] Set hot/cold new values with option

Adds support to set the hot/cold new hint values with an option. Change
the defaults slightly to make it easier to distinguish between compiler
synthesized vs manually inserted calls to the interface.

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

14 months ago[OpenMP] remove an erroneous assert on the location argument
Vadim Paretsky [Fri, 12 May 2023 22:38:46 +0000 (15:38 -0700)]
[OpenMP] remove an erroneous assert on the location argument

The 'loc' argument is optional, and some compilers (e.g. MSVC) do no supply it.

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

14 months ago[llvm] Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)
Kazu Hirata [Fri, 12 May 2023 22:37:37 +0000 (15:37 -0700)]
[llvm] Migrate {starts,ends}with_insensitive to {starts,ends}_with_insensitive (NFC)

This patch migrates uses of StringRef::{starts,ends}with_insensitive
to StringRef::{starts,ends}_with_insensitive so that we can use names
similar to those used in std::string_view.  I'm planning to deprecate
StringRef::{starts,ends}with_insensitive once the migration is
complete across the code base.

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

14 months ago[OpenMP] Fix GCC build issues and restore "Additional APIs used by the MSVC compiler...
Vadim Paretsky [Fri, 12 May 2023 21:39:16 +0000 (14:39 -0700)]
[OpenMP] Fix GCC build issues and restore "Additional APIs used by the MSVC compiler for loop collapse (rectangular and non-rectangular loops)"

Fixes a GCC build issue (an instance of unallowed typename keyword) and reworks memory allocation
to avoid the use of C++ library based primitives ) in and restores the earlier commit https://reviews.llvm.org/D148393

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

14 months ago[HWASan] unflake test
Florian Mayer [Fri, 12 May 2023 21:24:14 +0000 (14:24 -0700)]
[HWASan] unflake test

The short granule logic made this test flaky because with low
probability there would be no tag mismatch by coincidence.

Reviewed By: vitalybuka

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

14 months agoFix mlir trait documentation typo
Jerry Ge [Fri, 12 May 2023 21:52:11 +0000 (22:52 +0100)]
Fix mlir trait documentation typo

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: I922eeda95223da2c7da0653451e604651b7594bd

Reviewed By: mehdi_amini

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

14 months ago[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier
ziqingluo-90 [Fri, 12 May 2023 21:40:58 +0000 (14:40 -0700)]
[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier

A follow-up change for 6d861d498de1320d22771c329ec69f9419ef06b7:
remove an unnecessary const-qualifier so that the code doesn't have to
remove the qualifier explicitly using `std::remove_const_t`, which
triggers a warning at some bots (e.g.,
https://lab.llvm.org/buildbot/#/builders/247/builds/4442).

14 months agoObjCopy: support `--dump-section` on COFF
Saleem Abdulrasool [Thu, 11 May 2023 22:07:51 +0000 (15:07 -0700)]
ObjCopy: support `--dump-section` on COFF

Add support for --dump-section on COFF files. This is helpful for
extracting specific content from an object file on Windows.

Differential Revision: https://reviews.llvm.org/D150305
Reviewed By: @alexander-shaposhnikov, @jhenderson, @hjyamauchi

14 months ago[test][sanitizers] Disable new test on Android
Vitaly Buka [Fri, 12 May 2023 21:09:16 +0000 (14:09 -0700)]
[test][sanitizers] Disable new test on Android

14 months ago[AArch64] Add test for #62620.
Florian Hahn [Fri, 12 May 2023 20:54:34 +0000 (21:54 +0100)]
[AArch64] Add test for #62620.

14 months ago[llvm-profdata] ProfileReader cleanup - preparation for MD5 refactoring - 3
William Huang [Fri, 12 May 2023 20:40:21 +0000 (20:40 +0000)]
[llvm-profdata] ProfileReader cleanup - preparation for MD5 refactoring - 3

Cleanup profile reader classes to prepare for complex refactoring as propsed in D147740, continuing D148872
This is patch 3/n. This patch changes the behavior of function offset table.

Previously when reading ExtBinary profile, the funcOffsetTable (map) is always populated, and in addition if the profile is CS, the orderedFuncOffsets (list) is also populated. However when reading the function samples, only one of the container is being used, never both, so it's a huge waste of time to populate both. Added logic to select which one to use, and completely skip reading function offset table if we are in tool mode (all function samples are to be read sequentially regardless)

Reviewed By: davidxl, wenlei

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

14 months ago[flang] Fixed global name creation for literal constants.
Slava Zakharin [Wed, 10 May 2023 02:50:48 +0000 (19:50 -0700)]
[flang] Fixed global name creation for literal constants.

The global names were created using a hash based on the address
of std::vector::data address. Since the memory may be reused
by different std::vector's, this may cause non-equivalent
constant expressions to map to the same name. This is what is happening
in the modified flang/test/Lower/constant-literal-mangling.f90 test.

I changed the name creation to use a map between the constant expressions
and corresponding unique names. The uniquing is done using a name counter
in FirConverter. The effect of this change is that the equivalent
constant expressions are now mapped to the same global, and the naming
is "stable" (i.e. it does not change from compilation to compilation).

Though, the issue is not HLFIR specific it was affecting several tests
when using HLFIR lowering.

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

14 months ago[mlir][tosa] Add accumulator type attribute to TOSA dialect
TatWai Chong [Fri, 12 May 2023 19:55:45 +0000 (19:55 +0000)]
[mlir][tosa] Add accumulator type attribute to TOSA dialect

Tosa supports fp16 and fp32 accumulator type for fp16 input, but
no way to tell for computational operators whether accumulator
should be fp16 or fp32 from input type. Add this new attribute
to specify the type.

Set to fp32 by default for now. When the time fp16 is supported,
the accumulator type can be selected based on trade-off between
performance and accuracy.

Reviewed By: jpienaar

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

14 months ago[lldb][NFCI] Replace use of DWARFAttribute in DWARFAbbreviationDecl
Alex Langford [Fri, 12 May 2023 01:28:32 +0000 (18:28 -0700)]
[lldb][NFCI] Replace use of DWARFAttribute in DWARFAbbreviationDecl

DWARFAttribute is used in 2 classes: DWARFAbbreviationDecl and
DWARFAttributes. The former stores a std::vector of them and the latter
has a small structure called AttributeValue that contains a
DWARFAttribute. DWARFAttributes maintains a llvm::SmallVector of
AttributeValues.

My end goal is to have `DWARFAttributes` have a llvm::SmallVector
specialized on DWARFAttribute. In order to do that, we'll have to move
the other elements of AttributeValue into DWARFAttribute itself. But we
don't want to do this while DWARFAbbreviationDecl is using
DWARFAttribute because it will needlessly increase the size of
DWARFAbbreviationDecl. So instead I will create a small type containing
only what DWARFAbbreviationDecl needs and call it `AttributeSpec`. This
is the exact same thing that LLVM does today.

I've elected to swap std::vector for llvm::SmallVector here with a pre-allocated
size of 8. I've collected time and memory measurements before this change and
after it as well. Using a c++ project with 10,000 object files and no dSYM, I
place a breakpoint by file + lineno and see how long it takes to resolve.

Before this patch:
  Time (mean ± σ):     13.577 s ±  0.024 s    [User: 12.418 s, System: 1.247 s]
Total number of bytes allocated: 1.38 GiB
Total number of allocations: 6.47 million allocations

After this patch:
  Time (mean ± σ):     13.287 s ±  0.020 s    [User: 12.128 s, System: 1.250 s]
Total number of bytes allocated: 1.59 GiB
Total number of allocations: 4.61 million allocations

So we consume more memory than before, but we actually make less allocations on
average.

I also measured with an llvm::SmallVector with a pre-allocated size of 4 instead
of 8 to measure how well it performs:

  Time (mean ± σ):     13.246 s ±  0.048 s    [User: 12.074 s, System: 1.268 s]
Total memory consumption: 1.50 GiB
Total number of allocations: 5.74 million

Of course this data may look very different depending on the actual program
being debugged, but each of the object files had 100+ AbbreviationDeclarations
each with between 0 and 10 Attributes, so I feel this was a fair example to
consider.

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

14 months ago[libc++][PSTL] Move the already implemented functions to the new dispatching scheme
Nikolas Klauser [Tue, 9 May 2023 21:44:13 +0000 (14:44 -0700)]
[libc++][PSTL] Move the already implemented functions to the new dispatching scheme

Reviewed By: ldionne, #libc

Spies: arichardson, pcwang-thead, libcxx-commits, miyuki

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

14 months ago[AMDGPU][GFX908] IndirectCopyToAGPR: Confirm modified register is dst reg of accvgpr_...
Jeffrey Byrnes [Thu, 4 May 2023 16:57:15 +0000 (09:57 -0700)]
[AMDGPU][GFX908] IndirectCopyToAGPR: Confirm modified register is dst reg of accvgpr_write

IndirectCopyToAGPR should be reworked as to avoid optimizing during copy lowering. However, as it stands, the code is buggy. This patch replaces the call to definesRegister with modifiesRegister, and confirms that the dest reg of the found accvgpr_write is in fact the src reg of our copy.

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

Change-Id: Id8a61659ac15565dcb970069d0624f0925a46e6d

14 months ago[RISCV] Move VFMADD_VL DAG combine to a function. NFC
Craig Topper [Fri, 12 May 2023 19:34:07 +0000 (12:34 -0700)]
[RISCV] Move VFMADD_VL DAG combine to a function. NFC

This is preparation for an additional combine.

14 months ago[lldb][NFCI] Delete commented out method OptionValueProperties::GetQualifiedName
Alex Langford [Fri, 12 May 2023 19:33:07 +0000 (12:33 -0700)]
[lldb][NFCI] Delete commented out method OptionValueProperties::GetQualifiedName

14 months ago[test] Fix ftime-trace.cpp on Windows
Fangrui Song [Fri, 12 May 2023 19:23:21 +0000 (12:23 -0700)]
[test] Fix ftime-trace.cpp on Windows

14 months ago[RISCVGatherScatterLowering] Support shl in non-recursive matching
Philip Reames [Fri, 12 May 2023 19:14:51 +0000 (12:14 -0700)]
[RISCVGatherScatterLowering] Support shl in non-recursive matching

We can apply the same logic as for multiply since a left shift is just a multiply by a power of two. Note that since shl is not commutative, we do need to be careful to match sure that the splat is the RHS of the instruction.

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

14 months ago[PowerPC] Adjust tests after e351b9b66da088.
Florian Hahn [Fri, 12 May 2023 19:20:10 +0000 (20:20 +0100)]
[PowerPC] Adjust tests after e351b9b66da088.

Those tests were missed when landing e351b9b66da088.

14 months ago[lldb][NFCI] Change return type of DWARFDebugInfoEntry::GetAttributes
Alex Langford [Thu, 11 May 2023 21:32:36 +0000 (14:32 -0700)]
[lldb][NFCI] Change return type of DWARFDebugInfoEntry::GetAttributes

The purpose of this method is to get the list of attributes of a
DebugInfoEntry. Prior to this change we were passing in a mutable
reference to a DWARFAttributes object and having the method fill it in
for us while returning the size of the filled out list. But
instead of doing that, we can just return a `DWARFAttributes` object
ourselves since every caller creates a new list before calling
GetAttributes.

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

14 months ago[RISCVGatherScatterLowering] Remove restriction that shift must have constant operand
Philip Reames [Fri, 12 May 2023 19:07:20 +0000 (12:07 -0700)]
[RISCVGatherScatterLowering] Remove restriction that shift must have constant operand

This has been present from the original patch which added the pass, and doesn't appear to be strongly justified. We do need to be careful of commutativity.

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

14 months ago[lldb][NFCI] Redefine dw_attr_t typedef with llvm::dwarf::Attribute
Alex Langford [Wed, 10 May 2023 20:18:23 +0000 (13:18 -0700)]
[lldb][NFCI] Redefine dw_attr_t typedef with llvm::dwarf::Attribute

Similar to dw_form_t, dw_attr_t is typedef'd to be a uint16_t. LLVM
defines their type `llvm::dwarf::Attribute` as an enum backed by a
uint16_t. Switching to the LLVM type buys us type checking and the
requirement of explicit casts.

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

14 months agoprofilie inference changes for stale profile matching
spupyrev [Fri, 12 May 2023 17:27:12 +0000 (10:27 -0700)]
profilie inference changes for stale profile matching

This diff facilitates a new stale profile matching in BOLT: D144500

This is a no-op for existing usages of profi (CSSPGO).

Reviewed By: hoy

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

14 months agoAdd additional criteria for hoisting vector.transfer_reads
Harsh Menon [Fri, 12 May 2023 18:09:40 +0000 (11:09 -0700)]
Add additional criteria for hoisting vector.transfer_reads

Non-subview uses of an alloc outside the current loop
can be safely ignored when considering hoisting vector
transfer_reads. This patch adds a condition to check for that
case and updates the unit test accordingly.

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

14 months ago[-Wunsafe-buffer-usage] Move the whole analysis to the end of a translation unit
ziqingluo-90 [Fri, 12 May 2023 18:45:44 +0000 (11:45 -0700)]
[-Wunsafe-buffer-usage] Move the whole analysis to the end of a translation unit

The unsafe-buffer analysis requires a complete view of the translation
unit (TU) to be conservative. So the analysis is moved to the end of a
TU.

A summary of changes made: add a new `IssueWarnings` function in
`AnalysisBasedWarnings.cpp` for TU-based analyses. So far
[-Wunsafe-buffer-usage] is the only analysis using it but there could
be more.  `Sema` will call the new `IssueWarnings` function at the end
of parsing a TU.

Reviewed by: NoQ (Artem Dergachev)

Differential revision: https://reviews.llvm.org/D146342

14 months ago[flang][hlfir] Fixed AssociateOp codegen for 0-dim variables.
Slava Zakharin [Fri, 12 May 2023 02:16:56 +0000 (19:16 -0700)]
[flang][hlfir] Fixed AssociateOp codegen for 0-dim variables.

The codegen tried to fir.convert !fir.box to !fir.ref for this case.
I used BoxAddr under a check for the type mismatch, but I am not sure
if this is the right fix. Maybe it has to be handled in the lowering.

14 months ago[libc++][ranges] Fix `iota_view`'s constructor's incorrect constraint
Hui [Tue, 9 May 2023 16:41:15 +0000 (17:41 +0100)]
[libc++][ranges] Fix `iota_view`'s constructor's incorrect constraint

One of the overload of the constructors should check Bound is not unreachable_sentinel_t, instead of the Start

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

14 months ago[EarlyIfCvt] Don't if-convert if condition has only loop-invariant ops.
Florian Hahn [Fri, 12 May 2023 18:21:03 +0000 (19:21 +0100)]
[EarlyIfCvt] Don't if-convert if condition has only loop-invariant ops.

This patch adds a heuristic to skip if-conversion if the condition has a
high chance of being predictable.

If the condition is in a loop, consider it predictable if the condition
itself or all its operands are loop-invariant. E.g. this considers a load
from a loop-invariant address predictable; we were unable to prove that it
doesn't alias any of the memory-writes in the loop, but it is likely to
read to same value multiple times.

This is a relatively crude heuristic, but it helps to prevent excessive
if-conversion in multiple workloads in practice.

Reviewed By: apostolakis

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

14 months ago[OpenMP] Naturally align internal global variables in the OpenMPIRBuilder
Joseph Huber [Fri, 12 May 2023 17:09:37 +0000 (12:09 -0500)]
[OpenMP] Naturally align internal global variables in the OpenMPIRBuilder

We use this helper to make several internal global variables during
codegen. currently we do not specify any alignment which allows the
alignment to be set incorrectly after some changes in how alignment was
handled. This patch explicitly aligns these variables to the natural
alignment as specified by the data layout

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

Reviewed By: tianshilei1992, gchatelet

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

14 months ago[libc] Check the RPC server once again after the kernel exits
Joseph Huber [Fri, 12 May 2023 16:34:17 +0000 (11:34 -0500)]
[libc] Check the RPC server once again after the kernel exits

We support asynchronous sends, that means that the kernel can issue a
send, then exit the kernel as we do with the `EXIT` syscall. Because of
the condition it's therefore possible for the kernel to exit and break
from the loop before we check the server again. This can potentially
cause us to ignore an `EXIT` call from the GPU.

Reviewed By: JonChesterfield, lntue

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

14 months agoRevert "[mlir][irdl] Add verification of IRDL ops"
Mathieu Fehr [Fri, 12 May 2023 18:45:46 +0000 (19:45 +0100)]
Revert "[mlir][irdl] Add verification of IRDL ops"

This reverts commit 52761cb99164acd4ea76f91fc16a3e40ec94b898.

14 months ago[Driver] -ftime-trace: derive trace file names from -o and -dumpdir
Fangrui Song [Fri, 12 May 2023 17:46:06 +0000 (10:46 -0700)]
[Driver] -ftime-trace: derive trace file names from -o and -dumpdir

Inspired by D133662.
Close https://github.com/llvm/llvm-project/issues/57285

When -ftime-trace is specified and the driver performs both compilation and
linking phases, the trace files are currently placed in the temporary directory
(/tmp by default on *NIX). A more sensible behavior would be to derive the trace
file names from the -o option, similar to how GCC derives auxiliary and dump
file names. Use -dumpdir (D149193) to implement the -gsplit-dwarf like behavior.

The following script demonstrates the time trace filenames.

```
#!/bin/sh -e
PATH=/tmp/Rel/bin:$PATH                # adapt according to your build directory
mkdir -p d e f
echo 'int main() {}' > d/a.c
echo > d/b.c

a() { rm $1 || exit 1; }

clang -ftime-trace d/a.c d/b.c         # previously /tmp/[ab]-*.json
a a-a.json; a a-b.json
clang -ftime-trace d/a.c d/b.c -o e/x  # previously /tmp/[ab]-*.json
a e/x-a.json; a e/x-b.json
clang -ftime-trace d/a.c d/b.c -o e/x -dumpdir f/
a f/a.json; a f/b.json
clang -ftime-trace=f d/a.c d/b.c -o e/x
a f/a-*.json; a f/b-*.json

clang -c -ftime-trace d/a.c d/b.c
a a.json b.json
clang -c -ftime-trace=f d/a.c d/b.c
a f/a.json f/b.json

clang -c -ftime-trace d/a.c -o e/xa.o
a e/xa.json
clang -c -ftime-trace d/a.c -o e/xa.o -dumpdir f/g
a f/ga.json
```

The driver checks `-ftime-trace` and `-ftime-trace=`, infers the trace file
name, and passes `-ftime-trace=` to cc1. The `-ftime-trace` cc1 option is
removed.

With offloading, previously `-ftime-trace` is passed to all offloading
actions, causing the same trace file to be overwritten by host and
offloading actions. This patch doesn't attempt to support offloading (D133662),
but makes a sensible change (`OffloadingPrefix.empty()`) to ensure we don't
overwrite the trace file.

Minor behavior differences: the trace file is now a result file, which
will be removed upon an error. -ftime-trace-granularity=0, like
-ftime-trace, can now cause a -Wunused-command-line-argument warning.

Reviewed By: Maetveis

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

14 months ago[mlir][gpu][sparse] add gpu ops for sparse matrix computations
Aart Bik [Thu, 11 May 2023 20:56:34 +0000 (13:56 -0700)]
[mlir][gpu][sparse] add gpu ops for sparse matrix computations

This revision extends the GPU dialect with ops that can be lowered to
host-oriented sparse matrix library calls (in this case cuSparse focused
although the ops could be generalized to support more GPUs in principle).
This will allow the "sparse compiler pipeline" to accelerate sparse operations
(see follow up revisions with examples of this).

For some background;

https://discourse.llvm.org/t/sparse-compiler-and-gpu-code-generation/69786/2

Reviewed By: ThomasRaoux

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

14 months ago[mlir][irdl] Add verification of IRDL ops
Mathieu Fehr [Wed, 8 Mar 2023 22:16:02 +0000 (23:16 +0100)]
[mlir][irdl] Add verification of IRDL ops

This patch adds verification on registered IRDL operations, types,
and attributes.

This is done through an interface implemented by operations from the
`irdl` dialect, which translate the operations into `Constraint`.
This interface is then use in the `registerDialect` function to
generate verifiers for the entire operation/type/attribute.

Depends on D145733

Reviewed By: Mogball

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

14 months ago[RISCVGatherScatterLowering] Minor code cleanup [NFC]
Philip Reames [Fri, 12 May 2023 17:30:05 +0000 (10:30 -0700)]
[RISCVGatherScatterLowering] Minor code cleanup [NFC]

Use a switch to avoid repeat tests on the opcode, and factor out some common code out of another switch.  (Not all branches had both common bits, but the one which didn't left the values unchanged and their starting value is the respective operand - so storing it back is a nop.)

14 months ago[sanitizers] Remove assert from ThreadArgRetval::Finish
Vitaly Buka [Fri, 12 May 2023 17:05:46 +0000 (10:05 -0700)]
[sanitizers] Remove assert from ThreadArgRetval::Finish

Bionic uses pthread_exit to set retval, when GLIBC does not.
This cause double call to Finish. Rather then tracking this difference
on interceptor size, we can just relax precondition. It does not make
a difference.

14 months agoFix libstdc++ data formatter for reference/pointer to std::string
Jeffrey Tan [Wed, 10 May 2023 21:44:16 +0000 (14:44 -0700)]
Fix libstdc++ data formatter for reference/pointer to std::string

This patch fixes libstdc++ data formatter for reference/pointer to std::string.
The failure testcases are added which succeed with the patch.

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

14 months ago[lldb-vscode] Skip restart tests on ARM
Leandro Lupori [Fri, 12 May 2023 16:32:50 +0000 (13:32 -0300)]
[lldb-vscode] Skip restart tests on ARM

These tests always time out on ARM buildbot. Disabling them for
now, until https://github.com/llvm/llvm-project/issues/62684 is
fixed.

14 months ago[RISCV][llvm-mca] Add mca tests for riscv lmul instruments
Michael Maitland [Thu, 27 Apr 2023 01:19:46 +0000 (18:19 -0700)]
[RISCV][llvm-mca] Add mca tests for riscv lmul instruments

Add llvm-mca tests for RISCV LMUL instruments to show that llvm-mca RISCV LMUL
instruments work.

This commit was previously reverted in ad8765a. This commit adds a lit.local.cfg
to make RISCV llvm-mca tests unsupported on non-RISCV configurations.

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

14 months ago[RISCV] Fix typo in comment. NFC
Craig Topper [Fri, 12 May 2023 16:31:04 +0000 (09:31 -0700)]
[RISCV] Fix typo in comment. NFC

14 months ago[mlir][Linalg] NFC - Retire dead tilePadOp
Nicolas Vasilache [Fri, 12 May 2023 16:12:28 +0000 (09:12 -0700)]
[mlir][Linalg] NFC - Retire dead tilePadOp

14 months ago[mlir][Linalg] NFC - Retire dead FusionOnTensors.cpp
Nicolas Vasilache [Fri, 12 May 2023 15:43:10 +0000 (08:43 -0700)]
[mlir][Linalg] NFC - Retire dead FusionOnTensors.cpp

14 months agoRevert "[RISCV][llvm-mca] Add mca tests for riscv lmul instruments"
Michael Maitland [Fri, 12 May 2023 16:22:11 +0000 (09:22 -0700)]
Revert "[RISCV][llvm-mca] Add mca tests for riscv lmul instruments"

This commit passed buildable tests in phabricator, but fails once
committed.

This reverts commit 1dedc96d04c82e29fff18ee3b875505a158ff93c.

14 months ago[GlobalISel] Handle ptr size != index size in IRTranslator, CodeGenPrepare
Krzysztof Drewniak [Tue, 7 Feb 2023 21:46:11 +0000 (21:46 +0000)]
[GlobalISel] Handle ptr size != index size in IRTranslator, CodeGenPrepare

While the original motivation for this patch (address space 7 on
AMDGPU) has been reworked and is not presently planned to reach IR
translation, the incorrect (by the spec) handling of index offset
width in IR translation and CodeGenPrepare is likely to trip someone
- possibly future AMD, since we have a p7:160:256:256:32 now, so we
convert to the other API now.

Reviewed By: aemerson, arsenm

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

14 months ago[RISCV][llvm-mca] Add mca tests for riscv lmul instruments
Michael Maitland [Thu, 27 Apr 2023 01:19:46 +0000 (18:19 -0700)]
[RISCV][llvm-mca] Add mca tests for riscv lmul instruments

Add llvm-mca tests for RISCV LMUL instruments to show that llvm-mca RISCV LMUL
instruments work.

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

14 months ago[mlir][sparse] minor reorg of sparse tensor tablegen defs
Aart Bik [Fri, 12 May 2023 01:43:47 +0000 (18:43 -0700)]
[mlir][sparse] minor reorg of sparse tensor tablegen defs

Reviewed By: Peiming

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