Commit graph

414825 commits

Author SHA1 Message Date
Harshil Jain bea53eead1 The device expression must evaluate to a non-negative integer value.
Device clause when it occurs with **target enter data** and **target exit data** must be declared with some non negative value. So some changes were made to evaluate the device clause argument to non negative value and throw the expected error when it takes negative value as argument.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D119141
2022-02-13 16:51:19 +05:30
Florian Hahn 446e7c64c7
[LV] Add real uses in some tests, to make them more robust.
Add real uses to some tests, to ensure dead instructions cannot be directly
removed.
2022-02-13 09:52:59 +00:00
Sheng bf7f8d6fa6 [NFC][RFC][TableGen] Improve the comment about variable len encoder
When, for example, using "ascend" operator, I was wondering whether
the bit order of the dag argument will be reversed in ascend order
as well.

This patch clarifies it.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D119653
2022-02-13 13:15:17 +08:00
Sheng 5fd28e4de1 [NFC][M68k] Fix typo 2022-02-13 13:10:11 +08:00
Fangrui Song 8b01b638d0 [ELF] demoteSharedSymbols: make binding more appropriate for lazy symbols. NFC
The binding will matter if we remove the `sym->replace(und)` kludge from
initializeSymbols.
While here, rename the function to be more appropriate.
2022-02-12 20:43:40 -08:00
Sheng b9a18aa63b [NFC][M68k] Fix indentation 2022-02-13 11:47:35 +08:00
Shilei Tian c27f530d4c [OpenMP][Offloading] Fix infinite loop in applyToShadowMapEntries
This patch fixes the issue that the for loop in `applyToShadowMapEntries`
is infinite because `Itr` is not incremented in `CB`. Fixes #53727.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119471
2022-02-12 22:02:53 -05:00
Phoebe Wang 2aa732a918 [X86][MS] Fix the wrong alignment of vector variable arguments on Win32
D108887 fixed alignment mismatch by changing the caller's alignment in
ABI. However, we found some cases that still assume the alignment is
vector size. This patch fixes them to avoid the runtime crash.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D114536
2022-02-13 10:23:18 +08:00
Arthur Eubanks d050010ea2 [test][MemCpyOpt] Rename test function 2022-02-12 17:44:51 -08:00
Arthur Eubanks 12ba0659b4 [test][MemCpyOpt] Precommit test 2022-02-12 17:38:45 -08:00
Joe Loser 861386dbd6
[libc++] Remove <experimental/filesystem> header
`<filesystem>` header has been around for a while now, so we can safely remove
`<experimental/filesystem>` header. `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`
suggests we were going to remove `<experimental/filesystem>` in llvm 11 release,
but we never did. So, remove the experimental header now, its associated tests,
and the `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM` macro.

Differential Revision: https://reviews.llvm.org/D119603
2022-02-12 19:43:57 -05:00
Simon Pilgrim ea071884b0 [SLP][X86] Add common check prefix for horizontal reduction tests 2022-02-12 21:48:31 +00:00
Craig Topper 478c237e21 [RISCV] Fix incorrect extend type in vwmulsu combine.
While matching widening multiply, if we matched an extend from i8->i32,
i16->i64 or i8->i64, we need to reintroduce a narrower extend. If we're
matching a vwmulsu we need to use a sext for op0 and a zext for op1.

This bug exists in LLVM 14 and will need to be backported.

Differential Revision: https://reviews.llvm.org/D119618
2022-02-12 12:47:20 -08:00
Marek Kurdej 7d5062c6ac [clang-format] Remove unnecessary parentheses in return statements. NFC. 2022-02-12 21:25:52 +01:00
Simon Pilgrim abe1bb763e [clang] MicrosoftCXXNameMangler::mangleObjCKindOfType - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is referenced in the mangleType call, so assert the cast is correct instead of returning nullptr
2022-02-12 20:11:21 +00:00
Simon Pilgrim 5d1e3ed3e2 [clang-tidy] SimplifyBooleanExprCheck - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The IfStmt pointer is always referenced inside the replaceCompoundReturnWithCondition call, so assert the cast is correct instead of returning nullptr
2022-02-12 19:59:30 +00:00
Joseph Huber a0e8077d28 [OpenMP][NFC] Simplify identifying the device bitcode library
Now that the old device runtime has been deleted there is only a single
target that differs by the triple and the architecture. Simplify the
scheme for identifying the library but directly using the triple.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D119638
2022-02-12 14:55:47 -05:00
Mark de Wever 5ffb1047cd [libc++][nfc] Add TEST_HAS_NO_INT128.
This avoids using an libc++ internal macro in our tests.

