summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
AgeCommit message (Collapse)Author
2024-11-12[CodeGen] Remove unused includes (NFC) (#115996)Kazu Hirata
Identified with misc-include-cleaner.
2024-06-28[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)Nikita Popov
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds `getDataLayout()` helpers to Function and GlobalValue, replacing the current `getParent()->getDataLayout()` pattern.
2024-05-23InterleavedLoadCombine: Correctly query PM for TargetTransformInfo (#93103)Matt Arsenault
2024-05-02[InterleavedLoadCombine] Bail out on non-byte-sized vector element type (#90705)Nikita Popov
Vectors are always tightly packed, and elements of non-byte-sized usually do not have a well-defined (byte) offset. Fixes https://github.com/llvm/llvm-project/issues/90695.
2024-04-29[CodeGen] Remove extraneous ArrayRef (NFC) (#90423)Kazu Hirata
We don't need to explicitly create an instance of ArrayRef here because getIndexedOffsetInType takes ArrayRef, and ArrayRef can be implicitly constructed from a C array.
2023-12-13[CodeGen] Port `InterleavedLoadCombine` to new pass manager (#75164)paperchalice
2023-11-27[llvm] Replace calls to Type::getPointerTo (NFC)Youngsuk Kim
Cleanup work towards removing the method Type::getPointerTo. If a call to Type::getPointerTo is used solely to support an unneeded pointer-cast, remove the call entirely.
2023-09-01[llvm] Fix duplicate word typos. NFCFangrui Song
Those fixes were taken from https://reviews.llvm.org/D137338
2023-06-07[CodeGen] Disable default copy assignment operator for struct VectorInfoBing1 Yu
struct VectorInfo manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one Reviewed By: kazu Differential Revision: https://reviews.llvm.org/D152230
2023-02-19Use APInt::count{l,r}_{zero,one} (NFC)Kazu Hirata
2023-01-05Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ partserge-sans-paille
Use deduction guides instead of helper functions. The only non-automatic changes have been: 1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*)) 2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase. 3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated. 4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that). Per reviewers' comment, some useless makeArrayRef have been removed in the process. This is a follow-up to https://reviews.llvm.org/D140896 that introduced the deduction guides. Differential Revision: https://reviews.llvm.org/D140955
2022-07-17[CodeGen] Qualify auto variables in for loops (NFC)Kazu Hirata
2022-06-18[CodeGen] Use default member initialization (NFC)Kazu Hirata
Identified with modernize-use-default-member-init.
2022-06-14[InterleavedLoadComb] Rename uses when inserting new uses.Florian Hahn
This fixes a crash due to uses needing to be renamed.
2022-03-16Cleanup codegen includesserge-sans-paille
This is a (fixed) recommit of https://reviews.llvm.org/D121169 after: 1061034926 before: 1063332844 Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D121681
2022-03-10Revert "Cleanup codegen includes"Nico Weber
This reverts commit 7f230feeeac8a67b335f52bd2e900a05c6098f20. Breaks CodeGenCUDA/link-device-bitcode.cu in check-clang, and many LLVM tests, see comments on https://reviews.llvm.org/D121169
2022-03-10Cleanup codegen includesserge-sans-paille
after: 1061034926 before: 1063332844 Differential Revision: https://reviews.llvm.org/D121169
2022-02-05Simplify mask creation with llvm::seq. NFCI.Benjamin Kramer
2022-01-30[CodeGen] Use default member initialization (NFC)Kazu Hirata
Identified with modernize-use-default-member-init.
2022-01-07[llvm] Remove redundant member initialization (NFC)Kazu Hirata
Identified with readability-redundant-member-init.
2022-01-03Revert "[llvm] Remove redundant member initialization (NFC)"Kazu Hirata
This reverts commit fd4808887ee47f3ec8a030e9211169ef4fb094c3. This patch causes gcc to issue a lot of warnings like: warning: base class ‘class llvm::MCParsedAsmOperand’ should be explicitly initialized in the copy constructor [-Wextra]
2022-01-01[llvm] Remove redundant member initialization (NFC)Kazu Hirata
Identified with readability-redundant-member-init.
2021-12-28[llvm] Use nullptr instead of 0 (NFC)Kazu Hirata
Identified with modernize-use-nullptr.
2021-10-04[APInt] Stop using soft-deprecated constructors and methods in llvm. NFC.Jay Foad
Stop using APInt constructors and methods that were soft-deprecated in D109483. This fixes all the uses I found in llvm, except for the APInt unit tests which should still test the deprecated methods. Differential Revision: https://reviews.llvm.org/D110807
2021-09-22[NFCI][CodeGen, AArch64] Fix inconsistent TargetCostKind types.Daniil Fukalov
The pass uses different cost kinds to estimate "old" and "interleaved" costs: default cost kind for all targets override `getInterleavedMemoryOpCost()` is `TCK_SizeAndLatency`. Although at the moment estimated `TCK_Latency` costs are equal to `TCK_SizeAndLatency`, (so the change is NFC) it may change in future. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D110100
2021-09-09[APInt] Normalize naming on keep constructors / predicate methods.Chris Lattner
This renames the primary methods for creating a zero value to `getZero` instead of `getNullValue` and renames predicates like `isAllOnesValue` to simply `isAllOnes`. This achieves two things: 1) This starts standardizing predicates across the LLVM codebase, following (in this case) ConstantInt. The word "Value" doesn't convey anything of merit, and is missing in some of the other things. 2) Calling an integer "null" doesn't make any sense. The original sin here is mine and I've regretted it for years. This moves us to calling it "zero" instead, which is correct! APInt is widely used and I don't think anyone is keen to take massive source breakage on anything so core, at least not all in one go. As such, this doesn't actually delete any entrypoints, it "soft deprecates" them with a comment. Included in this patch are changes to a bunch of the codebase, but there are more. We should normalize SelectionDAG and other APIs as well, which would make the API change more mechanical. Differential Revision: https://reviews.llvm.org/D109483
2021-06-06[CodeGen] Add missing includes (NFC)Nikita Popov
These currently rely on the IRBuilder.h include in TargetLowering.h. Make them explicit.
2021-01-10[CodeGen, DebugInfo] Use llvm::find_if (NFC)Kazu Hirata
2020-12-30Use unary CreateShuffleVector if possibleJuneyoung Lee
As mentioned in D93793, there are quite a few places where unary `IRBuilder::CreateShuffleVector(X, Mask)` can be used instead of `IRBuilder::CreateShuffleVector(X, Undef, Mask)`. Let's update them. Actually, it would have been more natural if the patches were made in this order: (1) let them use unary CreateShuffleVector first (2) update IRBuilder::CreateShuffleVector to use poison as a placeholder value (D93793) The order is swapped, but in terms of correctness it is still fine. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D93923
2020-12-11[Support] Introduce a new InstructionCost classDavid Sherwood
This is the first in a series of patches that attempts to migrate existing cost instructions to return a new InstructionCost class in place of a simple integer. This new class is intended to be as light-weight and simple as possible, with a full range of arithmetic and comparison operators that largely mirror the same sets of operations on basic types, such as integers. The main advantage to using an InstructionCost is that it can encode a particular cost state in addition to a value. The initial implementation only has two states - Normal and Invalid - but these could be expanded over time if necessary. An invalid state can be used to represent an unknown cost or an instruction that is prohibitively expensive. This patch adds the new class and changes the getInstructionCost interface to return the new class. Other cost functions, such as getUserCost, etc., will be migrated in future patches as I believe this to be less disruptive. One benefit of this new class is that it provides a way to unify many of the magic costs in the codebase where the cost is set to a deliberately high number to prevent optimisations taking place, e.g. vectorization. It also provides a route to represent the extremely high, and unknown, cost of scalarization of scalable vectors, which is not currently supported. Differential Revision: https://reviews.llvm.org/D91174
2020-07-09[SVE] Remove calls to VectorType::getNumElements from CodeGenChristopher Tetreault
Reviewers: efriedma, fpetrogalli, sdesmalen, RKSimon, arsenm Reviewed By: RKSimon Subscribers: wdng, tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82210
2020-06-26[Alignment][NFC] Migrate TTI::getInterleavedMemoryOpCost to AlignGuillaume Chatelet
This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Differential Revision: https://reviews.llvm.org/D82573
2020-05-18[SVE] Ignore scalable vectors in InterleavedLoadCombinePassDavid Sherwood
I have changed the pass so that we ignore shuffle vectors with scalable vector types, and replaced VectorType with FixedVectorType in the rest of the pass. I couldn't think of an easy way to test this change, since for scalable vectors we shouldn't be using shufflevectors for interleaving. This change fixes up some type size assert warnings I found in the following test: CodeGen/AArch64/sve-intrinsics-int-arith-imm.ll Differential Revision: https://reviews.llvm.org/D79700
2020-04-15Upgrade calls to CreateShuffleVector to use the preferred form of passing an ↵Benjamin Kramer
array of ints No functionality change intended.
2020-01-23[Alignement][NFC] Deprecate untyped CreateAlignedLoadGuillaume Chatelet
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73260
2020-01-01[NFC] Fixes -Wrange-loop-analysis warningsMark de Wever
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
2019-11-13Sink all InitializePasses.h includesReid Kleckner
This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of recompilation. I found this fact by looking at this table, which is sorted by the number of times a file was changed over the last 100,000 git commits multiplied by the number of object files that depend on it in the current checkout: recompiles touches affected_files header 342380 95 3604 llvm/include/llvm/ADT/STLExtras.h 314730 234 1345 llvm/include/llvm/InitializePasses.h 307036 118 2602 llvm/include/llvm/ADT/APInt.h 213049 59 3611 llvm/include/llvm/Support/MathExtras.h 170422 47 3626 llvm/include/llvm/Support/Compiler.h 162225 45 3605 llvm/include/llvm/ADT/Optional.h 158319 63 2513 llvm/include/llvm/ADT/Triple.h 140322 39 3598 llvm/include/llvm/ADT/StringRef.h 137647 59 2333 llvm/include/llvm/Support/Error.h 131619 73 1803 llvm/include/llvm/Support/FileSystem.h Before this change, touching InitializePasses.h would cause 1345 files to recompile. After this change, touching it only causes 550 compiles in an incremental rebuild. Reviewers: bkramer, asbirlea, bollu, jdoerfert Differential Revision: https://reviews.llvm.org/D70211
2019-09-15InterleavedLoadCombine - merge isa<> and dyn_cast<> duplicates. NFCI.Simon Pilgrim
Silence static analyzer null dereference warning of *dyn_cast<BinaryOperator> by merging with the isa<BinaryOperator> above. llvm-svn: 371935
2019-04-29computePolynomialFromPointer - add missing early-out return for non-pointer ↵Simon Pilgrim
types. Reported in https://www.viva64.com/en/b/0629/ llvm-svn: 359486
2019-02-01[opaque pointer types] Pass value type to LoadInst creation.James Y Knight
This cleans up all LoadInst creation in LLVM to explicitly pass the value type rather than deriving it from the pointer's element-type. Differential Revision: https://reviews.llvm.org/D57172 llvm-svn: 352911
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-11-19Fix unused function warning.Simon Pilgrim
llvm-svn: 347252
2018-11-19Add missing stream operator for Polynomial class to fix debug builds.Simon Pilgrim
llvm-svn: 347249
2018-11-19[InterleavedLoadCombine] Fix warningsMartin Elshuber
* remove unused function * fix compare llvm-svn: 347241
2018-11-19[InterleavedLoadCombine] Fix warning unused variableMartin Elshuber
Differential Revision: https://reviews.llvm.org/D52653 llvm-svn: 347229
2018-11-19[InterleavedLoadCombine] Remove unused include. NFC.Benjamin Kramer
llvm-svn: 347226
2018-11-19Subject: [PATCH] [CodeGen] Add pass to combine interleaved loads.Martin Elshuber
This patch defines an interleaved-load-combine pass. The pass searches for ShuffleVector instructions that represent interleaved loads. Matches are converted such that they will be captured by the InterleavedAccessPass. The pass extends LLVMs capabilities to use target specific instruction selection of interleaved load patterns (e.g.: ld4 on Aarch64 architectures). Differential Revision: https://reviews.llvm.org/D52653 llvm-svn: 347208