Commit Graph

424502 Commits

Author SHA1 Message Date
Timm Bäder 8717b492df [clang][driver] Dynamically select gcc-toolset/devtoolset version
And pick the highest one, instead of adding all possibilities to the
prefixes.

Differential Revision: https://reviews.llvm.org/D125862
2022-05-23 11:34:38 +02:00
LiaoChunyu 8e9528cb54 [RISCV][NFC] Test cases for fmuladd intrinsic
These test cases are copy from fma

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D126049
2022-05-23 17:04:31 +08:00
Nikita Popov 5126c38012 [CGP] Freeze condition when despeculating ctlz/cttz
Freeze the condition of the newly introduced conditional branch,
to avoid immediate undefined behavior if the input to ctlz/cttz
was originally poison.

Differential Revision: https://reviews.llvm.org/D125887
2022-05-23 11:01:18 +02:00
Andre Vieira 572fc7d2fd [AArch64] Order STP Q's by ascending address
This patch adds an AArch64 specific PostRA MachineScheduler to try to schedule
STP Q's to the same base-address in ascending order of offsets. We have found
this to improve performance on Neoverse N1 and should not hurt other AArch64
cores.

Differential Revision: https://reviews.llvm.org/D125377
2022-05-23 09:50:44 +01:00
Florian Hahn 0cc981e021
[AArch64] implement isReassocProfitable, disable for (u|s)mlal.
Currently reassociating add expressions can lead to failing to select
(u|s)mlal. Implement isReassocProfitable to skip reassociating
expressions that can be lowered to (u|s)mlal.

The same issue exists for the *mlsl variants as well, but the DAG
combiner doesn't use the isReassocProfitable hook before reassociating.
To be fixed in a follow-up commit as this requires DAGCombiner changes
as well.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D125895
2022-05-23 09:39:00 +01:00
Chuanqi Xu 9e9cf3fa3d Revert "[C++20] [Coroutines] Conform the updates for CWG issue 2585"
This reverts commit 1b89a25a9b.

The test would fail in windows versions.
2022-05-23 16:21:42 +08:00
Peter Waller ade47bdc31 [LV] Improve register pressure estimate at high VFs
Previously, `getRegUsageForType` was implemented using
`getTypeLegalizationCost`.  `getRegUsageForType` is used by the loop
vectorizer to estimate the register pressure caused by using a vector
type.  However, `getTypeLegalizationCost` currently only appears to
understand splitting and not scalarization, so significantly
underestimates the register requirements.

Instead, use `getNumRegisters`, which understands when scalarization
can occur (via computeRegisterProperties).

This was discovered while investigating D118979 (Set maximum VF with
shouldMaximizeVectorBandwidth), where under fixed-length 512-bit SVE the
loop vectorizer previously ends up costing an v128i1 as 2 v64i*
registers where it actually occupies 128 i32 registers.

I'm sending this patch early for comment, I'm still doing some sanity checking
with LNT.  I note that getRegisterClassForType appears to return VectorRC even
though the type in question (large vNi1 types) end up occupying scalar
registers. That might be worth fixing too.

Differential Revision: https://reviews.llvm.org/D125918
2022-05-23 07:57:45 +00:00
David Green 6ef5e242f2 [AArch64] Fix assumptions on input type of tryCombineFixedPointConvert
It is possible for the input type to not be v2i64 or v4i32, so weaken
the assertion to a return, fixing the crash in the new test.

Fixes #55606
2022-05-23 08:55:54 +01:00
Chuanqi Xu 1b89a25a9b [C++20] [Coroutines] Conform the updates for CWG issue 2585
According to the updates in CWG issue 2585
https://cplusplus.github.io/CWG/issues/2585.html, we shouldn't find an
allocation function with (size, p0, …, pn) in global scope.
2022-05-23 15:49:17 +08:00
Sergei Trofimovich 5e9be93566 [Support] Add missing <cstdint> header to Base64.h
Without the change llvm build fails on this week's gcc-13 snapshot as:

    [ 91%] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/Base64Test.cpp.o
    In file included from llvm/unittests/Support/Base64Test.cpp:14:
    llvm/include/llvm/Support/Base64.h: In function 'std::string llvm::encodeBase64(const InputBytes&)':
    llvm/include/llvm/Support/Base64.h:29:5: error: 'uint32_t' was not declared in this scope
       29 |     uint32_t x = ((unsigned char)Bytes[i] << 16) |
          |     ^~~~~~~~
