aboutsummaryrefslogtreecommitdiff
path: root/llvm
AgeCommit message (Collapse)AuthorFilesLines
2020-07-07[clangd] Store index in '.cache/clangd/index' instead of '.clangd/index'Sam McCall1-2/+0
Summary: .clangd/index was well-intentioned in 2754942cbaef, but `.clangd` is the best filename for the clangd config file (matching .clang-format and .clang-tidy). And of course we can't have both .clangd/index and .clangd... There are a few overlapping goals to satisfy: - it should be clear from the directory name that this is transient data that is safe to delete at the cost of recomputation, i.e. a cache - it should be easy and self-documenting to blacklist these files in .gitignore - we should have some consistency between filenames in-tree and corresponding files in user storage (e.g. under XDG's ~/.cache/) - we should be consistent across platforms (including windows, which doesn't have distinct cache vs config directories) So the plan is: $PROJECT/.clangd (project config) $PROJECT/.cache/clangd/index/ (project index) $PROJECT/.cache/clangd/modules/ (maybe in future) $XDG_CONFIG_HOME/clangd/config.yaml (user config) $XDG_CACHE_HOME/clangd/index/ (index of non-project files) $XDG_CACHE_HOME/clangd/modules/ (maybe in future) This is sensible if XDG_{CONFIG,CACHE}_HOME coincide, and has a simple .gitignore rule going forward: `.cache/`. The monorepo gitignore is updated to reflect the backwards-compatible practice: ignore .clangd/ (with trailing slash) matching index files from clangd 9/10 ignore .cache matching index from clangd 11+, and potentially other tools. The entries from llvm-project/llvm gitignore are removed (obsolete). Reviewers: kadircet, hokein Subscribers: ilya-biryukov, MaskRay, jkorous, omtcyfz, arphaman, usaxena95, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D83099
2020-07-07[LV] Vectorize without versioning-for-unit-stride under -Os/-OzAyal Zaks7-180/+202
If a loop is in a function marked OptSize, Loop Access Analysis should refrain from generating runtime checks for unit strides that will version the loop. If a loop is in a function marked OptSize and its vectorization is enabled, it should be vectorized w/o any versioning. Fixes PR46228. Differential Revision: https://reviews.llvm.org/D81345
2020-07-07[llvm-readobj] - Add prepending # to mips-got.test and mips-plt.test. NFC.Georgii Rymar2-517/+517
It was requested in D83225 review to do it separately.
2020-07-07[llvm-readobj] - Refine the error reporting in ↵Georgii Rymar2-19/+31
LLVMStyle<ELFT>::printELFLinkerOptions. It is possible to: 1) Avoid using the `unwrapOrError` calls and hence allow to continue dumping even when something is not OK with one of SHT_LLVM_LINKER_OPTIONS sections. 2) replace `reportWarning` with `reportUniqueWarning` calls. In this method it is no-op, because it is not possible to have a duplicated warnings anyways, but since we probably want to switch to `reportUniqueWarning` globally, this is a good thing to do. This patch addresses both these points. Differential revision: https://reviews.llvm.org/D83131
2020-07-07[llvm-readobj] - Split the printHashSymbols. NFCI.Georgii Rymar1-65/+78
This introduces `printHashTableSymbols` and `printGNUHashTableSymbols` to split the `printHashSymbols`. It makes the code more readable and consistent. Differential revision: https://reviews.llvm.org/D83040
2020-07-07[SVE][CodeGen] Legalisation of unpredicated store instructionsKerry McLaughlin2-8/+68
Summary: When splitting a store of a scalable type, the new address is calculated in SplitVecOp_STORE using a vscale and an add instruction. Reviewers: sdesmalen, efriedma, david-arm Reviewed By: david-arm Subscribers: tschuett, hiraditya, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83041
2020-07-07[llvm-readobj] - Refactor ELFDumper<ELFT>::getStaticSymbolName.Georgii Rymar2-20/+17
This is a followup for D83129. It is possible to make `getStaticSymbolName` report warnings inside and return the "<?>" on a error. This allows to encapsulate errors handling and slightly simplifies the logic in callers code. Differential revision: https://reviews.llvm.org/D83208
2020-07-07[llvm-readobj] - Allow dumping partially corrupted ↵Georgii Rymar2-14/+88
SHT_LLVM_CALL_GRAPH_PROFILE sections. The code we have currently reports an error if something is not right with the profile section. Instead we can report a warning and continue dumping when it is possible. This patch does it. Differential revision: https://reviews.llvm.org/D83129
2020-07-07[SVE][CodeGen] Legalisation of unpredicated load instructionsKerry McLaughlin5-6/+86
Summary: When splitting a load of a scalable type, the new address is calculated in SplitVecRes_LOAD using a vscale and an add instruction. This patch also adds a DAG combiner fold to visitADD for vscale: - Fold (add (vscale(C0)), (vscale(C1))) to (add (vscale(C0 + C1))) Reviewers: sdesmalen, efriedma, david-arm Reviewed By: david-arm Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82792
2020-07-07[NFC] Adding the align attribute on Atomic{CmpXchg|RMW}InstGuillaume Chatelet6-92/+110
This is the first step to add support for the align attribute to AtomicRMWInst and AtomicCmpXchgInst. Next step is to add support in IRBuilder and BitcodeReader. Bug: https://bugs.llvm.org/show_bug.cgi?id=27168 Differential Revision: https://reviews.llvm.org/D83136
2020-07-07[llvm-readobj] - Fix a crash scenario in GNUStyle<ELFT>::printHashSymbols().Georgii Rymar2-3/+151
We might crash when the dynamic symbols table is empty (or not found) and --hash-symbols is requested. Both .hash and .gnu.hash logic is affected. The patch fixes this issue. Differential revision: https://reviews.llvm.org/D83037
2020-07-07[SVE] Add more warnings checks to clang and LLVM SVE testsDavid Sherwood25-25/+100
There are now more SVE tests in LLVM and Clang that do not emit warnings related to invalid use of EVT::getVectorNumElements() and VectorType::getNumElements(). For these tests I have added additional checks that there are no warnings in order to prevent any future regressions. Differential Revision: https://reviews.llvm.org/D82943
2020-07-07[SVE][CodeGen] Fix bug when falling back to DAG ISelDavid Sherwood5-7/+33
In an earlier commit 584d0d5c1749c13625a5d322178ccb4121eea610 I added functionality to allow AArch64 CodeGen support for falling back to DAG ISel when Global ISel encounters scalable vector types. However, it seems that we were not falling back early enough as llvm::getLLTForType was still being invoked for scalable vector types. I've added a new fallback function to the call lowering class in order to catch this problem early enough, rather than wait for lowerFormalArguments to reject scalable vector types. Differential Revision: https://reviews.llvm.org/D82524
2020-07-07[CodeGen] Fix warnings in sve-vector-splat.ll and sve-trunc.llDavid Sherwood3-5/+12
This patch fixes all remaining warnings in: llvm/test/CodeGen/AArch64/sve-trunc.ll llvm/test/CodeGen/AArch64/sve-vector-splat.ll I hit some warnings related to getCopyPartsToVector. I fixed two issues: 1. In widenVectorToPartType() we assumed that we'd always be using BUILD_VECTOR nodes to expand from one vector type to another, which is incorrect for scalable vector types. I've fixed this for now by simply bailing out immediately for scalable vectors. 2. In getCopyToPartsVector() I've changed the code to compare the element counts of different types. Differential Revision: https://reviews.llvm.org/D83028
2020-07-07[X86] Add 64bit and retpoline-external-thunk to list of featuers in ↵Craig Topper2-0/+9
X86TargetParser.def. '64bit' shows up from -march=native on 64-bit capable CPUs. 'retpoline-eternal-thunk' isn't a real feature but shows up when -mretpoline-external-thunk is passed to clang.
2020-07-07[X86] Remove assert for missing features from X86::getImpliedFeaturesCraig Topper1-2/+0
This is failing on the bots. Remove while I try to figure out what feature I missed in the table.
2020-07-07[AMDGPU] Update isFMAFasterThanFMulAndFAdd assumptionsCarl Ritson1-4/+7
MAD/MAC is no longer always available. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D83207
2020-07-06[X86] Move the feature dependency handling in ↵Craig Topper3-7/+202
X86TargetInfo::setFeatureEnabledImpl to a table based lookup in X86TargetParser.cpp Previously we had to specify the forward and backwards feature dependencies separately which was error prone. And as dependencies have gotten more complex it was hard to be sure the transitive dependencies were handled correctly. The way it was written was also not super readable. This patch replaces everything with a table that lists what features a feature is dependent on directly. Then we can recursively walk through the table to find the transitive dependencies. This is largely based on how we handle subtarget features in the MC layer from the tablegen descriptions. Differential Revision: https://reviews.llvm.org/D83273
2020-07-07[Test] Add one more missing optimization opportunity testMax Kazantsev1-4/+37
2020-07-06[X86] Remove duplicate SSE4A feature bit from X86TargetParser.def. NFCCraig Topper2-5/+4
We had both SSE4A and SSE4_A. So remove one of them.
2020-07-06[llvm-install-name-tool] Merge install-name optionsSameer Arora4-116/+124
This diff merges all options for llvm-install-name-tool under a single function processLoadCommands. Also adds another test case for -add_rpath option. Test plan: make check-all Reviewed by: jhenderson, alexshap, smeenai, Ktwu Differential Revision: https://reviews.llvm.org/D82812
2020-07-06[PowerPC] Do not RAUW combined nodes in VECTOR_SHUFFLE legalizationNemanja Ivanovic2-1/+46
When legalizing shuffles, we make an attempt to combine it into a PPC specific canonical form that avoids a need for a swap. If the combine is successful, we RAUW the node and the custom legalization replaces the now dead node instead of the one it should replace. Remove that erroneous call to RAUW.
2020-07-07[gn build] Port 939d8309dbdLLVM GN Syncbot1-0/+1
2020-07-06[openmp] Move isAllowedClauseForDirective to tablegen + add clause version ↵Valentin Clement8-1018/+1141
to OMP.td Summary: Generate the isAllowedClauseForDirective function from tablegen. This patch introduce the VersionedClause in the tablegen file so that clause can be encapsulated in this class to specify a range of validity on a directive. VersionedClause has default minVersion, maxVersion so it can be used without them or minVersion. Reviewers: jdoerfert, jdenny Reviewed By: jdenny Subscribers: yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82982
2020-07-07[X86-64] Support Intel AMX IntrinsicXiang1 Zhang7-4/+245
INTEL ADVANCED MATRIX EXTENSIONS (AMX). AMX is a new programming paradigm, it has a set of 2-dimensional registers (TILES) representing sub-arrays from a larger 2-dimensional memory image and operate on TILES. These intrinsics use direct TMM register number as its params. Spec can be found in Chapter 3 here https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D83111
2020-07-06[PowerPC] Implement Vector Splat Immediate Builtins in ClangBiplob Mishra1-0/+18
Implements builtins for the following prototypes: vector signed int vec_splati (const signed int); vector float vec_splati (const float); vector double vec_splatid (const float); vector signed int vec_splati_ins (vector signed int, const unsigned int, const signed int); vector unsigned int vec_splati_ins (vector unsigned int, const unsigned int, const unsigned int); vector float vec_splati_ins (vector float, const unsigned int, const float); Differential Revision: https://reviews.llvm.org/D82520
2020-07-06[PowerPC][Power10] Exploit the xxsplti32dx instruction when lowering ↵Amy Kwan4-2/+228
VECTOR_SHUFFLE. This patch aims to exploit the xxsplti32dx XT, IX, IMM32 instruction when lowering VECTOR_SHUFFLEs. We implement lowerToXXSPLTI32DX when lowering vector shuffles to check if: - Element size is 4 bytes - The RHS is a constant vector (and constant splat of 4-bytes) - The shuffle mask is a suitable mask for the XXSPLTI32DX instruction where it is one of the 32 masks: <0, 4-7, 2, 4-7> <4-7, 1, 4-7, 3> Differential Revision: https://reviews.llvm.org/D83245
2020-07-06[ModuloSchedule] Devirtualize PeelingModuloScheduleExpander::expand as it's ↵David Blaikie1-2/+1
not needed The use case is out of tree code deriving from this class - but without a need to use the base class polymorphically, so skip the virtualization and virtual dtor. Post-commit review from 50ac7ce94f34c5f43b02185ae0c33e150e78b044
2020-07-06Revert "[LV] Enable the LoopVectorizer to create pointer inductions"Jordan Rupprecht2-1060/+52
This reverts commit a8fe12065ec8137e55a6a8b35dd5355477c2ac16. It causes a crash when building gzip. Will post the detailed reduced test case to D81267.
2020-07-07[gn build] Port 05f2b5ccfc5LLVM GN Syncbot1-0/+1
2020-07-07[gn build] PortLLVM GN Syncbot1-1/+0
2020-07-06fix typos to cycle botsNico Weber1-2/+2
2020-07-06Correct 3 spelling errors in headers and doc strings.Wolfgang Pieb2-3/+3
2020-07-06[DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP divisionSanjay Patel2-56/+81
X / (fabs(A) * sqrt(Z)) --> X / sqrt(A*A*Z) --> X * rsqrt(A*A*Z) In the motivating case from PR46406: https://bugs.llvm.org/show_bug.cgi?id=46406 ...this is restoring the sequence that was originally in the source code. We extracted a term from within the sqrt because we do not know in instcombine whether a target will expand a sqrt call. Note: we could say that the transform in IR should be restricted, but that would not solve the problem if the source was originally in the pattern shown here. This is a gray area for fast-math-flag requirements. I think we should at least check fast-math-flags on the fdiv and fmul because I view this transform as 2 pieces: reassociate the fmul operands and form reciprocal from the fdiv (as with the existing transform). We could argue that the sqrt also needs FMF, but that was not required before, so we should change that in a follow-up patch if that seems better. We don't currently have a way to check that the target will produce a sqrt or recip estimate without actually creating nodes (the APIs are SDValue getSqrtEstimate() and SDValue getRecipEstimate()), so we clean up speculatively created nodes if we are not able to create an estimate. The x86 test with doubles verifies that we are not changing a test with no estimate sequence. Differential Revision: https://reviews.llvm.org/D82716
2020-07-06Temporarily Revert "[llvm-install-name-tool] Merge install-name options" as ↵Eric Christopher4-124/+116
it breaks the objcopy build. This reverts commit c143900a0851b2c7b7d52e4825c7f073b3474cf6.
2020-07-06[NFC] change getLimitedCodeGenPipelineReason to static functionYuanfang Chen2-3/+3
2020-07-07[NFCI][llvm-reduce] ReduceOperandBundles: actually put Module ↵Roman Lebedev1-2/+2
forward-declaration back into llvm namespace
2020-07-07[llvm-reduce] Reducing call operand bundlesRoman Lebedev6-5/+231
Summary: This would have been marginally useful to me during/for rG7ea46aee3670981827c04df89b2c3a1cbdc7561b. With ongoing migration to representing assumes via operand bundles on the assume, this will be gradually more useful. Reviewers: nickdesaulniers, diegotf, dblaikie, george.burgess.iv, jdoerfert, Tyker Reviewed By: nickdesaulniers Subscribers: hiraditya, mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83177
2020-07-07[NFCI][IR] Introduce CallBase::Create() wrapperRoman Lebedev5-29/+32
Summary: It is reasonably common to want to clone some call with different bundles. Let's actually provide an interface to do that. Reviewers: chandlerc, jdoerfert, dblaikie, nickdesaulniers Reviewed By: nickdesaulniers Subscribers: llvm-commits, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D83248
2020-07-06[llvm-install-name-tool] Merge install-name optionsSameer Arora4-116/+124
This diff merges all options for llvm-install-name-tool under a single function processLoadCommands. Also adds another test case for -add_rpath option. Test plan: make check-all Reviewed by: jhenderson, alexshap, smeenai, Ktwu Differential Revision: https://reviews.llvm.org/D82812
2020-07-07[Scalarizer] Centralize instruction DCERoman Lebedev4-14/+24
As reported in https://reviews.llvm.org/D83101#2133062 the new visitInsertElementInst()/visitExtractElementInst() functionality is causing miscompiles (previously-crashing test added) It is due to the fact how the infra of Scalarizer is dealing with DCE, it was not updated or was it ready for such scalar value forwarding. It always assumed that the moment we "scalarized" something, it can go away, and did so with prejudice. But that is no longer safe/okay to do. Instead, let's prevent it from ever shooting itself into foot, and let's just accumulate the instructions-to-be-deleted in a vector, and collectively cleanup (those that are *actually* dead) them all at the end. All existing tests are not reporting any new garbage leftovers, but maybe it's test coverage issue.
2020-07-06Fix [-Werror,-Wsign-compare] in dominator unit test.Eric Christopher1-1/+1
2020-07-06[Support][NFC] Fix Wdocumentation warning in ADT/Bitfields.hBruno Ricci1-4/+4
\tparam is used for template parameters instead of \param.
2020-07-06[AMDGPU] Tweak getTypeLegalizationCost()Stanislav Mekhanoshin4-2/+20
Even though wide vectors are legal they still cost more as we will have to eventually split them. Not all operations can be uniformly done on vector types. Conservatively add the cost of splitting at least to 8 dwords, which is our widest possible load. We are more or less lying to cost mode with this change but this can prevent vectorizer from creation of wide vectors which results in RA problems for us. Differential Revision: https://reviews.llvm.org/D83078
2020-07-06AMDGPU/GlobalISel: Add types to special inputsMatt Arsenault5-59/+72
When passing special ABI inputs, we have no existing context for the type to use.
2020-07-06Add option LLVM_NM to allow specifying the location of the llvm-nm toolArlo Siemsen1-6/+10
The new option works like the existing LLVM_TABLEGEN, and LLVM_CONFIG_PATH options. Instead of building llvm-nm, the build uses the executable defined by LLVM_NM. This is useful for cross-compilation scenarios where the host cannot run the cross-compiled tool, and recursing into another cmake build is not an option (due to required DEFINE's, for example). Reviewed By: smeenai Differential Revision: https://reviews.llvm.org/D83022
2020-07-06DomTree: add private create{Child,Node} helpersNicolai Hähnle2-16/+18
Summary: Aside from unifying the code a bit, this change smooths the transition to use of future "opaque generic block references" in the type-erased dominator tree base class. Change-Id: If924b092cc8561c4b6a7450fe79bc96df0e12472 Reviewers: arsenm, RKSimon, mehdi_amini, courbet Subscribers: wdng, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83086
2020-07-06DomTree: Remove getRoots() accessorNicolai Hähnle8-24/+26
Summary: Avoid exposing details about how roots are stored. This enables subsequent type-erasure changes. v5: - cleanup a unit test by using EXPECT_EQ instead of EXPECT_TRUE Change-Id: I532b774cc71f2224e543bc7d79131d97f63f093d Reviewers: arsenm, RKSimon, mehdi_amini, courbet Subscribers: jvesely, wdng, hiraditya, kuhar, kerbowa, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83085
2020-07-06DomTree: Remove the releaseMemory() methodNicolai Hähnle3-9/+5
Summary: It is fully redundant with reset(). Change-Id: I25850b9f08eace757cf03cbb8780e970aca7f51a Reviewers: arsenm, RKSimon, mehdi_amini, courbet Subscribers: wdng, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D83084
2020-07-06DomTree: Remove getChildren() accessorNicolai Hähnle15-49/+46
Summary: Avoid exposing details about how children are stored. This will enable subsequent type-erasure changes. New methods are introduced to cover common access patterns. Change-Id: Idb5f4b1b9c84e4cc71ddb39bb52a388682f5674f Reviewers: arsenm, RKSimon, mehdi_amini, courbet Subscribers: qcolombet, sdardis, wdng, hiraditya, jrtc27, zzheng, atanasyan, asbirlea, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D83083