Commit Graph

417721 Commits

Author SHA1 Message Date
David Sherwood e7b89c2fc3 Add BasicTTIImpl cost model for llvm.get.active.lane.mask intrinsic
The vectoriser sometimes generates predicated vector loops using
the llvm.get.active.lane.mask intrinsic so it's important that we
are able to calculate a valid cost for the call instruction. When
SVE is enabled we are able to use a single whilelo instruction
for some vector types - in such cases I've marked the cost as 1.
For all other cases I've set the cost according to how the intrinsic
will be expanded.

Tests added here:

  Analysis/CostModel/AArch64/sve-intrinsics.ll
  Analysis/CostModel/ARM/active_lane_mask.ll
  Analysis/CostModel/RISCV/active_lane_mask.ll

Differential Revision: https://reviews.llvm.org/D121109
2022-03-14 09:35:05 +00:00
Jean Perier 30a0fbf51f [flang] Add support for linkonce_odr in FIR
Add support for parsing and converting linkonce_odr in FIR.

Differential Revision: https://reviews.llvm.org/D121471
2022-03-14 10:24:44 +01:00
Simon Moll d22ce76999 [VE] Transfer backend ownership
Kazushi Marukawa (kaz7) of NEC Solution Innovators will take over my
role as a code owner for the Vector Engine target. Erich Focht (efocht)
of NEC will assume the administrator role for the clang-ve-ninja
buildbot.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D121453
2022-03-14 09:18:40 +01:00
gysit f2f89751e4 [mlir][linalg] Use explicit replace in canonicalization pattern (NFC).
Introduce an explicit `replaceOp` call to enable the tracking of the producer LinalgOp.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D121369
2022-03-14 07:09:51 +00:00
Mehdi Amini a8648b454e Add cmake_parse_arguments() to `tablegen()` CMake function
This support "DEPENDS" and "EXTRA_INCLUDES", allowing in particular
to inject include paths to a tablegen targets without forcing to go
through the global INCLUDE_DIRECTORIES property.

Differential Revision: https://reviews.llvm.org/D121568
2022-03-14 06:56:11 +00:00
Stanislav Gatev 9e0fc67683 [clang][dataflow] Model the behavior of various optional members
Model `make_optional`, optional's default constructor, `emplace`,
`reset`, and `operator bool` members.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D121378
2022-03-14 06:50:14 +00:00
Tobias Hieta 45ab1904b3 Correctly find builtins library with clang-cl
When using COMPILER_RT_USE_BUILTINS_LIBRARY=ON and clang-cl there
where several places where it didn't work as expected.

First -print-libgcc-file-name has to be prefixed with /clang:

Then the regex that matched the builtins library was wrong because
the builtins library is called clang_rt.builtins_<arch>.lib
and the regex only matched libclang_rt.builtins_arch.a

With this commit you can use a runtime build on Windows with this
option enabled.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D120698
2022-03-14 07:49:29 +01:00
Tobias Hieta c572c6ae56 [cmake] Add LLVM_THINLTO_CACHE_PATH
This allows you to set a custom path to the ThinLTO cache so that
it can be shared when building in several different build directories.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D121215
2022-03-14 07:47:36 +01:00
Kito Cheng 4ece597cd5 [NFC] Fix go binding build
Fix test failure cause by D121332.
2022-03-14 14:08:51 +08:00
Patrick Holland 3e12e83ea4 [MCA] Removed unused variable. 2022-03-13 21:55:56 -07:00
sstwcw c24b3db45c [clang-format] Add option to align compound assignments like `+=`
Reviewed By: curdeius, HazardyKnusperkeks, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D119599
2022-03-14 04:41:40 +00:00
sstwcw 93b5505b45 [clang-format] Extract doc for entire configuration structs
Previously the comments for configuration structs as a whole like
`BraceWrappingFlags` did not go into the doc.

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D120361
2022-03-14 04:41:40 +00:00
sstwcw 65a3712af6 [yamlio] Allow parsing an entire mapping as an enumeration
For when we want to change a configuration option from an enum into a
struct.  The need arose when working on D119599.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D120363
2022-03-14 04:41:40 +00:00
Mehdi Amini 03078ec20b Remove include_directories() from cmake `mlir_tablegen()` function (NFC)
This is present since the beginning, but does not seem needed by any
in-tree target right now. This seems like the kind of thing to populate
by the caller if needed.

