Commit Graph

443458 Commits

Author SHA1 Message Date
Vlad Serebrennikov 3d280b0375 [clang] Propely handle tests for open DRs in make_cxx_dr_status
A follow-up to D136133. It was mentioned in #58382 that there is a need
to test for DRs that have not been officially resolved yet. This patch
aims to replace original "hackery" with proper handling for such cases.
Highlights:

- Availability can be suffixed (further) with "open", "drafting", or
  "review", e.g. // dr2565: 16 open, // drXXXX: 16 c++17 drafting
- Checks are implemented to ensure that this suffix corresponds to
  actual issue status
- Non-resolved DRs are counted (stdout of make_cxx_dr_status)
- No changes made to cxx_dr_status.html
- 'c++20' availability suffix added
- Remove 'concurrency' status since it's no longer
  on the list of statuses in CWG Active Issues

Differential Revision: https://reviews.llvm.org/D138901
2022-11-29 06:47:50 -08:00
Alexey Bataev 0cc15050a4 [SLP]Fix PR59230: Use actual vector factor when sorting entries.
When we sort entries for attempting to reorder scalars, need to use
actual vectorization factor, not the number of scalars. Otherwise the
compiler crashes, if the scalars has to be reordered.

Differential Revision: https://reviews.llvm.org/D138819
2022-11-29 06:46:06 -08:00
chenglin.bi 1fd4d91fa6 [InstSimplify] Fold !(X || Y) && X --> false
!(X || Y) && X --> false
https://alive2.llvm.org/ce/z/693Jgv

