Commit Graph

435060 Commits

Author SHA1 Message Date
Haojian Wu 16987998e6 [clangd] Fix LineFoldingOnly flag is not propagated correctly to ClangdServer.
The Opts.LineFoldingOnly must be set before the clangdServer
construction, otherwise this flag is always false when using clangd in VSCode.

Differential Revision: https://reviews.llvm.org/D133299
2022-09-05 15:55:29 +02:00
Tian Zhou 8fa432be4f [InstCombine] reduce test-for-overflow of shifted value
Fixes #57338.

The added code makes the following transformations:

For unsigned predicates / eq / ne:
icmp pred (x << 1), x --> icmp getSignedPredicate(pred) x, 0
icmp pred x, (x << 1) --> icmp getSignedPredicate(pred) 0, x

Some examples:
https://alive2.llvm.org/ce/z/ckn4cj
https://alive2.llvm.org/ce/z/h-4bAQ

Differential Revision: https://reviews.llvm.org/D132888
2022-09-05 09:51:51 -04:00
Ivan Kosarev 5db8d6fd2b [AMDGPU][CodeGen] Support (base | offset) SMEM loads.
Prevents generation of unnecessary s_or_b32 instructions.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D132552
2022-09-05 14:22:06 +01:00
Haojian Wu b06372ae58 [clangd] NFC, correct template argument type for two RetiredFlags. 2022-09-05 15:20:31 +02:00
Andrey Tretyakov 1268cf6454 [SPIRV] Add tests to improve test coverage
Differential Revision: https://reviews.llvm.org/D133265
2022-09-05 15:52:01 +03:00
Simon Pilgrim bd0801cddf [X86] Cleanup SLM SSE shift and CMPGTQ scheduler model numbers
These were causing weird mismatches for the D103695 script report as I'm trying to enable cost kinds support for vector shift and integer comparisons.

The SSE shifts by (non-constant) scalar are half-rate but still only 1uop and PCMPGT is half-rate and only on Pipe0 (although not as slow as PCMPEQQ which we already handle).
2022-09-05 13:44:05 +01:00
Matthias Springer f7dd9a3206 [mlir][bufferize] Add new debug flag: copy-before-write
If this flag is set, the analysis is skipped and buffers are copied before every write.

Differential Revision: https://reviews.llvm.org/D133288
2022-09-05 14:41:19 +02:00
Nikolas Klauser e0b3356e67 [libc++] Enable rvalue overloads for pair in C++03
We require rvalue support anyways, so let's use it.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D133013
2022-09-05 14:40:17 +02:00
Mehdi Amini d2c7c725c1 Apply clang-tidy fixes for readability-simplify-boolean-expr in NVGPUDialect.cpp (NFC) 2022-09-05 12:34:47 +00:00
Mehdi Amini 2fe37d1c7e Apply clang-tidy fixes for performance-unnecessary-value-param in FoldMemRefAliasOps.cpp (NFC) 2022-09-05 12:34:46 +00:00
Ivan Kosarev 1f550d86b2 [AMDGPU][CodeGen] Pre-commit a test on (base | offset) SMEM loads for D132552.
Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D133021
2022-09-05 13:12:43 +01:00
Mats Petersson aa94eb3877 [FLANG][NFC]Use RTNAME instead of hard-coding for simplify intrinsics
Use the RTNMAE macro (via stringify macros) to generate the name
strings for runtime functions, instead of using strings.
The sequence of macros generate exactly the same string as the
ones used previously, but this will support future changes in
runtime function names.

No functional change.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D132652
2022-09-05 13:06:44 +01:00
Mehdi Amini 89418ddcb5 Plumb write_bytecode to the Python API
This adds a `write_bytecode` method to the Operation class.
The method takes a file handle and writes the binary blob to it.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D133210
2022-09-05 12:02:06 +00:00
Ivan Kosarev f33645301e [AMDGPU][CodeGen] Support (soffset + offset) s_buffer_load's.
Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D130263
2022-09-05 12:53:05 +01:00
Valentin Clement a02f750575
[flang] Create a box instead of a temp to write to a char array
Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D133284
2022-09-05 13:29:21 +02:00
Amara Emerson fb60e50c78 [GlobalISel] Fix a combine crash due to a negative G_INSERT_VECTOR_ELT idx.
These should really be folded away to undef but we shouldn't crash in any case.
2022-09-05 12:10:17 +01:00
Markus Böck f570cc173d [mlir][NFC] Move CodeGenHelpers.cpp from mlir-tblgen to TableGen library
Its header was already part of the TableGen library, but unusable as uses of its functions or classes would lead to undefined references when linking. This fixes that.
2022-09-05 13:05:57 +02:00
Simon Pilgrim 4e6783f866 [DAG] getFreeze()/getNode() - account for operand depth when calling isGuaranteedNotToBeUndefOrPoison (PR57554)
Similar to #57402 - we were calling isGuaranteedNotToBeUndefOrPoison on the freeze operand (with Depth = 0), but wasn't accounting for the fact that a later isGuaranteedNotToBeUndefOrPoison assertion will call from the new node (with Depth = 0 as well) - which will then recursively call isGuaranteedNotToBeUndefOrPoison for its operands with Depth = 1

