Commit Graph

481240 Commits

Author SHA1 Message Date
Mehdi Amini
e204b9198a Apply clang-tidy fixes for llvm-else-after-return in GPUToLLVMConversion.cpp (NFC) 2023-11-20 01:40:49 -08:00
Mehdi Amini
ad7937d338 Apply clang-tidy fixes for llvm-qualified-auto in ToLLVMInterface.cpp (NFC) 2023-11-20 01:40:49 -08:00
Mehdi Amini
8b51b62559 Apply clang-tidy fixes for llvm-qualified-auto in ConvertToLLVMPass.cpp (NFC) 2023-11-20 01:40:49 -08:00
Mehdi Amini
d09e86359b Apply clang-tidy fixes for llvm-include-order in ComplexToLLVM.cpp (NFC) 2023-11-20 01:40:49 -08:00
Mehdi Amini
5c1650e7f4 Apply clang-tidy fixes for llvm-else-after-return in AMDGPUToROCDL.cpp (NFC) 2023-11-20 01:40:31 -08:00
Aiden Grossman
27c98958c0 [llvm-exegesis] Preserve rcx and r11 around system call (#72807)
Currently, when making the ioctl system call, we're not preserving rcx
and r11. The system call will clobber these registers, meaning that the
values of the registers in the snippet will be different than expected.
This patch fixes that be preserving the registers around the system
call, similar to how the other registers involved in the making the
system call get preserved.

Fixes #72741.
2023-11-20 01:11:04 -08:00
Aiden Grossman
3300bc34f7 [llvm-exegesis] Fix race condition in subprocess mode (#72778)
If there were some scheduler effects where something like the parent
process got interrupted while the child process continued to run, there
would be nothing blocking it from exiting before the parent process
issued a PTRACE_ATTACH call. This would cause transient failures as this
occurred pretty rarely. This patch removes the possibility of a
transient failure by ensuring that the parent process attaches to the
child process before sending the counter file descriptor through the
socket, ensuring that the child process has at most progressed to being
blocked in the read call for the counter file descriptor.
2023-11-20 01:10:42 -08:00
Aiden Grossman
2470857fe7 [NewPM] Remove ScalarizerLegacyPass (#72814)
This pass isn't used anywhere upstream and thus has no test coverage.
Because of these reasons, remove it.
2023-11-20 01:09:27 -08:00
Sunil Kuravinakop
edd675ac28 [OpenMP] atomic compare fail : Parser & AST support
Diff Revision: https://reviews.llvm.org/D123235
2023-11-20 03:05:31 -06:00
Aiden Grossman
4671f18906 [NewPM] Remove LowerWidenableConditionLegacyPass (#72818)
This legacy pass isn't used anywhere upstream and thus has no test
coverage, so remove it.
2023-11-20 01:03:10 -08:00
Aiden Grossman
72ab99500f [NewPM] Remove AssumeBundleBuilderPassLegacyPass (#72817)
This pass isn't used upstream anywhere and doesn't have have a
create...() function, thus isn't tested anywhere. Because of this,
remove it.
2023-11-20 01:02:52 -08:00
Aiden Grossman
3cc523d935 [NewPM] Remove UnifyFunctionExitNodesLegacyPass (#72816)
UnifyFunctionExitNodesLegacyPass isn't used anywhere in upstream and
thus isn't tested at all. For these reasons, remove it.
2023-11-20 01:02:33 -08:00
Diana
61332cb047 [AMDGPU] Emit backend_stack_size PAL metadata (#72509)
For chain functions, PAL uses a `backend_stack_size` metadata item,
which at the moment has the same meaning as `stack_frame_size_in_bytes`.
We emit both for now in order to simplify coordination with PAL.

The new item must be emitted in the `shader_functions` section, just as
the metadata for other module entry functions. For simplicity, we mark
chain functions as module entry functions and emit the same metadata for
all of them.
2023-11-20 10:01:13 +01:00
Alex Zinenko
7e65dc72c4 Revert "Apply clang-tidy fixes for misc-include-cleaner in IRCore.cpp (NFC)"
This reverts commit 0d109035c2.

Changes make Python bindings unbuildable without additional cmake
modifications (or modified `$PATH`).

```
/llvm-project/mlir/lib/Bindings/Python/IRCore.cpp:33:10: fatal error: 'funcobject.h' file not found
```

This header is provided by cpython, and we are not looking for that in
cmake.

Moreover, the nature of this change is not very clear to me. Seems to
replace one include with two dozens, presumably because the code is only
using transitively included headers, but the value for readability is
dubious. LLVM is also not strictly following IWYU.
2023-11-20 09:00:40 +00:00
Aiden Grossman
8319e222c8 [NewPM] Remove MergedLoadStoreMotionLegacyPass (#72813)
This pass isn't used anywhere and thus isn't tested anywhere. Because of
these reasons, remove it.
2023-11-20 01:00:24 -08:00
Aiden Grossman
cd11a7fba4 [NewPM] Remove LoopInstSimplifyLegacyPass (#72812)
This pass isn't used anywhere and thus has no test coverage. Remove it
for these reasons.

For whatever reason, there was no entry in
`llvm/include/llvm/LinkAllPasses.h` to remove.
2023-11-20 01:00:08 -08:00
Aiden Grossman
b9975cec0e [NewPM] Remove LoopSinkLegacy Pass (#72811)
This pass isn't used anywhere and thus has no test coverage. For these
reasons, remove it.
2023-11-20 00:59:42 -08:00
Aiden Grossman
d715e2c65b [NewPM] Remove GuardWideningLegacyPass (#72810)
This legacy pass isn't used anywhere and there is no test coverage, so
at this point it should be removed.
2023-11-20 00:59:25 -08:00
Cullen Rhodes
bf897d5d77 [mlir][vector] Extend TransferReadDropUnitDimsPattern to support partially-static memrefs (#72142)
This patch extends TransferReadDropUnitDimsPattern to support dropping
unit dims from partially-static memrefs, for example:

%v = vector.transfer_read %base[%c0, %c0], %pad {in_bounds = [true, true]} :
  memref<?x1xi8, strided<[?, ?], offset: ?>>, vector<[16]x1xi8>

Is rewritten as:

%dim0 = memref.dim %base, %c0 : memref<?x1xi8, strided<[?, ?], offset: ?>>
%subview = memref.subview %base[0, 0] [%dim0, 1] [1, 1] :
  memref<?x1xi8, strided<[?, ?], offset: ?>> to memref<?xi8, #map1>
%v = vector.transfer_read %subview[%c0], %pad {in_bounds = [true]}
  : memref<?xi8, #map1>, vector<[16]xi8>

Scalable vectors are now also supported, the scalable dims were being
dropped when creating the rank-reduced vector type. The xfer op can also
have a mask of type 'vector.create_mask', which gets rewritten as long
as the mask of the unit dim is a constant of 1.
2023-11-20 08:39:34 +00:00
Matthew Devereau
cdf6693f07 [AArch64][SME] Add support for sme-fa64 (#70809) 2023-11-20 08:37:52 +00:00
Serge Pavlov
a2e1de1934 [ARM][FPEnv] Lowering of fpenv intrinsics
The change implements lowering of `get_fpenv`, `set_fpenv` and
`reset_fpenv`.

Differential Revision: https://reviews.llvm.org/D81843
2023-11-20 15:08:25 +07:00
Kai Luo
592386400d [PowerPC] Precommit test to show codegen while isel is unavailable. NFC. 2023-11-20 07:28:21 +00:00
Qiu Chaofan
d572c4cdef [PowerPC] Disable float128 on AIX in Clang (#67298)
PowerPC AIX backend does not support float128 at all. Diagnose even when
specifying -mfloat128 to avoid backend crash.

---------

Co-authored-by: Kai Luo <gluokai@gmail.com>
2023-11-20 15:20:57 +08:00
Muhammad Omair Javaid
c1fe190049 Revert "Add new API in SBTarget for loading core from SBFile (#71769)"
This reverts commit e2fb816c4f.
It breaks TestLinuxCore.py on lldb-*-windows. See buildbot below:
https://lab.llvm.org/buildbot/#/builders/219/builds/7014
2023-11-20 11:12:34 +05:00
MaheshRavishankar
7cc54da16f Add @MaheshRavishankar to CODEOWNERS on relevant source files. (#72449) 2023-11-19 21:32:52 -08:00
Luke Lau
933dd03386 [RISCV] Remove checks that MI's info is valid. NFC
It's always guaranteed to be valid since we compute it ourselves from MI.
This should simplify an upcoming change in #72352
2023-11-20 13:17:15 +08:00
Luke Lau
69f64dedb0 [RISCV] Use DemandedFields instead of checking for vmv.s.x/vmv.x.s. NFC
The property we're explicitly looking for is whether or not MI only cares about
VL zeroness and not VL itself, so we can just use DemandedFields for this. This
should simplify an upcoming change in #72352
2023-11-20 13:16:54 +08:00
HaohaiWen
95d584c6ac [InstCombine] Convert or concat to fshl if opposite or concat exists (#68502)
If there are two 'or' instructions concat variables in opposite order
and the first 'or' dominates the second one, the second 'or' can be
optimized to fshl to rotate shift first 'or'. This can eliminate an shl
and expose more optimization opportunity for bswap/bitreverse.
2023-11-20 13:12:55 +08:00
Piyou Chen
3494c555c9 [RISCV] postpone removal in initundef pass (#71661)
InitUndef pass need replace the implicit def with Undef pseudo, but
current remove method will make noreg2implicit borken.

This patch postpone the removal until all basicblock be processed.
2023-11-20 11:44:27 +08:00
Bill Wendling
a76adfb992 [NFC][Clang] Refactor code to calculate flexible array member size (#72790)
The code that calculates the flexible array member size is big enough to
warrant its own method.
2023-11-19 19:25:10 -08:00
Kai Luo
eb7698254a [PowerPC][EarlyIfConversion] Do not insert isel if subtarget doesn't support isel (#72211)
Some subtargets of PPC don't support `isel` instruction, early-ifcvt
should not insert this instruction.
2023-11-20 09:17:04 +08:00
Jonathan Thackray
0f8406858a [mailmap] Add my entry 2023-11-20 00:16:53 +00:00
Owen Pan
edad025d1e [clang-format] Correctly annotate braces of empty functions (#72733)
Also fixed some existing test cases.

Fixed #57305.
Fixed #58251.
2023-11-19 15:10:27 -08:00
Owen Pan
cb3a605c5d [clang-format] Fix a bug in isStartOfName() on macro definitions (#72768)
Fixed #72751.
2023-11-19 15:08:54 -08:00
Owen Pan
5860d248a7 [clang-format] Fix a bug in aligning comments above PPDirective (#72791)
Fixed #72785.
2023-11-19 14:59:53 -08:00
Owen Pan
e16a8344d0 [clang-format][NFC] Skip alignArrayInitializers() for 1-row matrices (#72166) 2023-11-19 14:58:44 -08:00
Martin Storsjö
797b68c0ba Revert "[MC][AsmParser] Diagnose improperly nested .cfi frames"
This reverts commit 4323da926f.

This broke building libffi for ARM on Windows (and probably Darwin),
where one extern function intentionally falls through to another
one, while sharing one CFI region.

As long as one isn't using .subsections_via_symbols on MachO,
this probably shouldn't be a hard error.

Secondly, the tested pattern only produces an error on MachO and
COFF targets, but not for ELF, making the error case even more
inconsistent.

Reverting this commit for now, to figure out the best way forward.
2023-11-19 23:22:03 +02:00
Craig Topper
9ae04a77d1 [RISCV] Don't set nsw/nuw/exact flag after MachineCombiner reassociation.
This matches what PowerPC and X86 do.
2023-11-19 11:08:28 -08:00
max
d1e9c7b68c Revert "[mlir][affine] implement promoteIfSingleIteration for AffineForOp (#72547)"
This reverts commit aa6be2f7c9.
2023-11-19 13:07:44 -06:00
Fangrui Song
5603bb5f50 [test] Fix misused Joined -e options
Some tests for the obsoleted NaCl misuse the -e for linking.
2023-11-19 10:38:49 -08:00
Maksim Levental
aa6be2f7c9 [mlir][affine] implement promoteIfSingleIteration for AffineForOp (#72547) 2023-11-19 12:27:41 -06:00
Noah Goldstein
99387e33dc [InstCombine] Add transforms for (icmp uPred (trunc x),(truncOrZext(y)))->(icmp uPred x,y)
Three transforms (all commutative):
https://alive2.llvm.org/ce/z/Bc-nh4

Closes #71309
2023-11-19 12:15:04 -06:00
Noah Goldstein
0f3a9efcbd [InstCombine] Add tests for transforming (icmp eq/ne trunc(x), truncOrZext(y)); NFC 2023-11-19 12:15:04 -06:00
Noah Goldstein
ed7c97e0ad Recommit "[DAGCombiner] Transform (icmp eq/ne (and X,C0),(shift X,C1)) to use rotate or to getter constants." (2nd Try)
Added missing check that the mask and shift amount added up to correct
bitwidth as well as test cases for the bug.

Closes #71729
2023-11-19 12:15:04 -06:00
Noah Goldstein
160a13a0cc [X86] Add more tests for transform (icmp eq/ne (and X,C0),(shift X,C1)); PR71598 2023-11-19 12:15:03 -06:00
Noah Goldstein
f112e4693a [InstCombine] Don't transform sub X, ~Y -> add X, -Y unless Y is actually negatable
This combine was previously adding instruction in some cases (see the
tests).

Closes #72767
2023-11-19 12:15:03 -06:00
Noah Goldstein
3af514e5ae [InstCombine] Add tests for improving sub X, ~Y -> add X, -Y; NFC 2023-11-19 12:15:03 -06:00
Yingwei Zheng
dfe1d35c62 [InstCombine] Propagate NSW/NUW flags for (X - Y) - Z -> X - (Y + Z) (#72693)
Alive2: https://alive2.llvm.org/ce/z/gqeaVo

Related patch:
31d219d299
2023-11-20 00:02:23 +08:00
philnik777
5a305cea52 [libc++] Use __is_pointer_in_range for char_traits checks (#72643)
This allows us to also check the constraints during constant evaluation.
2023-11-19 16:49:40 +01:00
Bill Wendling
42204c94ba Revert "[TargetInstrInfo] enable foldMemoryOperand for InlineAsm (#70743)"
This reverts commit 99ee2db198.

It's causing ICEs in the ARM tests. See the comment here:

99ee2db198
2023-11-19 01:00:46 -08:00