D117992 removed them, but it seems new occurrences have been introduced.
2022-02-12 20:07:58 +01:00
Nico Weber c07bbbcef9 Revert "[asan] Always skip first object from dl_iterate_phdr"
This reverts commit d75a5650db.
Breaks asan_dlopen_test.cpp on several bots, see comments on
https://reviews.llvm.org/D119515
2022-02-12 14:05:59 -05:00
Florian Hahn 2cd22ce0d0
[LV] Pass start value directly to emitTransformedIndex (NFC). 2022-02-12 19:03:32 +00:00
Nico Weber a908c535f9 Revert "[HWASan] Use hwasan_memalign for aligned new."
This reverts commit 4fb7c120fe.
Breaks tests on Linux were system gcc doesn't support C++17
(but gcc used to build LLVM does), see https://reviews.llvm.org/D119161
2022-02-12 13:57:28 -05:00
phyBrackets de4e855204 Refactor nested if else with ternary operator in CGExprScalar.cpp
Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D119364
2022-02-13 00:15:35 +05:30
Mark de Wever 84bb14599f [libc++][nfc] Add TEST_HAS_NO_THREADS.
This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D119563
2022-02-12 19:24:06 +01:00
Dimitry Andric 7af3d4ab3d Revert "[RISCV] Enable shrink wrap by default"
This reverts commit 5ebdb07e7e.

Enabling shrink wrap by default can cause assertions or crashes, and
these should first be investigated and fixed. For now, reverting the
change so it can be cherry-picked into 14.0.0 is the safest choice.
2022-02-12 19:04:12 +01:00
Simon Pilgrim 9c55b0e121 [X86] LowerFunnelShift - enable v16i16 support 2022-02-12 17:04:59 +00:00
Simon Pilgrim a4ed0c2f03 [X86] combineAndnp - if an input has a zero (after inversion for Op0) in a vector element, then we don't demand that bit/element in the other input
Similar to what we already perform in combineAnd
2022-02-12 16:49:05 +00:00
Benjamin Kramer bee4531bee [MachineSink] Inline getRegUnits
Reg unit sets are uniqued, so no need to wrap it in a set.
2022-02-12 17:46:12 +01:00
Benjamin Kramer 22e69afa3b [MachineRegisterInfo] Simplify code so it matches the description 2022-02-12 17:46:12 +01:00
Sanjay Patel 96b7e0b5a0 [SDAG] clean up scalarizing load transform
I have not found a way to expose a difference for this patch in a test
because it only triggers for a one-use load, but this is the code that
was adapted into D118376 and caused miscompiles. The new code pattern
is the same as what we do in narrowExtractedVectorLoad() (reduces load
width for a subvector extract).

This removes seemingly unnecessary manual worklist management and fixes
the chain updating via "SelectionDAG::makeEquivalentMemoryOrdering()".

Differential Revision: https://reviews.llvm.org/D119549
2022-02-12 11:41:19 -05:00
Simon Pilgrim 1f43367377 [X86] getTargetVShiftNode - Fix Wparentheses gcc warning. 2022-02-12 16:37:24 +00:00
Simon Pilgrim 6320c3e77c [X86] combineAndnp - pull out repeated operands. NFC. 2022-02-12 16:35:24 +00:00
Simon Pilgrim dcf465731d [X86] combineAnd - add SimplifyMultipleUseDemandedBits handling to masked vector element analysis
Extend the existing fold to use SimplifyMultipleUseDemandedBits as well as SimplifyDemandedVectorElts/SimplifyDemandedBits when attempting to simplify based off known zero vector elements.
2022-02-12 15:30:53 +00:00
Sanjay Patel 429f10f5f2 [SDAG] reduce code duplication and fix formatting; NFC 2022-02-12 10:22:13 -05:00
Simon Pilgrim 1e1b60138c [X86] Improve uniform funnelshift/rotation amount handling
To find uniform shift/rotation amounts, we currently use SelectionDAG::getSplatValue which creates a node that extracts the scalar value from the source vector, this makes it more difficult for later combines to remove the extraction and stay on the SIMD unit, and can be a problem when the scalar type is illegal (i.e. i64 vs v2i64 on 32-bit targets).