2022-05-23 08:48:14 +01:00
Sergei Trofimovich ff1681ddb3 [Support] Add missing <cstdint> header to Signals.h
Without the change llvm build fails on this week's gcc-13 snapshot as:

    [  0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o
    In file included from llvm/lib/Support/Signals.cpp:14:
    llvm/include/llvm/Support/Signals.h:119:8: error: variable or field 'CleanupOnSignal' declared void
      119 |   void CleanupOnSignal(uintptr_t Context);
          |        ^~~~~~~~~~~~~~~
2022-05-23 08:48:14 +01:00
Gabor Marton 96fba640cf [analyzer][NFC] Factor out the copy-paste code repetition of assumeDual and assumeInclusiveRangeDual
Depends on D125892. There might be efficiency and performance
implications by using a lambda. Thus, I am going to conduct measurements
to see if there is any noticeable impact.
I've been thinking about two more alternatives:
1) Make `assumeDualImpl` a variadic template and (perfect) forward the
   arguments for the used `assume` function.
2) Use a macros.
I have concerns though, whether these alternatives would deteriorate the
readability of the code.

Differential Revision: https://reviews.llvm.org/D125954
2022-05-23 09:32:44 +02:00
Gabor Marton 32f189b0d9 [analyzer] Implement assumeInclusiveRange in terms of assumeInclusiveRangeDual
Depends on D124758. This is the very same thing we have done for
assumeDual, but this time we do it for assumeInclusiveRange. This patch
is basically a no-brainer copy of that previous patch.

Differential Revision:
https://reviews.llvm.org/D125892
2022-05-23 09:32:44 +02:00
Muhammad Omair Javaid b876c23604 Revert "[lldb] Consider binary as module of last resort"
This reverts commit a3c3482ceb.
It broke LLDB API test TestBadAddressBreakpoints.py

Differential revision: https://reviews.llvm.org/D124731
2022-05-23 11:19:48 +05:00
Chenbing Zheng 8c40e16fb4 [InstCombine] add tests for bitcast; NFC 2022-05-23 14:17:01 +08:00
Brad Smith 37ccfc55ab [Sparc] Have test use IAS 2022-05-23 01:22:07 -04:00
Jeremy Furtek 9b79f50b59 [mlir][tblgen][ods][python] Use keyword-only arguments for optional builder arguments in generated Python bindings
This diff modifies `mlir-tblgen` to generate Python Operation class `__init__()`
functions that use Python keyword-only arguments.

Previously, all `__init__()` function arguments were positional. Python code to
create MLIR Operations was required to provide values for ALL builder arguments,
including optional arguments (attributes and operands). Callers that did not
provide, for example, an optional attribute would be forced to provide `None`
as an argument for EACH optional attribute. Proposed changes in this diff use
`tblgen` record information (as provided by ODS) to generate keyword arguments
for:
- optional operands
- optional attributes (which includes unit attributes)
- default-valued attributes

These `__init__()` function keyword arguments have default `None` values (i.e.
the argument form is `optionalAttr=None`), allowing callers to create Operations
more easily.

Note that since optional arguments become keyword-only arguments (since they are
placed after the bare `*` argument), this diff will require ALL optional
operands and attributes to be provided using explicit keyword syntax. This may,
in the short term, break any out-of-tree Python code that provided values via
positional arguments. However, in the long term, it seems that requiring
keywords for optional arguments will be more robust to operation changes that
add arguments.

Tests were modified to reflect the updated Operation builder calling convention.

This diff partially addresses the requests made in the github issue below.

https://github.com/llvm/llvm-project/issues/54932

Reviewed By: stellaraccident, mikeurbach

Differential Revision: https://reviews.llvm.org/D124717
2022-05-21 21:18:53 -07:00
Zi Xuan Wu (Zeson) b86440ecde [CSKY] Fix the conflict of default fpu features and -mfpu option
The arch or cpu has its default fpu features and versions such as fpuv2_sf/fpuv3_sf.
And there is also -mfpu option to specify and override fpu version and features.
For example, C860 has fpuv3_sf/fpuv3_df feature as default, when
-mfpu=fpv2 is given, fpuv3_sf/fpuv3_df is replaced with fpuv2_sf/fpuv2_df.
2022-05-23 10:44:55 +08:00
jacquesguan 10c9ecce9f [mlir][NFC] Replace some nested if with logical and.
This patch replaces some nested if statement with logical and to reduce the nesting depth.

Differential Revision: https://reviews.llvm.org/D126050
2022-05-23 02:04:48 +00:00
Craig Topper c11051a400 [SelectionDAG] Add a freeze to ISD::ABS expansion.
I had initially assumed this was the problem with
https://github.com/llvm/llvm-project/issues/55271#issuecomment-1133426243

But it turns out that was a simpler issue. This patch is still
more correct than what we were doing before so figured I'd submit
it anyway.

No test case because I'm not sure how to get an undef around
until expansion.

Looking at the test deltas I wonder if it be valid to combine
(sext_inreg (freeze (aextload X))) -> (freeze (sextload X)).

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D126175
2022-05-22 14:29:58 -07:00
Craig Topper 768a1ca5ec [SelectionDAG] Fold abs(undef) to 0 instead of undef.
abs should only produce a positive value or the signed minimum
value. This means we can't fold abs(undef) to undef as that would
allow more values. Fold to 0 instead to match InstSimplify.