Fixes #57554
2022-09-05 11:46:46 +01:00
Johannes Reifferscheid 34f4a9ef2a Add ArithBuilder::sub, make add, mul work with IndexTypes.
sgt and slt already worked with IndexTypes, the others did not.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D133285
2022-09-05 12:44:19 +02:00
LLVM GN Syncbot 8f33a3abb3 [gn build] Port d5e26775d0 2022-09-05 10:39:22 +00:00
Nikolas Klauser d5e26775d0 [libc++] Granularize the rest of memory
Reviewed By: ldionne, #libc

Spies: vitalybuka, paulkirth, libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D132790
2022-09-05 12:36:41 +02:00
Emilia Dreamer bd3dd10a8b [clang-format] Concepts: allow identifiers after negation
Previously, the formatter would refuse to treat identifiers within a
compound concept definition as actually part of the definition, if
they were after the negation operator !. It is now made consistent
with the likes of && and ||.

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

Differential Revision: https://reviews.llvm.org/D131978
2022-09-05 12:35:40 +02:00
Emilia Dreamer c6e7752f8e [clang-format] Allow `throw` to be a keyword in front of casts
This makes throw more similar to return. However, unlike return,
it has to more strict as to not remove spaces after usages of throw as
a (deprecated) exception specifier.

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

Differential Revision: https://reviews.llvm.org/D132762
2022-09-05 12:35:39 +02:00
Emilia Dreamer f54d42abcf [clang-format] Don't put `noexcept` on empty line following constructor
With the AlwaysBreakTemplateDeclarations option, having a constructor
template for a type consisting of all-uppercase letters with a
noexcept specifier would put said noexcept specifier on its own blank
line.

This is because the all-uppercase type is understood as a macro-like
attribute (such as DEPRECATED()), and noexcept is seen as the
declaration. However, noexcept is a keyword and cannot be an
identifier on its own.

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

Differential Revision: https://reviews.llvm.org/D132189
2022-09-05 12:35:39 +02:00
Igor Kudrin 84c4efbc6d [ubsan-minimal] Report the address of an error
This implements a FIXME in the runtime library and adds printing the
address at the end of the message as "by 0x123abc". The buffer for the
message is allocated on the stack in a handler, so the stack memory
consumption is slightly increased. No additional external dependencies
are added.

Differential revision: https://reviews.llvm.org/D131914
2022-09-05 14:18:25 +04:00
Florian Hahn 408ebe5e3a
[VPlan] Move VPWidenCallRecipe to VPlanRecipes.cpp (NFC).
Depends on D132585.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D132586
2022-09-05 10:48:29 +01:00
Nicolas Vasilache d2613d5bb5 [mlir][tensor] Add gather/scatter op definitions to the tensor dialect.
Gather/Scatter are examined from first principles in light of our recent progress on tensor-based codegen
and in-place bufferization.

In the future, lowering of these abstractions to operate **inplace** on buffers
will likely require a more powerful buffer representation than strided memref.

General context: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707
Relevant TL;DR parts of the proposal:
- gather: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-gatherop-and-friends-10
- need for more expressive types: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-bufferization-copy-view-and-the-need-for-more-expressive-types-12
- jagged buffer discussion: https://discourse.llvm.org/t/rfc-structured-codegen-beyond-rectangular-arrays/64707#proposal-first-class-jagged-buffer-13