Differential Revision: https://reviews.llvm.org/D121565
2022-03-14 04:36:24 +00:00
Patrick Holland 55cedf9cc5 [MCA] Moved six instruction flags from InstrDesc to InstructionBase.
Differential Revision: https://reviews.llvm.org/D121508
2022-03-13 21:21:05 -07:00
Andrew Litteken 0c4bbd293e [IRSim] Make sure the first instruction of a block doesn't get missed if it is the first valid instruction in Module.
If an instruction is first legal instruction in the module, and is the only legal instruction in its basic block, it will be ignored by the outliner due to a length check inherited from the older version of the outliner that was restricted to outlining within a single basic block. This removes that check, and updates any tests that broke because of it.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D120786
2022-03-13 23:13:09 -05:00
Yeting Kuo ae7c6647f3 [RISCV] Add basic code modeling for fixed length vector reduction.
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121447
2022-03-14 11:04:31 +08:00
Craig Topper eeb3bfd74a [RISCV] Merge ReplaceNodeResults code for SHFL and GREV/GORC. NFC 2022-03-13 18:42:26 -07:00
Luo, Yuanke ec06edc6fa [X86] Update avx512vbmi2vl intrinsic tests to avoid adds
As noticed in D119654, by adding the masked intrinsics results together
we can end up with the selects being canonicalized away from the
intrinsic - this isn't what we want to test here so replace with a
insertvalue chain into a aggregate instead to retain all the results.

Differential Revision: https://reviews.llvm.org/D121563
2022-03-14 09:30:15 +08:00
Andrew Litteken 1643f01232 [IRSim][IROutliner] Ignoring Musttail Function
Musttail calls require extra handling to properly propagate the calling convention information and tail call information. The outliner does not currently do this, so we ignore call instructions that utilize the swifttailcc and tailcc calling convention as well as functions marked with the attribute musttail.

Reviewers: paquette, aschwaighofer

Differential Revision: https://reviews.llvm.org/D120733
2022-03-13 19:27:25 -05:00
Andrew Litteken 66f90fdff1 Revert "[IRSim][IROutliner] Ignoring Musttail Function"
This reverts commit c7037c7257.

Pushed too soon
2022-03-13 19:26:51 -05:00
Andrew Litteken c7037c7257 [IRSim][IROutliner] Ignoring Musttail Function 2022-03-13 18:57:24 -05:00
Florian Hahn 1c0fc1f074
[VPlan] Ensure each iv user is only visited once in transform.
If a recipe has multiple uses of an IV, we crash. It causes a crash when
building llvm-test-suite.

Exposed by 95f76bff1c.
2022-03-13 21:42:17 +00:00
Marek Kurdej 0570af1758 [clang-format] Fix incorrect assertion on macro definitions with keyword class.
Fixes https://github.com/llvm/llvm-project/issues/54348.
2022-03-13 22:17:48 +01:00
Marek Kurdej a140b7104f [clang-format] Correctly format variable templates.
Fixes https://github.com/llvm/llvm-project/issues/54257.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D121456
2022-03-13 22:00:17 +01:00
Marek Kurdej 36d13d3f8a [clang-format] Add space to comments starting with '#'.
Fixes https://github.com/llvm/llvm-project/issues/35116.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D121451
2022-03-13 21:56:22 +01:00
Marek Kurdej 596fa2d900 [clang-format] Handle attributes before case label.
Fixes https://github.com/llvm/llvm-project/issues/53110.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D121450
2022-03-13 21:53:40 +01:00
Simon Pilgrim 3e4950d7fa [X86] Update AVX512 intrinsic tests to avoid adds
As noticed in D119654, by adding the masked intrinsics results together we can end up with the selects being canonicalized away from the intrinsic - this isn't what we want to test here so replace with a insertvalue chain into a aggregate instead to retain all the results.
2022-03-13 17:28:45 +00:00
Florian Hahn 1b63434038
[PhaseOrdering] Update naming of blocks after 95f76bff1c. 2022-03-13 17:23:25 +00:00
Simon Pilgrim 56021d0ae0 [X86] Update AVX512VL intrinsic tests to avoid adds
As noticed in D119654, by adding the masked intrinsics results together we can end up with the selects being canonicalized away from the intrinsic - this isn't what we want to test here so replace with a insertvalue chain into a aggregate instead to retain all the results.
2022-03-13 17:20:21 +00:00
Florian Hahn 95f76bff1c
[LV] Create & use VPScalarIVSteps for all scalar users.
This patch is a follow-up to D115953. It updates optimizeInductions
to also introduce new VPScalarIVStepsRecipes if an IV has both vector
and scalar uses.

It updates all uses that only need scalar values to use the newly
created recipe for the scalar steps.

This completes untangling of VPWidenIntOrFpInductionRecipe
code-generation. Now the recipe *only* creates the widened vector
values, as it says on the tin.

The code to genereate IR has been moved directly to
VPWidenIntOrFpInductionRecipe::execute.

Note that the recipe has been updated to hold a reference to
ScalarEvolution, which is needed to expand the step, until we can place
the corresponding SCEV expansion in the pre-header.