Fixes test mentioned in comment on pr55271.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D126174
2022-05-22 12:47:32 -07:00
Florian Hahn 419e49621f
[LV] Add check line to test interleaving only with induction cast.
Also simplify the value names a bit in the test.
2022-05-22 20:11:47 +01:00
Aaron Ballman 202a4fde2b Test more C DR conformance (part two of many)
This continues the work started earlier at filling our the C DR status
page based on test coverage.
2022-05-22 13:37:30 -04:00
Florian Hahn 145fe57106
[LV] Use exiting block instead of latch in addUsersInExitBlock.
The latch may not be the exiting block. Use the exiting block instead
when looking up the incoming value of the LCSSA phi node. This fixes a
crash with early-exit loops.
2022-05-22 18:27:41 +01:00
Florian Hahn c230ab6db8
[LV] Re-generate check lines for loop-form.ll test. 2022-05-22 18:20:33 +01:00
NAKAMURA Takumi cd5f3241c3 ADT::GenericCycleInfo: Hide validateTree() in -Asserts.
validateTree() is instantiated with __FILE__.
It will be pruned at link time due to -ffunction-sections but be left in
object files.
Its user is only GenericCycleInfo::compute() with assert(validateTree());
Therefore I think validateTree() may be hidden with NDEBUG.

This is a fixup for https://reviews.llvm.org/D112696
2022-05-23 01:15:02 +09:00
Sanjay Patel cba0ebd576 Revert "[InstCombine] fold icmp with sub and bool"
This reverts commit 4069cccf3b.
This causes bot failures, and there's a possibly a better way to get this and other patterns.
2022-05-22 12:13:20 -04:00
Sanjay Patel 4069cccf3b [InstCombine] fold icmp with sub and bool
This is the specific pattern seen in #53432, but it can be extended
in multiple ways:
1. The 'zext' could be an 'and'
2. The 'sub' could be some other binop with a similar ==0 property (udiv).

There might be some way to generalize using knownbits, but that
would require checking that the 'bool' value is created with
some instruction that can be replaced with new icmp+logic.

https://alive2.llvm.org/ce/z/-KCfpa
2022-05-22 11:51:07 -04:00
Sanjay Patel aa9acb51f6 [InstCombine] add tests for icmp + sub patterns; NFC 2022-05-22 11:51:07 -04:00
Jonas Paulsson e547b04d5b [SystemZ] Bugfix for symbolic displacements.
Properly handle the case where only the second operand of e.g. an MVC
instruction uses a fixup for the displacement.

Reviewed By: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D125982
2022-05-22 17:41:36 +02:00
Florian Hahn 97590baead
[LV] Widen ptr-inductions with scalar uses for scalable VFs.
Current codegen only supports scalarization of pointer inductions for
scalable VFs if they are uniform. After 3bebec659 we now may enter the
scalarization code path in VPWidenPointerInductionRecipe::execute for
scalable vectors.

Fall back to widening for scalable vectors if necessary.

This should fix a build failure when bootstrapping LLVM with SVE, e.g.
https://lab.llvm.org/buildbot/#/builders/176/builds/1723
2022-05-22 16:24:13 +01:00
James Y Knight 69c0af3de2 CWG 1394: Incomplete types as parameters of deleted functions
Follow-up to previous commit: Add a DR test-case so the
make_cxx_dr_status automation works.

Bug: #52802
Fixes: 50b1faf5c1
2022-05-22 10:22:13 -04:00
Paul Walker 258dac43d6 [SVE] Enable use of 32bit gather/scatter indices for fixed length vectors
Differential Revision: https://reviews.llvm.org/D125193
2022-05-22 12:32:30 +01:00
Nathan James 9d0d24eec4
[clang-tidy] Fix not updating storeOptions after af77b1d990 2022-05-22 10:28:52 +01:00
Nathan James af77b1d990
[clang-tidy] add support for Demorgan conversions to readability-simplify-bool-expr
Adds support for recognising and converting boolean expressions that can be simplified using De Morgans Law.

This is a different implementation to D124650.

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

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D124806
2022-05-22 09:28:43 +01:00
Sheng 09865ae95d [NFC][M68k][test] Add disassembler tests for move instructions 2022-05-22 10:35:13 +08:00
Sheng d6994f7ccc [M68k][Disassembler] Fix decoding conflict
This diff fixes decoding conflict between move instructions and
their tail-call counterpart

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D125948
2022-05-22 10:35:12 +08:00
Ping Deng 0e8ac3a797 [LegalizeTypes][VP] Add integer promotion support for vp.sitofp/vp.uitofp
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125960
2022-05-22 02:13:45 +00:00
David Blaikie 0b903ef6aa Re-add release notes for GCC ABI compatibility for non-POD in packed structs 2022-05-22 01:15:34 +00:00
Min-Yih Hsu 52d509f38b [M68k][Disassembler] Cleanup unused variables. NFC
- Remove `MaxInstrWord` in M68kDisassembler.cpp.
  - Remove `MCII` field in `M68kDisassembler` class.