This patch begins to use SelectionDAG::getSplatSourceVector (which SelectionDAG::getSplatValue uses internally) and adds a new variant of getTargetVShiftNode that takes the source vector and the splat index, and adjusts the vector in place to create the zero-extended value suitable for the SSE PSLL/PSRL/PSRA uniform instructions.

I'm still addressing a number of regressions when used for normal vector shifts, so I've just handled the funnelshift/rotation lowering for this first patch. I can then focus on the yak shaving (SimplifyDemandedBits/Elts in particular) necessary to always use SelectionDAG::getSplatSourceVector.

Differential Revision: https://reviews.llvm.org/D119090
2022-02-12 14:46:30 +00:00
Benjamin Kramer 935a5f67d1 [AffineMap] Move result exprs into trailing storage. NFCI. 2022-02-12 15:24:00 +01:00
Simon Pilgrim 50673f7846 [X86] Regenerate AVG combines with separate AVX1/AVX2 check prefixes 2022-02-12 14:15:57 +00:00
Simon Pilgrim 37cf7275cd [X86] Enable vector splitting of ISD::AVGCEILU nodes on AVX1 and non-BWI targets 2022-02-12 14:04:55 +00:00
Benjamin Kramer a9dcbcfe9f Use AffineMap::getSliceMap where applicable. NFCI. 2022-02-12 14:22:05 +01:00
Michał Górny 919dba9248 [llvm] [cmake] Fix finding modern ounit2
Apparently modern versions of ounit2 can only be found as "ounit2"
rather than "oUnit" version 2.  Update the CMake check to support both
variants.  This makes the OCaml tests run again with ounit2-2.2.4.

Differential Revision: https://reviews.llvm.org/D119079
2022-02-12 13:45:17 +01:00
Aaron Ballman 0dd49a5628 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the eighth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-12 07:25:06 -05:00
Simon Pilgrim 7ad94bd74b [clang-tidy] ContainerSizeEmptyCheck::check - simplify isa<> and dyn_cast<> repeated calls
Just use dyn_cast<> to determine literal + container values from the binop
2022-02-12 11:31:27 +00:00
Simon Pilgrim 2188e61691 [clang-doc] populateParentNamespaces - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr

It's only later iterations of the loop where the getParent() call might return nullptr
2022-02-12 11:28:50 +00:00
Simon Pilgrim fbe0ca576d [clang][sema] checkNoThrow - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 11:18:49 +00:00
Simon Pilgrim f0f4452ed4 [clang][sema] Sema::CheckFreeArguments - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 11:17:02 +00:00
Simon Pilgrim 5e27487fc9 [clang][sema] TryStaticCast - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 11:14:19 +00:00
Simon Pilgrim 869c066ca8 [clang-tidy] RedundantControlFlowCheck::issueDiagnostic - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 11:05:59 +00:00
Simon Pilgrim 9acba5206a [clang-tidy] FunctionASTVisitor::TraverseStmt - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 11:04:20 +00:00
Simon Pilgrim ed5d659038 [clang-tidy] NoexceptMoveConstructorCheck::check - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 10:57:09 +00:00
Simon Pilgrim 99acc0dc64 [clang-tidy] UseNoexceptCheck::check - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-12 10:51:48 +00:00
Simon Pilgrim 003e038264 [clang-tidy] getOutermostNamespace - remove redundant nullptr check
The pointer is always dereferenced
2022-02-12 10:49:54 +00:00