Differential Revision: https://reviews.llvm.org/D130348
2022-09-05 02:02:22 -07:00
Ying Yi 5de4d97a00 Driver tests: remove `REQUIRES: x86-registered-target` and set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`.
When testing clang that has been compiled with -DDEFAULT_SYSROOT set to some path, ps4-ps5-header-search.c would fail.

The test needs to be updated.

    1. Remove unnecessary REQUIRES: x86-registered-target.
    2. Override sysroot to be empty string for the test to succeed when clang is configured with DEFAULT_SYSROOT.
2022-09-05 09:59:47 +01:00
serge-sans-paille ab09043a19 [clang] Fix crash when parsing scanf format string with missing arguments
When parsing a format string with less argument than specified, one should check
argument access because there may be no such argument.

This fixes #57517

Differential Revision: https://reviews.llvm.org/D133197
2022-09-05 10:54:18 +02:00
Christian Sigg 69778121e4 [bazel] NFC: Move licenses declaration from package to function.
The `licences` attribute is deprecated, see https://docs.bazel.build/versions/4.0.0/be/common-definitions.html#common-attributes.
2022-09-05 10:47:06 +02:00
Samuel Parker e893345589 [NFC][TypePromotion] Add test 2022-09-05 09:01:23 +01:00
Nathan Ridge c933453858 Fix build error in StmtPrinterTest.cpp 2022-09-05 03:48:46 -04:00
Nikita Popov 388b684354 [LICM] Separate check for writability and thread-safety (NFCI)
This used a single check to make sure that the object is both
writable and thread-local. Separate them out to make the
deficiencies in the current code more obvious.
2022-09-05 09:43:17 +02:00
Nathan Ridge 898c421975 [clangd] Avoid crash when printing call to string literal operator template
Differential Revision: https://reviews.llvm.org/D132830
2022-09-05 03:42:08 -04:00
Krystian Kuzniarek 961fd77687 [clang-format][docs] Fix incorrect 'clang-format 4' option markers
Introduced by 23a5090c6, some style option markers indicated
'clang-format 4', though their respective options were available in
earlier releases.

Differential Revision: https://reviews.llvm.org/D129934
2022-09-05 09:38:22 +02:00
Chuanqi Xu 69e920d426 [Coroutines] Use LookupAllocationFunction to find allocation functions for coroutines consistently
Previously we may call Sema::FindAllocationFunctions directly to lookup
allocation functions directly instead of using our wrapped lambda
LookupAllocationFunction, which is slightly incosnsistent. It will be
helpful to refactor this for further changes.

Also previously, when we lookup 'operator new(std::size_t, std::nothrow_t)' in
case we found `get_­return_­object_­on_­allocation_­failure` in the
promise_type, the compiler will try to look at the allocation function
in promise_type. However, this is not wanted actually. According to
[dcl.fct.def.coroutine]p10:

> if a global allocation function is selected, the
> ::operator new(size_­t, nothrow_­t) form is used.

So we should only lookup for `::operator (size_t, nothrow_t)` for the
global allocation function. For the allocation function in the
promise_type, the requirement is that it shouldn't throw, which has
already been checked.

Given users generally include headers from standard libs so it will
generally include the <new> header, so this change should be a trivial
one and shouldn't affect almost any user.
2022-09-05 15:20:09 +08:00
Fangrui Song fe70b17fcf [ELF][test] --gc-sections: test SHT_FINI_ARRAY is retained 2022-09-05 00:03:40 -07:00
Fangrui Song bc89663b69 [ELF] MarkLive: remove dead code from D24750. NFC 2022-09-05 00:01:09 -07:00
wanglei bf47954703 [LoongArch] Add more fixups and relocations
This patch makes the assembler support all modifiers defined in gnu-as.
Also changes some diagnostic information.

Differential Revision: https://reviews.llvm.org/D132633
2022-09-05 14:55:18 +08:00
Fangrui Song 36a1ca5835 [ASTReader] Fix -Wunused-private-field in non-assertion builds after D128490. NFC 2022-09-04 23:48:55 -07:00
Fangrui Song 50b7eb91f0 [ELF] Reuse one RelocationScanner to scan all sections. NFC 2022-09-04 23:12:27 -07:00
Craig Topper e529c0a2a0 [TargetLowering] Use ComputeMaxSignificantBits instead of ComputeNumSignBits in expandMUL_LOHI. NFC
The way ComputeNumSignBits was being used was only correct if
OuterBitSize is exactly 2x InnerBitSize. Which is always true,
but not obviously so. Comparing ComputeMaxSignificantBits to
InnerBitSize feels more correct.
2022-09-04 22:35:16 -07:00
Fangrui Song 94ca041905 [ELF] Move scanRelocations into Relocations.cpp. NFC 2022-09-04 21:31:18 -07:00
Fangrui Song c8d9d0000b [ELF] Relocations: set hasDirectReloc only if not ifunc. NFC 2022-09-04 21:30:19 -07:00
Craig Topper 0d1d36cfa6 [X86] Pre-commit tests for D130862. NFC 2022-09-04 21:19:01 -07:00
Craig Topper 45e2809f71 [TargetLowering] Use getShiftAmountConstant. NFC 2022-09-04 20:22:32 -07:00
Chuanqi Xu baa9eae279 [NFC] fix incorrect indentation in docs 2022-09-05 11:05:23 +08:00
gonglingqin bc743bf666 [LoongArch] Add codegen support for fcopysign
Differential Revision: https://reviews.llvm.org/D133185
2022-09-05 11:03:54 +08:00
Chenbing Zheng 3e84a955a3 [InstCombine] Precommit tests for smul_with_overflow. nfc 2022-09-05 10:43:40 +08:00
ZHU Zijia 595c4a3c05 [LLVM][docs] Update CMake.rst to follow the upgrade to C++ 17 [NFC]
Update `CMake.rst` to follow the upgrade to C++ 17 in LLVM.

Reviewed By: thieta, MaskRay

Differential Revision: https://reviews.llvm.org/D133272
2022-09-05 09:56:04 +08:00