Depends on D120827.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D120828
2022-03-13 17:15:24 +00:00
Balazs Benics 665879b9e7 [clang-tidy][docs] Fix wrong url in DontModifyStdNamespaceCheck
It was probably a copy-paste mistake.
The check was added as `cert-dcl58-cpp`, so the doc should point there.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121373
2022-03-13 17:51:00 +01:00
Balazs Benics d321f09926 [clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck
The docs URL was dangling, and the docs suggested that it has no fixits,
but it actually had.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121372
2022-03-13 17:51:00 +01:00
Balazs Benics 200e7a8470 [clang-tidy][docs][NFC] Refer to the CERT rule in bugprone-shared-ptr-array-mismatch docs
Document the connection between this checker and the corresponding CERT
rule.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121214
2022-03-13 17:51:00 +01:00
Joe Loser d2baefae68
[libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI.
All supported compilers that support C++20 now support concepts. So, remove
`_LIB_LIBCPP_HAS_NO_CONCEPTS` in favor of `_LIBCPP_STD_VER > 17`. Similarly in
the tests, remove `// UNSUPPORTED: libcpp-no-concepts`.

Differential Revision: https://reviews.llvm.org/D121528
2022-03-13 12:32:06 -04:00
Sanjay Patel c2592c374e [SDAG] simplify bitwise logic with repeated operand
We do not have general reassociation here (and probably
do not need it), but I noticed these were missing in
patches/tests motivated by D111530, so we can at
least handle the simplest patterns.

The VE test diff looks correct, but we miss that
pattern in IR currently:
https://alive2.llvm.org/ce/z/u66_PM
2022-03-13 11:12:30 -04:00
Sanjay Patel 9f4caf55db [AArch64] add tests for bitwise logic reassociation; NFC
Chooses from a variety of scalar/vector/illegal types
because that should not inhibit any folds.
2022-03-13 11:12:30 -04:00
Simon Pilgrim 1a5a2b3d37 [InstCombine] Add additional icmp eq/ne test coverage for Issue #32161 2022-03-13 14:40:53 +00:00
Groverkss 852a3f969e [MLIR][Presburger][NFC] Fix doc for PresburgerSpace::numLocals 2022-03-13 20:04:23 +05:30
Simon Pilgrim a172876ffc [PhaseOrdering] loop-rotation-vs-common-code-hoisting.ll - merge equivalent check-prefixes 2022-03-13 14:15:40 +00:00
Christian Sigg 732c39fa3b [MLIR][NFC] Fix deprecation message. 2022-03-13 14:17:46 +01:00
Groverkss ff1d9a4b97 [MLIR][Presburger] Add support for PresburgerRelation
This patch adds supports for union of relations (PresburgerRelation).  Along
with this, support for PresburgerSet is also maintained.

This patch is part of a series of patches to add support for relations in
Presburger library.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D121417
2022-03-13 17:31:19 +05:30
Simon Pilgrim ad3a7654dc [X86] combineCMP - peek through zero-extensions for X86cmp(zext(x0),0) zero tests (PR38960)
If we're comparing a value against zero, strip away any zero-extension and perform the comparison on the pre-extended value

Fixes #38308

Differential Revision: https://reviews.llvm.org/D121472
2022-03-13 11:38:40 +00:00
Lehua Ding 1648852c98 [RISCV][RVV] Fix vslide1up/down intrinsics overflow bug for SEW=64 on RV32
Reviewed By: craig.topper, kito-cheng

Differential Revision: https://reviews.llvm.org/D120899
2022-03-13 18:06:09 +08:00
Austin Kerbow 62bcfcb5a5 [AMDGPU] Add llvm.amdgcn.s.setprio intrinsic
Reviewed By: rampitec, arsenm

Differential Revision: https://reviews.llvm.org/D120976
2022-03-12 22:15:42 -08:00
Nimish Mishra e825f49b80 [NFC][flang][OpenMP] Fixes formatting issues with D110714
This NFC fixes formatting issues introduced with https://reviews.llvm.org/D110714

Reviewed By: peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D121186
2022-03-13 17:00:23 +05:30
chhzh123 036088fd6e [MLIR][Python] Add SCFIfOp Python binding
Current generated Python binding for the SCF dialect does not allow
users to call IfOp to create if-else branches on their own.
This PR sets up the default binding generation for scf.if operation
to address this problem.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D121076
2022-03-13 05:24:10 +00:00
Craig Topper fd4d584d6b [RISCV] Add DAGCombine to fold (bitreverse (bswap X)) to brev8 with Zbkb.
If the type is less than XLenVT, type legalization will turn this
into (srl (bitreverse (bswap (srl (bswap X), C))), C). We can't
completely recover from these shifts. They introduce zeros into
the upper bits of the result and we can't easily tell if they are
needed. By doing a DAG combine early, we avoid introducing these
shifts.
2022-03-12 16:39:39 -08:00
Craig Topper b55a77d222 [RISCV] Add Zbp command lines to bswap-bitreverse.ll. NFC 2022-03-12 16:23:42 -08:00
Peter Steinfeld e3550f1903 [flang] Improve runtime crash messages
Where possible, I added additional information to the messages to help
programmers figure out what went wrong.  I also removed all uses of the word
"bad" from the messages since (to me) that implies a moral judgement rather
than a programming error.  I replaced it with either "invalid" or "unsupported"
where appropriate.

Differential Revision: https://reviews.llvm.org/D121493
2022-03-12 15:15:56 -08:00