Fix: [56654](https://github.com/llvm/llvm-project/issues/56654)
Fix: [56780](https://github.com/llvm/llvm-project/issues/56780)

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138853
2022-11-29 22:45:24 +08:00
Dmitry Preobrazhensky 869fc7eabd [AMDGPU][MC][MI100+] Enable VOP3 variants of dot2c/dot4c/dot8c opcodes
Differential Revision: https://reviews.llvm.org/D138494
2022-11-29 17:38:18 +03:00
Ivan Butygin e3f75c1cb7 [mlir][linalg] Allow some fusion on mixed generics
Relax linalg elementwise fusion check to allow mixed consumers. Producer is still required to be fully tensor to avoid potential memref aliasing.

Differential Revision: https://reviews.llvm.org/D138759
2022-11-29 15:35:02 +01:00
Haojian Wu 454a34d2c0 [include-cleaner] Fix -Woverloaded-virtual warning, NFC. 2022-11-29 15:09:56 +01:00
chenglin.bi 0752fb57e4 [InstSimplify] Fold (X || Y) ? false : X --> false
(X || Y) ? false : X --> false
https://alive2.llvm.org/ce/z/y93yUm

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138700
2022-11-29 22:08:50 +08:00
Ivan Butygin 339c87a8a0 [mlir][spirv] Add group ops
Also, gen_spirv_dialect script was broken was broken due to SPV->SPIRV renamings.

Differential Revision: https://reviews.llvm.org/D138756
2022-11-29 15:03:31 +01:00
Vlad Serebrennikov de36be7404 [clang] Update CWG2635 status
A follow-up to D138852. Apparently cxx_dr_status.html was changed
manually there, since make_cxx_dr_status script doesn't generate the
same HTML after that patch landed.

Differential Revision: https://reviews.llvm.org/D138895
2022-11-29 05:54:34 -08:00
Sven van Haastregt b0e4897a1b [OpenCL] Remove arm-integer-dot-product extension pragmas
This extension only adds builtin functions and thus doesn't need to be
included as an extension.  Instead of a pragma, the builtin functions
of the extension can be exposed through enabling preprocessor defines.
2022-11-29 13:26:50 +00:00
Florian Hahn dcac5a2f7a
Revert "Cache memory buffer's name length"
This reverts commit 1824432174.

The change triggers an assertion when building clang on macOS:

FAILED: tools/clang/include/clang/Tooling/Syntax/Nodes.inc
cd /Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1 && /Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/bin/clang-tblgen -gen-clang-syntax-node-list -I /Users/florianhahn/projects/llvm-project/clang/include/clang/Tooling/Syntax -I/Users/florianhahn/projects/llvm-project/clang/include -I/Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/tools/clang/include -I/Users/florianhahn/projects/llvm-project/builds/release-with-assertions/ccache-stage1/include -I/Users/florianhahn/projects/llvm-project/llvm/include /Users/florianhahn/projects/llvm-project/clang/include/clang/Tooling/Syntax/Nodes.td --write-if-changed -o tools/clang/include/clang/Tooling/Syntax/Nodes.inc -d tools/clang/include/clang/Tooling/Syntax/Nodes.inc.d
Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file MemoryBuffer.cpp, line 52.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  clang-tblgen             0x000000010466b68c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  clang-tblgen             0x000000010466a808 llvm::sys::RunSignalHandlers() + 64
2  clang-tblgen             0x000000010466bd60 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001877a92a4 _sigtramp + 56
4  libsystem_pthread.dylib  0x000000018777acec pthread_kill + 288
5  libsystem_c.dylib        0x00000001876b42c8 abort + 180
6  libsystem_c.dylib        0x00000001876b3620 err + 0
7  clang-tblgen             0x00000001046ce150 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getOpenFileImpl<llvm::MemoryBuffer>(int, llvm::Twine const&, unsigned long long, unsigned long long, long long, bool, bool, llvm::Optional<llvm::Align>) (.cold.1) + 0
8  clang-tblgen             0x000000010464a548 llvm::WritableMemoryBuffer::getNewUninitMemBuffer(unsigned long, llvm::Twine const&, llvm::Optional<llvm::Align>) + 496
9  clang-tblgen             0x000000010464a7a0 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getOpenFileImpl<llvm::MemoryBuffer>(int, llvm::Twine const&, unsigned long long, unsigned long long, long long, bool, bool, llvm::Optional<llvm::Align>) + 528
10 clang-tblgen             0x000000010464a254 llvm::ErrorOr<std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>> getFileAux<llvm::MemoryBuffer>(llvm::Twine const&, unsigned long long, unsigned long long, bool, bool, bool, llvm::Optional<llvm::Align>) + 176
11 clang-tblgen             0x000000010466fbbc llvm::TableGenMain(char const*, bool (*)(llvm::raw_ostream&, llvm::RecordKeeper&)) + 1428
12 clang-tblgen             0x0000000104626114 main + 156
13 dyld                     0x0000000187453e50 start + 2544
2022-11-29 13:22:52 +00:00
Archibald Elliott 3c97f6cab9 [Support] Move getHostNumPhysicalCores to Threading.h
This change is focussed on simplifying `Support/Host.h` to only do
target detection. In this case, this function is close in usage to
existing functions in `Support/Threading.h`, so I moved it into there.
The function is also renamed to `llvm::get_physical_cores()` to match
the style of threading's functions.

The big change here is that now if you have threading disabled,
`llvm::get_physical_cores()` will return -1, as if it had not been able
to work out the right info. This is due to how Threading.cpp includes
OS-specific code/headers. This seems ok, as if threading is disabled,
LLVM should not need to know the number of physical cores.

Differential Revision: https://reviews.llvm.org/D137836
2022-11-29 13:14:13 +00:00
John Brawn 6b8900f7f9 [clang][CodeGen] Add default attributes to __clang_call_terminate
When generating __clang_call_terminate use SetLLVMFunctionAttributes
to set the default function attributes, like we do for all the other
functions generated by clang. This fixes a problem where target
features from the command line weren't being applied to this function.

Differential Revision: https://reviews.llvm.org/D138679
2022-11-29 13:09:52 +00:00
serge-sans-paille 1824432174
Cache memory buffer's name length
This avoids repeated calls to strlen while we already know its value.

When preprocessing sqlite3.c, this gives a surprising 2% speedup.

Full benchmark available here: https://llvm-compile-time-tracker.com/compare.php?from=5279e6a7d677cdf4488883b77aacab911318100c&to=389601b0dbdf23cf25167ddfc49b3af5742ebd9a&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D138555
2022-11-29 14:01:06 +01:00
Roy Jacobson c64359ea4c [NFC] fix doc inconsistency in cxx_status 2022-11-29 15:00:40 +02:00
Roy Jacobson 13c3228835 [Clang] Implement LWG3823 for __is_aggregate
LWG3823 says that arrays of incomplete types are aggregates. Fix the clang builtin to match that.

Closes https://github.com/llvm/llvm-project/issues/59002

Reviewed By: cjdb

Differential Revision: https://reviews.llvm.org/D138603
2022-11-29 14:57:47 +02:00
Roy Jacobson 3c75feab3b [clang] Compare constraints before diagnosing mismatched ref qualifiers (GH58962)
As noticed in GH58962, we should only diagnose illegal overloads of member functions
when the ref qualifiers don't match if the trailing constraints are the same.

The fix is to move the existing constraints check earlier in Sema::IsOverload.

Closes https://github.com/llvm/llvm-project/issues/58962

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D138749
2022-11-29 14:57:26 +02:00
Jay Foad 7ab83a7046 [AMDGPU] Better more consistent error check lines
Checking for : before @LINE avoids the unlikely possibility that the
expected error line number happens to be a suffix of the actual one.
2022-11-29 12:55:36 +00:00
Simon Pilgrim 30eff7f29f [DAG] Attempt to replace a mul node with an existing umul_lohi/smul_lohi node (PR59217)
As discussed on Issue #59217, under certain circumstances the DAG can generate duplicate MUL and MUL_LOHI nodes, often during MULO legalization.

This patch attempts to replace MUL nodes with additional uses of the LO result from the MUL_LOHI node

Differential Revision: https://reviews.llvm.org/D138790
2022-11-29 12:51:30 +00:00
Hassnaa Hamdi 02db5603ba [AArch64][SME]: Generate streaming-compatible code for fp-extend-trunc
To generate code compatible to streaming mode:
 - enable custome lowering for TruncStore to avoid crashing
   during legalizing TruncStore for non Integer vector.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D138720
2022-11-29 12:45:53 +00:00
Juan Manuel MARTINEZ CAAMAÑO 5cf6fbc5a0 [NFC][ASAN][AMDGPU] Use CreateNot/CreateIsNotNull instead of more verbose CreateICMP methods
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D138706
2022-11-29 06:36:27 -06:00
Jordan Rupprecht 7d26f9e132 [test] Allow libc++ namespaces besides `__1`
The libc++ data formatter for `std::shared_ptr` allows any namespace, but the test asserts that it must be the default `__1` namespace. Relax the regex to allow anything that looks like `__.*` (although we use `__[^:]*` so we don't match arbitrarily long text).

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D129898
2022-11-29 04:34:40 -08:00
Bjorn Pettersson 0676acb6fd [test] Switch to use -passes syntax in a bunch of test cases
Should cover most of the tests for GVN, GVNHoist, GVNSink, GlobalOpt,
GlobalSplit, InstCombine, Reassociate, SROA and TailCallElim that
had not been updated earlier.
2022-11-29 13:29:02 +01:00
Guillaume Chatelet 543962f024 [Coroutine] Update test to demonstrate bug (D138784) 2022-11-29 12:28:16 +00:00
Hassnaa Hamdi 9c7286f938 [AArch64][SME]: Generate streaming-compatible code for bit counting/select
To generate code compatible to streaming mode:
 - enable custom-lowering ISD::CTLZ and ISD::CTPOP.
 - disable combining OR into BSL.

- Testing files:
 - bit-counting.ll
 - bitselect.ll

Reviewed By: david-arm, sdesmalen

Differential Revision: https://reviews.llvm.org/D138682
2022-11-29 12:24:21 +00:00
Hassnaa Hamdi 17e51cd4f9 [AArch64][SME]: Add precursory tests for D138682
Add testing files:
 - bit-counting.ll
 - bitselect.ll
2022-11-29 12:24:21 +00:00
Jordan Rupprecht 3c10e9c773 [test] Implement layout for unstable std::string garbage formatter tests.
The layout is essentially just reversed from the stable std::string layout.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D138850
2022-11-29 04:22:30 -08:00
Valentin Clement 391efeb538
[flang][NFC] Retrieve binding table from fir.dispatch_table operations
Change how the binding tables are retrived. Use the newly lowered
fir.dispatch_table operations instead of the fir.global type infos.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D138903
2022-11-29 13:22:16 +01:00
Sam McCall a53f89522f [clangd] Heuristic to avoid desync if editors are confused about newline-at-eof
As strange as it seems to our files-are-strings view of the world, some editors
that treat files as arrays of lines can get confused about whether the last line
has a newline or not.

The consequences of failing to handle a bad incremental update are catastrophic.
If an update would be valid except for a missing newline at end of file, pretend
one exists.

This fixes problems still present in neovim where deleting all text often leads
to a desync shortly afterwards: https://github.com/neovim/neovim/issues/17085

Differential Revision: https://reviews.llvm.org/D135508
2022-11-29 13:15:20 +01:00
Jordan Rupprecht cd02e78cd5 [NFC] Make headers self-contained.
Some headers in LLDB work only when considered as textual inclusion, but not if one attempts to use them on their own or with a different context.

- python-typemaps.h: uses Python definitions without using "Python.h".
- RISCVCInstructions.h uses RISC-V register enums without including the enums header.
- RISCVInstructions.h includes EmulateInstructionRISCV.h, but is unnecessary since we forward-declare EmulateInstructionRISCV anyway. Including the header is problematic because EmulateInstructionRISCV.h uses DecodeResult which isn't defined until later in RISCVInstructions.h.

This makes LLDB build cleanly with the "parse_headers" feature [1]. I'm not sure what the analagous CMake option is.

[1] I didn't find public documentation but @MaskRay wrote this up: https://maskray.me/blog/2022-09-25-layering-check-with-clang#parse_headers

Reviewed By: labath, MaskRay

Differential Revision: https://reviews.llvm.org/D138310
2022-11-29 04:14:55 -08:00
Tobias Gysi 36fa80b046 [mlir][llvm] Make additional int debug attribute parameters optional.
The revision makes additional integer debug info parameters such as
line or column numbers optional (e.g. the line and column numbers 0 are
elided when printing, which is in line with the LLVM implementation).

Depends on D138405

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D138437
2022-11-29 14:02:58 +02:00
Thomas Symalla 5f77ee4011 [NFC][AMDGPU] Pre-commit tests for D136432 2022-11-29 12:57:59 +01:00
Jens Massberg 849b650cf3 [clang] Skip defaulted functions in zero-as-null-pointer-constant.
The zero-as-null-pointer-constant check should not fire if it is inside
a defaulted function, e.g. defaulted spaceship operators.
Add C++20 tests with spaceship operators.

Fixes #50221

Differential Revision: https://reviews.llvm.org/D138727
2022-11-29 11:56:10 +01:00
bipmis e9393789a9 [AggressiveInstCombine] Handle the insert point of the merged load correctly.
This patch updates the load insert point of the merged load in AggressiveInstCombine().
This is done to handle the reported test breaks by handling Alias Analysis correctly.

Differential Revision: https://reviews.llvm.org/D137201
2022-11-29 10:53:51 +00:00
Sjoerd Meijer 3ea6a9a469 Recommit "[LoopFlatten] Enable it by default"
The problem in 58441 that was reported after enabling this last time was fixed
in 8e9e22f07b.
2022-11-29 10:45:13 +00:00
Roy Jacobson 3faf1f17a5 [Clang] Implement static operator[]
After accepted in Kona, update the code to accept static operator[] as well.

No big code changes: accept this operator as static in SemaDeclCXX, update AST call generation in SemaOverload and update feature macros + tests accordingly.

Reviewed By: cor3ntin, erichkeane, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D138387
2022-11-29 12:39:52 +02:00
Tobias Gysi be4b49407e [mlir][llvm] Import debug intrinsics from LLVMIR.
Currently, the import of LLVMIR fails if the program contains debug
intrinsics. The revision adds support to import debug intrinsics that
have no debug expression attached and drops all debug intrinsics with a
non-empty debug expression. It also moves the existing debug intrinsics
into the "intr" namespace by deriving from LLVM_IntrOp.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D138405
2022-11-29 12:31:54 +02:00
Pavel Labath 6335deb68b [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()
Previously, we just used the platform name. This worked mostly OK, but
it required adding special handling for any unusual (and potentially
downstream) platform plugins, as evidenced by the hardcoding of the
qemu-user platform.

The current implementation was added in
D121605/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d, which this essentially
reverts and goes back to the previous method of retrieving the platform
name from the platform triple (the "OS" field).

The motivation for D121605 was the ability to retrieve the process
without constructing an SBDebugger object (which would be necessary in a
world where SBPlatforms are managed by SBDebuggers). However, this world
did not arrive (mainly due to other commitments on my part), and I now
think that if we do want to go in that direction, that we should just
create a dummy/empty SBDebugger object for holding the initial
SBPlatform.

One benefit of D121605 was the unification of getPlatform and
getHostPlatform code paths, and I preserve that benefit by unifying them
in the other direction -- using the host SBPlatform for getHostPlatform.

Differential Revision: https://reviews.llvm.org/D138430
2022-11-29 11:29:58 +01:00
Qihan Cai 1147e70e7e [flang] Enable RISC-V for x86CompatibleBehavior in floating point flag
Fixes #59132 by mitigating the behavior of not setting underflow flag on RISC-V platform.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D138503
2022-11-29 21:15:19 +11:00
Simon Tatham e45cbf9923 [ARM,MVE] Update MVE_VMLA_qr for architecture change.
In revision B.q and before of the Armv8-M architecture reference
manual, the vector/scalar forms of the `vmla` and `vmlas` instructions
came in signed and unsigned integer forms, such as `vmla.s8 q0,q1,r2`
or `vmlas.u32 q3,q4,r5`.

Revision B.r has changed this. There are no longer signed and unsigned
versions of these instructions, since they were functionally identical
anyway. Now there is just `vmla.i8` (or `i16` or `i32`, and similarly
for `vmlas`). Bit 28 of the instruction encoding, which was previously
0 for signed or 1 for unsigned, is now expected to be 0 always.

This change updates LLVM to the new version of the architecture. The
obsoleted encodings for unsigned integers are now decoding errors, and
only the still-valid encoding is ever emitted. This shouldn't break
any existing assembly code, because the old signed and unsigned
versions of the mnemonic are still accepted by the assembler (which is
standard practice anyway for all signedness-agnostic MVE integer
instructions).

Reviewed By: dmgreen, lenary

Differential Revision: https://reviews.llvm.org/D138827
2022-11-29 08:47:00 +00:00
Dmitry Makogon a580d2e430 [Test] Update tests for LoopPredication constant ranges widening 2022-11-29 14:09:47 +07:00
Freddy Ye 67e253c354 [NFC][X86] Correct _axor_i32 's pseudo code. 2022-11-29 15:08:17 +08:00
Vitaly Buka ca3c58f0d1 [lsan] Add logs for debugging 2022-11-28 22:59:38 -08:00
Douglas Yung 2f8ac18048 Revert "[clang][deps] During scanning don't emit warnings-as-errors that are ignored with diagnostic pragmas."
This reverts commit eac90d1236.

This change is causing a test failure on the PS4/PS5 bots:
https://lab.llvm.org/buildbot/#/builders/139/builds/31784
https://lab.llvm.org/buildbot/#/builders/216/builds/13476
2022-11-28 21:22:29 -08:00
Petr Hosek bec8a372fc [CMake] Use LLVM_TARGET_TRIPLE in runtimes
This variable is derived from LLVM_DEFAULT_TARGET_TRIPLE by default,
but using a separate variable allows additional normalization to be
performed if needed.

Differential Revision: https://reviews.llvm.org/D137451
2022-11-29 04:08:24 +00:00
Diego Caballero eb7e2998d1 Reland "[mlir][Vector] Re-define masking semantics in vector.transfer ops""
This relands commit 847b5f82a4.

Differential Revision: https://reviews.llvm.org/D138079
2022-11-29 03:36:54 +00:00
Quinn Dawkins c0321edc26 [mlir][gpu] Adding support for transposed mma_load_matrix
Enables transposed gpu.subgroup_mma_load_matrix and updates the lowerings in Vector to GPU and GPU to SPIRV. Needed to enable B transpose matmuls lowering to wmma ops.

Taken over from author: stanley-nod <stanley@nod-labs.com>

Reviewed By: ThomasRaoux, antiagainst

Differential Revision: https://reviews.llvm.org/D138770
2022-11-29 03:35:49 +00:00
Uday Bondhugula f49d069ac0 [MLIR] Make promote single iteration optional on affine-loop-normalize
Make promote single iteration optional on affine-loop-normalize:
introduce a command-line flag and an argument on the utility. Disable it
by default since such a promotion isn't normally expected with loop
normalization: it could drop certain structure or information on the
loops that a user wanted to preserve.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D137605
2022-11-29 07:58:10 +05:30
Uday Bondhugula 9de01f3cff [MLIR] NFC. Change debug name LoopUtils -> loop-utils
Rename DEBUG_TYPE for LoopUtils -> loop-utils to be consistent with the
names used for the other files. Fix clang-tidy warnings on argument name
mismatches.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D138752
2022-11-29 07:56:49 +05:30
Peter Rong a7def9f7f2 [FuzzMutate] New strategy `ShuffleBlockStrategy`
`ShuffleBlockStrategy` will shuffle the instructions in a basic block without breaking the dependency of instructions.
It is implemented as a topological sort, only we randomly select instructions with no dependency.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138339
2022-11-28 17:57:26 -08:00