summaryrefslogtreecommitdiff
path: root/polly/lib
Commit message (Collapse)AuthorAgeFilesLines
* [Polly] Remove some bitcasts (NFC)Nikita Popov2023-03-174-18/+3
| | | | No longer relevant with opaque pointers.
* Use *{Map,Set}::contains (NFC)Kazu Hirata2023-03-151-1/+1
|
* [polly] Use DenseMap::contains (NFC)Kazu Hirata2023-03-141-1/+1
|
* [PassManagerBuilder] Remove PassManagerBuilderArthur Eubanks2023-03-131-1/+0
| | | | | | | | | | PassManagerBuilder is dead, long live PassBuilder! bugpoint's -O# are now useless (and probably have been for a while given the number of passes we've removed from PassManagerBuilder). Perhaps they'll be revived if bugpoint ever works with the new PM. Reviewed By: nikic, MaskRay Differential Revision: https://reviews.llvm.org/D145835
* [Passes] Remove some legacy passesArthur Eubanks2023-03-101-1/+0
| | | | | | | | | | | | | | DFAJumpThreading JumpThreading LibCallsShrink LoopVectorize SLPVectorizer DeadStoreElimination AggressiveDCE CorrelatedValuePropagation IndVarSimplify These are part of the optimization pipeline, of which the legacy version is deprecated and being removed.
* [Polly] Fix plugin build.Michael Kruse2023-03-091-0/+6
| | | | | The target_link_libraries call was accidentially removed in D142580 (Remove Polly-ACC).
* [polly] Remove unused variable 'VectorLoops' in IslNodeBuilder.cpp (NFC)Jie Fu2023-03-091-1/+0
| | | | | | | /home/jiefu/llvm-project/polly/lib/CodeGen/IslNodeBuilder.cpp:80:11: error: unused variable 'VectorLoops' [-Werror,-Wunused-variable] STATISTIC(VectorLoops, "Number of generated vector for-loops"); ^ 1 error generated.
* [Polly] Remove Polly-ACC.Michael Kruse2023-03-0872-22645/+14
| | | | | | | | | | Polly-ACC is unmaintained and since it has never been ported to the NPM pipeline, since D136621 it is not even accessible anymore without manually specifying the passes on the `opt` command line. Since there is no plan to put it to a maintainable state, remove it from Polly. Reviewed By: grosser Differential Revision: https://reviews.llvm.org/D142580
* [Polly] Remove -polly-vectorizer=polly.Michael Kruse2023-03-083-517/+1
| | | | | | | | | | Polly's internal vectorizer is not well maintained and is known to not work in some cases such as region ScopStmts. Unlike LLVM's LoopVectorize pass it also does not have a target-dependent cost heuristics, and we recommend using LoopVectorize instead of -polly-vectorizer=polly. In the future we hope that Polly can collaborate better with LoopVectorize, like Polly marking a loop is safe to vectorize with a specific simd width, instead of replicating its functionality. Reviewed By: grosser Differential Revision: https://reviews.llvm.org/D142640
* Revert "Revert "[SCEV] Add SCEVType to represent `vscale`.""Paul Walker2023-03-023-0/+11
| | | | | | Relanding after fixing Polly related build error. This reverts commit 7b26dcae9eaf8cdcba7fef032fd83d060dffd4b4.
* [Polly] Remove CodegenCleanupPass.Florian Hahn2023-02-243-141/+0
| | | | | | | | | | | The pass uses a bunch of deprecated legacy passes and appears unused. Remove it to unblock removing legacy passes. Fixes https://github.com/llvm/llvm-project/issues/60852 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D144332
* Use APInt::getSignificantBits instead of APInt::getMinSignedBits (NFC)Kazu Hirata2023-02-191-2/+2
| | | | | Note that getMinSignedBits has been soft-deprecated in favor of getSignificantBits.
* [LoopIdiomRecognize] Remove legacy passFangrui Song2023-02-191-1/+0
| | | | Following recent changes to remove non-core legacy passes.
* [LoopDeletion] Remove legacy passFangrui Song2023-02-151-1/+0
| | | | Following recent changes to remove non-core legacy passes.
* [Inliner] Remove legacy simple inlinerArthur Eubanks2023-02-091-1/+0
| | | | It's part of the optimization pipeline, of which the legacy pass manager version is deprecated.
* [NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott2023-02-071-1/+1
| | | | | | I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
* [Polly] Update ISL to isl-0.25-193-g8621c60c.Michael Kruse2023-01-25172-5857/+11033
| | | | | The bugfix https://reviews.llvm.org/D142308 might already have been fixed upstream.
* [polly] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata2023-01-024-12/+15
| | | | | | | This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
* [Support] Move TargetParsers to new componentArchibald Elliott2022-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fairly large changeset, but it can be broken into a few pieces: - `llvm/Support/*TargetParser*` are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for `-mcpu=native` support in e.g. Clang. This is fairly tightly intertwined with the information in `X86TargetParser.h`, so keeping them in the same component makes sense. - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved `RISCVISAInfo.h` into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838
* llvm::Optional::value => operator*/operator->Fangrui Song2022-12-171-1/+1
| | | | | | | | std::optional::value() has undesired exception checking semantics and is unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The call sites block std::optional migration. This makes `ninja clang` work in the absence of llvm::Optional::value.
* JSON: llvm::Optional => std::optionalFangrui Song2022-12-161-1/+1
| | | | | | Many files are from language servers. https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
* [NFC] Cleanup: Replace BB->getInstList().erase() with I->eraseFromParent().Vasileios Porpodas2022-12-131-1/+1
| | | | | | This is part of a series of patches that aim at making BasicBlock::getInstList() private. Differential Revision: https://reviews.llvm.org/D139992
* [Polly] Use std::nullopt to unbreak build.Michael Kruse2022-12-051-1/+1
|
* [AST] Make AliasSetTracker work on BatchAANikita Popov2022-12-051-1/+2
| | | | | | | | | | | | D138014 restricted AST to work on immutable IR. This means it is also safe to use a single BatchAA instance for the entire AST lifetime, instead of only batching parts of individual queries. The primary motivation for this is not compile-time, but rather having a central place to control cross-iteration AA, which will be used by D137958. Differential Revision: https://reviews.llvm.org/D137955
* Remove unused #include "llvm/ADT/Optional.h"Fangrui Song2022-12-051-1/+0
|
* [polly] Use std::nullopt instead of None (NFC)Kazu Hirata2022-12-032-6/+6
| | | | | | | | | | | | This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
* [clang] Only use major version in resource dirTimm Bäder2022-11-101-1/+1
| | | | | | | | This causes unnecessary churn for downstreams. For the full discussion, see https://discourse.llvm.org/t/should-we-continue-embed-the-full-llvm-version-in-lib-clang/62094 Differential Revision: https://reviews.llvm.org/D125860
* [CMake] Fix -Wstrict-prototypesSam James2022-11-081-12/+12
| | | | | | | | | | | | | | | | Fixes warnings (or errors, if someone injects -Werror in their build system, which happens in fact with some folks vendoring LLVM too) with Clang 16: ``` +/var/tmp/portage.notmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] -/var/tmp/portage.notmp/portage/sys-devel/llvm-14.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] int main() {return 0;} ^ void ``` Differential Revision: https://reviews.llvm.org/D137503
* [polly] Format RegisterPasses.cppArthur Eubanks2022-10-281-8/+4
|
* [polly] Remove legacy pass manager hooksArthur Eubanks2022-10-281-275/+56
| | | | | | | | And some options that only throw errors with the new PM. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D136621
* [Polly] Add support for -polly-enable-mse with NPM.Michael Kruse2022-10-261-2/+1
| | | | | | The MaximalStaticExpansionPass was already ported to the NPM in 02f640672e2875c4e7578366bb2e22582548d7c1. Allow adding it to the default NPM pass builder pipeline using -polly-enable-mse.
* [Polly] Add support for -polly-export with NPM.Michael Kruse2022-10-261-2/+1
| | | | | The JSONExporter pass was already ported to the NPM, the pass builder jsut had to add it to the pass pipeline when requested.
* [Polly] Ensure -polly-detect-keep-going still eventually rejects invalid ↵Michael Kruse2022-10-202-20/+73
| | | | | | regions. Fixes #58484
* [AA] Rename getModRefBehavior() to getMemoryEffects() (NFC)Nikita Popov2022-10-192-2/+2
| | | | | Follow up on D135962, renaming the method name to match the new type name.
* [AA] Rename uses of FunctionModRefBehavior (NFC)Nikita Popov2022-10-192-8/+8
| | | | | | | Followup to D135962 to rename remaining uses of FunctionModRefBehavior to MemoryEffects. Does not touch API names yet, but also updates variables names FMRB/MRB to ME, to match the new type name.
* [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI)Nikita Popov2022-09-142-47/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, FunctionModRefBehavior tracks whether the function reads or writes memory (ModRefInfo) and which locations it can access (argmem, inaccessiblemem and other). This patch changes it to track ModRef information per-location instead. To give two examples of why this is useful: * D117095 highlights a weakness of ModRef modelling in the presence of operand bundles. For a memcpy call with deopt operand bundle, we want to say that it can read any memory, but only write argument memory. This would allow them to be treated like any other calls. However, we currently can't express this and have to say that it can read or write any memory. * D127383 would ideally be modelled as a separate threadid location, where threadid Refs outside pre-split coroutines can be ignored (like other accesses to constant memory). The current representation does not allow modelling this precisely. The patch as implemented is intended to be NFC, but there are some obvious opportunities for improvements and simplification. To fully capitalize on this we would also want to change the way we represent memory attributes on functions, but that's a larger change, and I think it makes sense to separate out the FunctionModRefBehavior refactoring. Differential Revision: https://reviews.llvm.org/D130896
* Use std::gcd (NFC)Kazu Hirata2022-08-281-1/+2
| | | | | To avoid changing semantics inadvertently, this patch casts arguments to uint64_t before calling std::gcd.
* LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song2022-08-094-7/+7
|
* [polly] Fixed a number of typos. NFCGabriel Ravier2022-08-073-3/+3
| | | | | | | | | | | | | | | I went over the output of the following mess of a command: `(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)` and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Reviewed By: inclyc Differential Revision: https://reviews.llvm.org/D131167
* [Polly] Generalize the pattern matching to the case of tensor contractionsRoman Gareev2022-08-073-10/+850
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pattern matching optimization of Polly detects and optimizes dense general matrix-matrix multiplication. The generated code is close to high performance implementations of matrix-matrix multiplications, which are contained in manually tuned libraries. The described pattern matching optimization is a particular case of tensor contraction optimization, which was introduced in [1]. This patch generalizes the pattern matching to the case of tensor contractions using the form of data dependencies and memory accesses produced by tensor contractions [1]. Optimization of tensor contractions will be added in the next patch. Following the ideas introduced in [2], it will logically represent tensor contraction operands as matrix multiplication operands and use an approach for optimization of matrix-matrix multiplications. [1] - Gareev R., Grosser T., Kruse M. High-Performance Generalized Tensor Op­erations: A Compiler-Oriented Approach // ACM Transactions on Architec­ture and Code Optimization (TACO). 2018. Vol. 15, no. 3. P. 34:1–34:27. DOI: 10.1145/3235029. [2] - Matthews D. High-Performance Tensor Contraction without BLAS // SIAM Journal on Scientific Computing. 2018. Vol. 40, no. 1. P. C 1—C 24. DOI: 110.1137/16m108968x. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D114336
* [Polly] Insert !dbg metadata for emitted CallInsts.Michael Kruse2022-07-263-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | The IR Verifier requires that every call instruction to an inlineable function (among other things, its implementation must be visible in the translation unit) must also have !dbg metadata attached to it. When parallelizing, Polly emits calls to OpenMP runtime function out of thin air, or at least not directly derived from a bounded list of previous instruction. While we could search for instructions in the SCoP that has some debug info attached to it, there is no guarantee that we find any. Our solution is to generate a new DILocation that points to line 0 to represent optimized code. The OpenMP function implementation is usually not available in the user's translation unit, but can become visible in an LTO build. For the bug to appear, libomp must also be built with debug symbols. IMHO, the IR verifier rule is too strict. Runtime functions can also be inserted by other optimization passes, such as LoopIdiomRecognize. When inserting a call to e.g. memset, it uses the DebugLoc from a StoreInst from the unoptimized code. It is not required to have !dbg metadata attached either. Fixes #56692
* Remove redundaunt virtual specifiers (NFC)Kazu Hirata2022-07-256-20/+20
| | | | Identified with tidy-modernize-use-override.
* Use any_of (NFC)Kazu Hirata2022-07-221-2/+1
|
* Use value instead of getValue (NFC)Kazu Hirata2022-07-153-13/+13
|
* Use has_value instead of hasValue (NFC)Kazu Hirata2022-07-131-1/+1
|
* [Polly][MatMul] Abandon dependence analysis.Michael Kruse2022-06-293-29/+40
| | | | | | | | | | | | | The copy statements inserted by the matrix-multiplication optimization introduce new dependencies between the copy statements and other statements. As a result, the DependenceInfo must be recomputed. Not recomputing them caused IslAstInfo to deduce that some loops are parallel but cause race conditions when accessing the packed arrays. As a result, matrix-matrix multiplication currently cannot be parallelized. Also see discussion at https://reviews.llvm.org/D125202
* Don't use Optional::hasValue (NFC)Kazu Hirata2022-06-262-5/+5
| | | | | This patch replaces x.hasValue() with x where x is contextually convertible to bool.
* Revert "Don't use Optional::hasValue (NFC)"Kazu Hirata2022-06-253-21/+22
| | | | This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
* Don't use Optional::hasValue (NFC)Kazu Hirata2022-06-253-22/+21
|
* [Support] Change TrackingStatistic and NoopStatistic to use uint64_t instead ↵Mingming Liu2022-06-222-3/+3
| | | | | | | | | | of unsigned. Binary size of `clang` is trivial; namely, numerical value doesn't change when measured in MiB, and `.data` section increases from 139Ki to 173 Ki. Differential Revision: https://reviews.llvm.org/D128070