NFC.
2022-05-21 17:23:51 -07:00
owenca 554efc2252 [clang-format] Format unit tests with InsertBraces/RemoveBracesLLVM 2022-05-21 16:13:35 -07:00
owenca 130a9cc0a5 [clang-format] Fix a crash on lambda trailing return type
Fixes #55625.
2022-05-21 15:50:50 -07:00
owenca f4d52cad67 [clang-format] Fix a bug in "AfterControlStatement: MultiLine"
Fixes #55582.

Differential Revision: https://reviews.llvm.org/D125959
2022-05-21 15:10:21 -07:00
owenca 1443dbaba6 [clang-format] Handle "complex" conditionals in RemoveBracesLLVM
Do not remove braces if the conditional of if/for/while might not
fit on a single line even after the opening brace is removed.

Examples:
// ColumnLimit: 20
// 45678901234567890
if (a) { /* Remove. */
  foo();
}
if (-b >= c) { // Keep.
  bar();
}

Differential Revision: https://reviews.llvm.org/D126052
2022-05-21 14:46:38 -07:00
Lang Hames 7be783ab9d [ORC] Check for errors when materializing absolute symbols.
This code previously used cantFail, but both steps (resolution and emission)
can fail if the resource tracker associated with the
AbsoluteSymbolsMaterializationUnit is removed. Checking these errors is
necessary for correct error propagation.
2022-05-21 14:11:53 -07:00
Craig Topper 4638766794 [TypePromotion] Refine fix sext/zext for promoted constant from D125294.
Reviewing the code again, I believe the sext is needed on the LHS
or RHS for ICmp and only on the RHS for Add.

Add an opcode check before checking the operand number.

Fixes PR55627.

Differential Revision: https://reviews.llvm.org/D125654
2022-05-21 14:08:15 -07:00
Lang Hames 55e8f721d4 [ORC] Allow FailedToMaterialize errors to outlive ExecutionSessions.
Idiomatic llvm::Error usage can result in a FailedToMaterialize error tearing
down an ExecutionSession instance. Since the FailedToMaterialize error holds
SymbolStringPtrs and JITDylib references this leads to crashes when accessing
or logging the error.

This patch modifies FailedToMaterialize to retain the SymbolStringPool and
JITDylibs involved in the failure so that we can safely report an error message
to the client, even if the error tears down the session.

The contract for JITDylibs allows the getName method to be used even after the
session has been torn down, but no other JITDylib fields should be accessed via
the FailedToMaterialize error if the ssesion has been torn down. Logging the
error is guaranteed to be safe in all cases.
2022-05-21 13:51:02 -07:00
Balazs Benics ecf5924eb4 [clang-tidy] Add a useful note about -std=c++11-or-later
I and @whisperity spent some time debugging a LIT test case using the
`-std=c++11-or-later` `check_clang_tidy.py` flag when the test had
fixits.

It turns out if the test wants to report a diagnostic into a header
file AND into the test file as well, one needs to first copy the header
somewhere under the build directory.
It needs to be copied since `clang-tidy` sorts the reports into
alphabetical order, thus to have a deterministic order relative to the
diagnostic in the header AND the diagnostic in the test cpp file.

There is more to this story.

The `-std=c++11-or-later` turns out executes the test with multiple
`-std=XX` version substitution, and each execution will also have the
`-fix` tidy parameter. This means that the freshly copied header file I
stated in the previous paragraph gets fixed up and the very next tidy
execution will fail miserably.

Following @whisperity's advice, I'm leaving a reminder about such
//shared// state in the related doc comment.

Reviewed By: LegalizeAdulthood

Differential Revision: https://reviews.llvm.org/D125771
2022-05-21 22:16:55 +02:00
Aaron Ballman 36fde81f93 Fix failing test bots from df46fb4055
Should fix bots like:
https://lab.llvm.org/buildbot/#/builders/188/builds/14403
https://lab.llvm.org/buildbot/#/builders/171/builds/14928
https://lab.llvm.org/buildbot/#/builders/123/builds/10852
(and others)
2022-05-21 16:10:37 -04:00
Florian Hahn aeb19817d6
Revert "[SLP]Do not emit extract elements for insertelements users, replace with shuffles directly."
This reverts commit fc9c59c355.

The patch triggers an assertion when building SPEC on X86. Reduced
reproducer shared at D107966.

Also reverts follow-up commit 11a09af76d.
2022-05-21 21:00:01 +01:00