481953 Commits

Author SHA1 Message Date
Hans Wennborg
ea640472a2 Revert "[llvm] Disable HandleLLVMOptions in runtimes mode (#73031)"
This appears to have caused a variety of breakages, see comments on the PR.

> Summary:
> There are a few default options that LLVM adds that can be problematic
> for runtimes builds. These options are generally intended to handle
> building LLVM itself, but are also added when building in a runtimes
> mode. One such issue I've run into is that in `libc` we deliberately use
> `--target` to use a different device toolchain, which doesn't support
> some linker arguments passed via `-Wl`. This is observed in
> https://github.com/llvm/llvm-project/pull/73030 when attempting to use
> these options.
>
> This patch completely removes these default arguments.
>
> The consensus is that any issues created by this patch should ultimately
> be solved on a per-runtime basis.

This reverts commit ee922e6ebfb6aab722f6b0f7cfc0c20af636a250.
2023-11-28 12:28:59 +01:00
Luke Lau
2a8040e8f6 [RISCV] Avoid looking up base opcode when converting vmerge -> vmv. NFC
This helps avoid a diff in #71764
2023-11-28 19:28:15 +08:00
Haojian Wu
439b16e2b3
[LLDB] Respect the DW_AT_alignment attribute. (#73307)
Part of fixes for #72913.

clang emits `DW_AT_alignment` attribute, however LLDB didn't respect it,
resulting in incorrect RecordDecls built by lldb.

This only fixes non-inheritance cases. The inheritance case will be
handled in a follow-up patch.
2023-11-28 12:27:55 +01:00
Shengchen Kan
c66c15a76d [X86] Rename some variables for memory fold and format code, NFCI
1. Rename the names of tables to simplify the print
2. Align the abbreviation in the same file Instr -> Inst
3. Clang-format
4. Capitalize the first char of the variable name
2023-11-28 19:07:44 +08:00
Corentin Jabot
4142a64ae3 [Clang] Fix compilation with GCC 7.5
Fixes #73628
2023-11-28 12:05:34 +01:00
Mariusz Sikora
facead618b
[AMDGPU] PromoteAlloca - bail always if load/store is volatile (#73228)
This change is addressing case where alloca size is the same as
load/store size.
2023-11-28 12:01:35 +01:00
LLVM GN Syncbot
a05c23fdcf [gn build] Port dd0973be58b8 2023-11-28 10:48:31 +00:00
Pierre van Houtryve
dd0973be58
[TableGen] Split GlobalISelCombinerEmitter into multiple files (#73325)
Split MatchDataInfo, CXXPredicates and the Pattern hierarchy into their
own files.

This should help with maintenance a bit, and make the API easier to
navigate.
I hope this encourages a bit more experimentation with MIR patterns,
e.g. I'd like to try getting them in ISel at some point.

Currently, this is pretty much only moving code around. There is no
significant refactoring in there.
I want to split the Combiner backend even more at some point though,
e.g. by separating the TableGen parsing logic into yet another file so
other backends could very easily parse patterns themselves.

Note: I moved the responsibility of managing string lifetimes into the
backend instead of the Pattern class.
e.g. Before you'd do `P.addOperand(Name)` but now it's
`P.addOperand(insertStrRef(Name))`.
I verified this was done correctly by running the tests with UBSan/ASan.
2023-11-28 11:48:24 +01:00
Simon Pilgrim
eba50929b8 [X86] X86DAGToDAGISel - fix typo in #73126
We were casting the LoadSDNode from the wrong node in the base pointer uses list, meaning the ptr/chain comparison were comparing against themselves.
2023-11-28 10:17:57 +00:00
Florian Hahn
08a6968127
[UTC] Support arm64-apple-macosx in update_llc_test_checks.py. (#73568)
arm64-apple-macosx is the default triple (usually with the macOS version
number) on arm64 macOS. Support it in update_llc_test_checks.py.
2023-11-28 10:06:20 +00:00
Jack Frankland
4a3d2088d6
[mlir][linalg] Add TransposeConv2D Transform Op (#68567)
* Add a LinAlg pass to convert 2D convolutions and quantized 2D
convolutions that have the `FHWC` filter channel ordering into a
transpose followed by 2D convolutions that have the `HWCF` channel
ordering.

* Add a lit test to check the semantics of the transformation are
correct for both quantized and unquantized variants.

Signed-off-by: Jack Frankland <jack.frankland@arm.com>
2023-11-28 09:56:12 +00:00
LLVM GN Syncbot
06157a6d86 [gn build] Port b0af8a1ede89 2023-11-28 09:47:52 +00:00
David Spickett
b0af8a1ede Revert "[lldb] [mostly NFC] Large WP foundation: WatchpointResources (#68845)"
...and follow ups.

As it has caused test failures on Linux Arm and AArch64:
https://lab.llvm.org/buildbot/#/builders/96/builds/49126
https://lab.llvm.org/buildbot/#/builders/17/builds/45824

```
  lldb-shell :: Subprocess/clone-follow-child-wp.test
  lldb-shell :: Subprocess/fork-follow-child-wp.test
  lldb-shell :: Subprocess/vfork-follow-child-wp.test
```

This reverts commit a6c62bf1a4717accc852463b664cd1012237d334,
commit a0a1ff3ab40e347589b4e27d8fd350c600526735 and commit
fc6b72523f3d73b921690a713e97a433c96066c6.
2023-11-28 09:39:37 +00:00
David Spickett
1459c627f0 [lldb][PDB] Fix message order in test case
Launch/stopped ordering was fixed by bd8f1068cad06b0f0342ac7ef351bf01c2e27322
but the Windows on Arm bot wasn't running at the time it landed.
2023-11-28 09:15:51 +00:00
Nikita Popov
b31cd07de5 [Clang] Regenerate test checks (NFC)
The UTC output has changes slightly, regenerate tests to minimize
future diff.
2023-11-28 09:58:30 +01:00
Adrian Kuegel
b7ccaf0bf6 [mlir][Python] Add filegroup for files in mlir/extras.
This is needed after 225648e91ccd951eab9a4ab3200248d5617df1cc
2023-11-28 08:54:44 +00:00
paperchalice
61e58c4dc1
[CodeGen] Port DwarfEHPrepare to new pass manager (#72500)
Co-authored-by: PaperChalice <example@example.com>
2023-11-28 17:53:25 +09:00
Stanislav Mekhanoshin
82d22a1bb4
[AMDGPU] Fixed folding of inline imm into dot w/o opsel (#73589)
A splat packed constant can be folded as an inline immediate but it
shall use opsel. On gfx940 this code path can be skipped due to HW bug
workaround and then it may be folded w/o opsel which is a bug. Fixed.
2023-11-28 00:50:41 -08:00
Nikita Popov
d01237c45b
[InstCombine] Make indexed compare fold GEP source type independent (#71663)
The indexed compare fold converts comparisons of GEPs with same
(indirect) base into comparisons of offset. Currently, it only supports
GEPs with the same source element type.

This change makes the transform operate on offsets instead, which
removes the type dependence. To keep closer to the scope of the original
implementation, this keeps the limitation that we should only have at
most one variable index per GEP.

This addresses the main regression from
https://github.com/llvm/llvm-project/pull/68882.

TBH I have some doubts that this is really a useful transform (at least
for the case where there are extra pointer users, so we have to
rematerialize pointers at some point). I can only assume it exists for a
reason...
2023-11-28 09:16:04 +01:00
Nikita Popov
aefca74d44
[DomTree] Store ReverseChildren as indices (NFC) (#73505)
Store the ReverseChildren using node indices instead of node pointers.
This avoids some more hash table lookups.

I've also increased the size of the SmallVector from 2 to 4. As the
indices are half as large as the pointers (on 64bit) this keeps memory
usage the same as before. I've found the larger SmallVector to perform a
bit better.
2023-11-28 09:10:29 +01:00
Nico Weber
4cf4c52018 Reland "[gn] port 92b821f2dcdd"
This reverts commit 344b5346a0e899d59ff52f60421788eef4e2c864.
92b821f2dcdd relanded in 04072485204c7.
2023-11-28 16:45:20 +09:00
Adrian Kuegel
1d50560335 Revert "[Bazel] Fixes for c43c88501e3bc273a7c1074a19e86dc305ad7234"
This reverts commit aaae104e282505add432ccc76a4adb674087190f.
2023-11-28 07:13:57 +00:00
Aiden Grossman
9166d5318d Reland "[Bazel] Fix llvm-exegesis build post 12b0ab2"
This reverts commit 934efd2c9b9461bf79599cac3f57fc35cff978f7.

This relands commit 1449b349ac4072adb1f593234c1d6f67986d3b6a.

This build system fix was reverted as the underlying patch that required
the fix got reverted due to test failures on Darwin. The test failures
have since been fixed and the patch has relanded, so we need support in
Bazel again.
2023-11-27 22:53:22 -08:00
Rik Huijzer
3247f1e7a2
[mlir][affine] Fix dim index out of bounds crash (#73266)
This PR suggests a way to fix
https://github.com/llvm/llvm-project/issues/70418. It now throws an
error if the `index` operand for `memref.dim` is out of bounds. Catching
it in the verifier was not possible because the constant value is not
yet available at that point. Unfortunately, the error is not very
descriptive since it was only possible to propagate boolean up.
2023-11-28 07:35:09 +01:00
Shengchen Kan
1b1f3c20b5 [X86][CodeGen] Remove duplicated code for the table checks, NFCI 2023-11-28 14:07:32 +08:00
Nishant Mittal
18fd6df885
[libc][math] Add unit tests for raising excepts in nextafter (#73556)
Follow up to
https://github.com/llvm/llvm-project/pull/72763#discussion_r1398277962.

### Summary
- Add unit tests for raising excepts in `nextafter`. 
- Fixed a bug in testing code for `nexttoward`.  

cc: @lntue
2023-11-28 00:50:17 -05:00
Fangrui Song
e2d60c8626 [Frontend] Remove unneeded -frtti check. NFC
-frtti is not a CC1 option. We just need to check -fno-rtti.
2023-11-27 21:41:04 -08:00
Shengchen Kan
f3d2a31d7d [X86][CodeGen] Cleanup code for EVEX2VEX pass, NFCI
1. Remove unused variables, e.g X86Subtarget object in performCustomAdjustments
2. Define checkVEXInstPredicate directly instead of generating it b/c
   the function is small and it's unlikely we have more instructions to
   check the predicate in the future
3. Check the tables are sorted only once for each function
4. Remove some blanks and clang-format code
2023-11-28 13:11:15 +08:00
Fangrui Song
a3ef858968 [mlir,polly] Replace uses of IRBuilder::getInt8PtrTy with getPtrTy. NFC 2023-11-27 20:58:25 -08:00
Aiden Grossman
0407248520 Reland "Reland "[llvm-exegesis] Switch from MCJIT to LLJIT (#72838)"
This reverts commit ea5de6021cf69a233106689cc6f0ee14899e1a83.

This patch was reverted as it broke a test on x86_64 Darwin due to the
symbol naming being different between platforms. As Darwin isn't a
supported platform for executing snippets for llvm-exegesis, we can just
disable the test to fix the issue.
2023-11-27 20:48:40 -08:00
Craig Topper
ffcc5c7796
[RISCV][GISel] Select G_FENCE. (#73184)
Using IR test to make it easier to compare with the SelectionDAG test
output. The constant operands otherwise make it harder to understand.
2023-11-27 20:24:03 -08:00
Shengchen Kan
a3b7b2d635
[X86][CodeGen] Not compress EVEX into VEX when R16-R31 is used (#73604)
b/c VEX prefix can not encode R16-R31.
2023-11-28 11:40:48 +08:00
Kai Luo
00f9946680 [PowerPC] Precommit test of building vector via load and zeros. NFC. 2023-11-28 03:32:57 +00:00
cor3ntin
fdefe88bff
[Clang] Improve support for expression messages in static_assert (#73234)
- Support non-member functions and callable objects for size and data().
We previously tried to (badly) pick the best overload ourselves, in a
way that would only support member functions. We now leave clang
construct an unresolved member expression and call that, properly
performing overload resolution with callable objects and static
functions, consistent with the logic for `get` calls for structured
bindings.
- Support UDLs as message expression.
- Add tests and mark CWG2798 as resolved
2023-11-28 04:28:57 +01:00
Shengchen Kan
4537985ccc [X86][CodeGen] Remove CodeSize settings for instructions, NFCI
CodeSize was designed to used as the 3rd isel sorting tie-breaker.
From observation, it has no impact on X86 ISEL.
2023-11-28 10:59:42 +08:00
yonghong-song
e247e6ff27
[BPF] Add asm support for JSET insn (#73161)
BPF upstream reported that JSET insn is not supported in inline asm
([1]). BPF_JSET insn is part of BPF ISA so let us add asm support for it
now.

[1]
https://lore.kernel.org/bpf/2e8a1584-a289-4b2e-800c-8b463e734bcb@linux.dev/
2023-11-27 18:43:24 -08:00
Nico Weber
5d59e97e88 [gn] port 93a2be26e7cb 2023-11-28 10:44:37 +09:00
Shengchen Kan
d9221da72b
[X86][MC] Keep backward compatibility in inline asm for constraints (#73529)
Not use r16-r31 with 'q','r','l' constraint for backward compatibility
2023-11-28 09:42:03 +08:00
Peiming Liu
1ece4d3a0d
[mlir][sparse] code simplification: always use synthetical tensor for… (#73597)
… loop bound.
2023-11-27 17:41:45 -08:00
Stephan T. Lavavej
a3529aa92e
[libc++][test] Avoid preprocessor directives in macro argument lists (#73440)
Found while running libc++'s test suite with MSVC's STL.

MSVC has a level 1 "warning C5101: use of preprocessor directive in
function-like macro argument list is undefined behavior". I don't know
why Clang doesn't complain about this.

There are some formatting tests which densely interleave preprocessor
directives within function-like macros, and they would need invasive
changes. For now, I'm just skipping those tests.

However, a few tests were only slightly affected, and I was able to add
a new test macro `TEST_IF_AIX` to make them portable.
2023-11-27 17:37:59 -08:00
Andres Villegas
8b3944ca19
[sanitizer_symbolizer] Add initial symbolizer markup support for linux.
This is part of a stack of PRs to add support for symbolizer
markup in linux.

You can check the symbolizer markup specification at:
https://llvm.org/docs/SymbolizerMarkupFormat.html

Reviewers: vitalybuka, PiJoules

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/73193
2023-11-27 17:36:09 -08:00
Douglas Yung
d3143a09ac Add REQUIRES: systemz-registered-target to test added in #68926 (9a38a72). 2023-11-27 17:35:24 -08:00
Aart Bik
79cb594fdf
[mlir][sparse] remove unused COO method (#73595)
step closer towards moving all type related methods into encoding and/or
sparse tensor type class
2023-11-27 17:26:45 -08:00
Maksim Levental
17ec364b1b
[mlir][python] enable registering dialects with the default Context (#72488) 2023-11-27 19:26:05 -06:00
Stephan T. Lavavej
7cbf9598cc
[libc++][test] Avoid using allocator<const T> (#73545)
Found while running libc++'s test suite with MSVC's STL.

MSVC's STL rejects `allocator<const T>`. This may or may not be
justified by the current Standardese (it was bogus in the C++03 era),
but it's how we reject usage like `vector<const T>`.

A bunch of `mdspan` tests are failing for us because some centralized
machinery is using `allocator<const T>`. Testing that `mdspan` and its
associated types work properly with `const T` is good and necessary, but
directly allocating `const T` is what's a problem for MSVC's STL. I'd
like to ask for a very targeted change here that preserves all of the
test coverage but changes how `ElementPool` interacts with `allocator`.

This intentionally leaves `ElementPool::get_ptr()` returning `T*`
(pointer-to-possibly-const), so there's no externally visible
difference.
2023-11-27 17:19:34 -08:00
michaelrj-google
67268da61a
[libc][bazel] Add copts to libc_support_library (#73591)
Most libc_support_library calls are for header-only libraries, but there
are a few that have .cpp files. This patch adds the same base copts to
these that libc_function already has.
2023-11-27 16:53:52 -08:00
Philip Reames
52b413f25a [RISCV] Precommit tests for buildvector lowering with exact VLEN 2023-11-27 16:48:20 -08:00
Jacob Yu
9a7f4bde24
[mlir][arith] doc updates for ub semantics, and int representations (#72932)
Following the discussions in this thread,
https://discourse.llvm.org/t/some-question-on-the-semantics-of-the-arith-dialect/74861,
here are some updates to the documented semantics of Arith.
Added are clarifications on poison behaviour, UBs, overflow semantics,
and the underlying two's complement representation used for integers

Co-authored-by: kuhar <jakubk@openxla.org>
Co-authored-by: math-fehr <mathieu.fehr@gmail.com>
2023-11-27 19:48:06 -05:00
Philip Reames
93e156833b
[DAG] Fix a miscompile in insert_subvector undef (insert_subvector undef, ..), idx combine (#73587)
The combine was implicitly assuming that the index on the outer
insert_subvector meant the same thing when the source was switched to be
the index of the inner insert_subvector. This is not true if the
innermost sub-vector is fixed, and the outer subvector is scalable.

I could do a less restrictive fix here - i.e. allow the case where the
scalability of the subvectors are the same - but there's no test
coverage which shows this transform actually has profit. Given that, go
for the simplest fix.
2023-11-27 16:45:29 -08:00
Andres Villegas
93a2be26e7
[NFC sanitizer_symbolizer] Move Fuchsia specific code.
Moves sanitizer symbolizer code that is specific for
fuchsia into its own _fuchsia.cpp file.
This is preparation to enable symbolizer markup in
linux.

Reviewers: PiJoules, petrhosek, vitalybuka

Reviewed By: PiJoules, vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/73192
2023-11-27 16:32:23 -08:00