summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
AgeCommit message (Collapse)Author
2023-03-08[Polly] Remove Polly-ACC.Michael Kruse
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
2022-12-05[Polly] Use std::nullopt to unbreak build.Michael Kruse
2022-06-05Remove unneeded cl::ZeroOrMore for cl::opt/cl::list optionsFangrui Song
2022-06-05Remove unneeded cl::ZeroOrMore for cl::opt/cl::list optionsFangrui Song
2022-06-04Remove unneeded cl::ZeroOrMore for cl::opt optionsFangrui Song
Similar to 557efc9a8b68628c2c944678c6471dac30ed9e8e. This commit handles options where cl::ZeroOrMore is more than one line below cl::opt.
2022-05-17[Polly] Mark classes as final by default. NFC.Michael Kruse
This make is obivious that a class was not intended to be derived from. NPM analysis pass can unfortunately not marked as final because they are derived from a llvm::Checker<T> template internally by the NPM. Also normalize the use of classes/structs * NPM passes are structs * Legacy passes are classes * structs that have methods and are not a visitor pattern are classes * structs have public inheritance by default, remove "public" keyword * Use typedef'ed type instead of inline forward declaration
2022-04-19[PPCGCodeGeneration] Look for function instead of function pointer typeNikita Popov
What this code is actually interested in are references to functions. Use of a function pointer type is being used as an imprecise proxy for that.
2022-04-19[PPCGCodeGeneration] Avoid another pointer element type accessNikita Popov
Use an API that returns both the address and the element type, and use that for the load type.
2022-04-19[PPCGCodeGeneration] Avoid pointer element type accessNikita Popov
Pass through the ArrayTy instead.
2022-02-14[polly] Remove uses of PointerType::getElementType()Nikita Popov
This method has been removed. I missed these uses in conditionally- compiled code previously.
2021-11-05[Polly][Isl] Use the function unsignedFromIslSize to manage a isl::size ↵Riccardo Mori
object. NFCI This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in lib/External/isl/include/isl/isl-noxceptions.h and the official isl C++ interface. In the official interface the type `isl::size` cannot be casted to an unsigned without previously having checked if it contains a valid value with the function `isl::size::is_error()`. For this reason two helping functions have been added: - `IslAssert`: assert that no errors are present in debug builds and just disables the mandatory error check in non-debug builds - `unisgnedFromIslSIze`: cast the `isl::size` object to `unsigned` Changes made: - Add the functions `IslAssert` and `unsignedFromIslSize` - Add the utility function `rangeIslSize()` - Retype `MaxDisjunctsInDomain` from `int` to `unsigned` - Retype `RunTimeChecksMaxAccessDisjuncts` from `int` to `unsigned` - Retype `MaxDimensionsInAccessRange` from `int` to `unsigned` - Replaced some usages of `isl_size` to `unsigned` since we aim not to use `isl_size` anymore - `isl-noexceptions.h` has been generated by https://github.com/patacca/isl/commit/e704f73c88f0b4d88e62e447bdb732cf5914094b No functional change intended. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D113101
2021-10-08Move TargetRegistry.(h|cpp) from Support to MCReid Kleckner
This moves the registry higher in the LLVM library dependency stack. Every client of the target registry needs to link against MC anyway to actually use the target, so we might as well move this out of Support. This allows us to ensure that Support doesn't have includes from MC/*. Differential Revision: https://reviews.llvm.org/D111454
2021-09-23[Polly] Remove -polly-opt-fusion option.Michael Kruse
The name of the option is misleading and has been renamed by isl to "serialize-sccs". Instead of also renaming the option, remove it. The option is still accessible using -polly-isl-arg=--no-schedule-serialize-sccs
2021-08-16[Polly][Isl] Move to the new-polly-generator branch version of ↵Riccardo Mori
isl-noexceptions.h. NFCI This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. With this commit we are moving from the `polly-generator` branch to the `new-polly-generator` branch that is more mantainable and is based on the official C++ interface `cpp-checked.h`. Changes made: - There are now many sublcasses for `isl::ast_node` representing different isl types. Use `isl::ast_node_for`, `isl::ast_node_user`, `isl::ast_node_block` and `isl::ast_node_mark` where needed. - There are now many sublcasses for `isl::schedule_node` representing different isl types. Use `isl::schedule_node_mark`, `isl::schedule_node_extension`, `isl::schedule_node_band` and `isl::schedule_node_filter` where needed. - Replace the `isl::*::dump` with `dumpIslObj` since the isl dump method is not exposed in the C++ interface. - `isl::schedule_node::get_child` has been renamed to `isl::schedule_node::child` - `isl::pw_multi_aff::get_pw_aff` has been renamed to `isl::pw_multi_aff::at` - The constructor `isl::union_map(isl::union_pw_multi_aff)` has been replaced with the static method `isl::union_map::from()` - Replace usages of `isl::val::add_ui` with `isl::val::add` - `isl::union_set_list::alloc` is now a constructor - All the `isl_size` values are now wrapped inside the class `isl::size` use `isl::size::release` to get the internal `isl_size` value where needed. - `isl-noexceptions.h` has been generated by https://github.com/patacca/isl/commit/73f5ed1f4d1f72582f731590ef9e43d9ab1956ad No functional change intended. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D107225
2021-07-19[Polly][Isl] Stop generating isl::union_{set,map} from isl::space. NFCRiccardo Mori
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Stop generating `isl::union_set` and isl::union_map` from `isl::space` and instead generate them from `isl::ctx` - Disable clang-format on `isl-noexceptions.h` - Removed `isl::union_{set,map}` generator from `isl::space` from `isl-noexceptions.h` - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/87c3413b6f1d62ca3dddf716352f90a0b8533353 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D106059
2021-07-18[polly] Fix uses of deprecated overload of IRBuilder::CreateGEP.Eli Friedman
2021-07-09[Polly][Isl] Use isl::*::ctx instead of isl::*::get_ctx. NFCRiccardo Mori
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Use `isl::*::ctx()` instead of `isl::*::get_ctx()` (for example `isl::space::ctx()` instead of `isl::space::get_ctx()`) - Add `isl::` namespace in front of isl types to avoid confusion (for example `isl::space::ctx` and `isl::ctx` - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/b64e33c62d3fe7db506f6630f9e935b663f9c5a4 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D105691
2021-07-06[Polly][Isl] Use isl::set::tuple_dim, isl::map::domain_tuple_dim and ↵patacca
isl::map::range_tuple_dim. NFC This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Use `isl::set::tuple_dim` instead of `isl::set::dim` and `isl::set::n_dim` - Use `isl::map::domain_tuple_dim` instead of `isl::map::dim` - Use `isl::map::range_tuple_dim` instead of `isl::map::dim` - isl-noexceptions.h has been generated by this https://github.com/patacca/isl/commit/45576e1b4260f91946e4cf819485f57bd2ed5490 Note that not all the usage of `isl::{set,map}::dim` where replaced Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D104994
2021-06-18[polly][GPGPU] Fixup related to overloading exponent type in llvm.powiBjorn Pettersson
Commit 4c7f820b2b206bb changed the llvm.powi intrinsic to support different 'int' sizes for the exponent. That happened to break the IntrinsicToLibdeviceFunc mapping in PPCGCodeGeneration, which obviously should have been updated as part of commit 4c7f820b2b (https://reviews.llvm.org/D99439). The shortcoming was found by buildbots that use -DPOLLY_ENABLE_GPGPU_CODEGEN=ON This patch should fixup the problem.
2021-06-11[Polly][Isl] Removing explicit operator bool() from isl C++ bindings. NFC.patacca
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Removing explicit operator bool() from all the classes in the isl C++ bindings. - Replace each call to operator bool() to method `is_null()`. - isl-noexceptions.h has been generated by this https://github.com/patacca/isl/commit/27396daac5a5ee8228d25511a12f4a814c92ba8f Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D103976
2021-06-08[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC.patacca
[Polly][Isl] Removing nullptr constructor from C++ bindings. NFC. This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface. Changes made: - Removed `std::nullptr_t` constructor from all the classes in the isl C++ bindings. - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/a7e00bea38f251a4bcf5c2c6ce5fa7ee5f661528 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D103751
2021-04-16[Polly][Ast] Partial refactoring of IslAst and IslAstInfo to use isl++. NFC.patacca
Polly use algorithms from the Integer Set Library (isl), which is a library written in C and which is incompatible with the rest of the LLVM as it is written in C++. Changes made: - Refactoring the following methods of class `IslAst` - `getAst()` `getRunCondition()` `buildRunCondition()` - Removed the destructor in favor of the default one - Change the type of the attribute `IslAst.RunCondition` to `isl::ast_expr` - Change the type of the attribute `IslAst.Root` to `isl::ast_node` - Change the order of attributes in class `IslAst` to reflect the data dependencies so that the destructor won't complain - Refactoring the following methods of class `IslAstInfo` - `getAst()` `getRunCondition()` Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D100265
2021-03-15[Polly] Fix deprecation warning. NFC.Michael Kruse
IRBuilder::CreateLoad without type parameter was deprecated in 6312c538 to prepare for opaque pointers.
2021-02-09[Polly] Remove use of -O3 in regression test.Michael Kruse
In addition to that regression tests should not test the intire pass pipeline (unless they are testing the pipeline itself), the Polly-ACC currently does not support the new pass manager. If enabled by default, such tests will therefore fail. Use the -polly-gpu-runtime and -polly-gpu-arch options also as default values for the PPCGCodeGeneration pass. This requires to move the option to be moved from the pipeline-building Register passes to the PPCGCodeGeneration implementation. Fixes the spir-typesize.ll buildbot fail.
2020-11-16[Polly] Add override qualifiers.Michael Kruse
Silence compiler warnings that suggest to add override qualifiers.
2020-02-17[Polly] Fix build after IRBuilder changesNikita Popov
Simply dropping the createPollyIRBuilder() function here, because it doesn't do much. Also directly initialize Expander in ScopExpander instead of going through the copy-constructor.
2020-02-10[Polly] Update ISL to isl-0.22.1-87-gfee05a13.Michael Kruse
The primary motivation is to fix an assertion failure in isl_basic_map_alloc_equality: isl_assert(ctx, room_for_con(bmap, 1), return -1); Although the assertion does not occur anymore, I could not identify which of ISL's commits fixed it. Compared to the previous ISL version, Polly requires some changes for this update * Since ISL commit 20d3574 "perform parameter alignment by modifying both arguments to function" isl_*_gist_* and similar functions do not always align the paramter list anymore. This caused the parameter lists in JScop files to become out-of-sync. Since many regression tests use JScop files with a fixed parameter list and order, we explicitly call align_params to ensure a predictable parameter list. * ISL changed some return types to isl_size, a typedef of (signed) int. This caused some issues where the return type was unsigned int before: - No overload for std::max(unsigned,isl_size) - It cause additional 'mixed signed/unsigned comparison' warnings. Since they do not break compilation, and sizes larger than 2^31 were never supported, I am going to fix it separately. * With the change to isl_size, commit 57d547 "isl_*_list_size: return isl_size" also changed the return value in case of an error from 0 to -1. This caused undefined looping over isl_iterator since the 'end iterator' got index -1, never reached from the 'begin iterator' with index 0. * Some internal changes in ISL caused the number of operations to increase when determining access ranges to determine aliasing overlaps. In one test, this caused exceeding the default limit of 800000. The operations-limit was disabled for this test.
2020-02-05Compile-fix after StringRef's conversion operator has been made explicit.Michael Kruse
Commit 777180a "[ADT] Make StringRef's std::string conversion operator explicit" caused Polly's GPU code generator to not compile anymore. The rest of Polly has already been fixed in commit 0257a9 "Fix polly build after StringRef change."
2019-12-14[IR] Include more target specific intrinsic headersHeejin Ahn
After D71320, target-specific intrinsic headers should be included.
2019-11-14[GPGPU] Fix depricated warning.Michael Kruse
setAlignment(unsigned) was deprecated in commit: 0e62011df891d0e7ad904524edf705d07d12d5d4 [Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)
2019-11-14[GPGPU] Fix #includes.Michael Kruse
Adapt for 05da2fe52162 "Sink all InitializePasses.h includes" which forgot the GPGPU files (presumably because POLLY_ENABLE_GPGPU_CODEGEN is OFF by default).
2019-11-13Move CodeGenFileType enum to Support/CodeGen.hReid Kleckner
Avoids the need to include TargetMachine.h from various places just for an enum. Various other enums live here, such as the optimization level, TLS model, etc. Data suggests that this change probably doesn't matter, but it seems nice to have anyway.
2019-03-28Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse
This removes unused includes (and forward declarations) as suggested by include-what-you-use. If a transitive include of a removed include is required to compile a file, I added the required header (or forward declaration if suggested by include-what-you-use). This should reduce compilation time and reduce the number of iterative recompilations when a header was changed. llvm-svn: 357209
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-08-01PPCG codegenTobias Grosser
The latest version of the isl C++ bindings does not export the 'set' method yet. Fall back to the C interface until this method can be exported. llvm-svn: 338512
2018-08-01[Polly-ACC] Fix compilation after r338450. NFC.Michael Kruse
llvm-svn: 338462
2018-07-04[PPCGCodeGen] Change printf to outs() to prevent garbled output. [NFC]Siddharth Bhat
Summary: It appears that llvm uses unbuffered C++ streams. So, we should not mix C and C++ stream operations, because that will give us mixed up output. Reviewers: efriedma, jdoerfert, Meinersbur, gareevroman, sebpop, zinob, huihuiz, pollydev, grosser, singam-sanjay, philip.pfaffe Reviewed By: philip.pfaffe Subscribers: nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D40126 llvm-svn: 336288
2018-07-02[polly-acc] change cl_get_* return types to 32/64bitPhilip Pfaffe
Summary: This patch changes the return types for ocl_get_* functions during SPIR code generation. Because these functions return size_t types, the return type needs to be changed to the actual size of size_t on the device. Based on work by Michal Babej and Pekka Jääskeläinen Patch by: Alain Denzler Reviewers: grosser, philip.pfaffe, bollu Reviewed By: grosser, philip.pfaffe Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D48774 llvm-svn: 336080
2018-06-14Simplify the implementation of getCUDALibDeviceFunction. NFC.Philip Pfaffe
Summary: The function is currently awfully complicated. Drop the IILE and use StringRef over std::string. Reviewers: Meinersbur, grosser, bollu Reviewed By: Meinersbur Subscribers: nemanjai, kbarton, bollu, llvm-commits, pollydev Differential Revision: https://reviews.llvm.org/D48070 llvm-svn: 334695
2018-06-07Run clang-formatPhilip Pfaffe
llvm-svn: 334172
2018-06-07Fix a missing lambda return type that tripped the buildersPhilip Pfaffe
llvm-svn: 334166
2018-05-23[Acc] Re-land r326643 to finally fix PR33208.Philip Pfaffe
Other than before, don't clear out LI entirely but only those relevant loops. llvm-svn: 333089
2018-05-21CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne
up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
2018-05-15[polly] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen
The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44978 llvm-svn: 332352
2018-04-29Remove another set or release() callsTobias Grosser
llvm-svn: 331129
2018-03-03Revert "[Acc] Fix for PR33208"Philip Pfaffe
This reverts commit r326643. Fix didn't really fix anything. llvm-svn: 326656
2018-03-03[Acc] Fix for PR33208Philip Pfaffe
During codegen, Polly attempts to clear all loops from ScalarEvolution and LoopInfo, and it does so one block at a time. This causes undefined behaviour, since this way a loop header might be removed from a loop before the entire loop is erased, causing ScalarEvolution to run into an error. Instead, just delete the entire loop atomically. This fixes currently failing testcases. llvm-svn: 326643
2018-02-20Use isl::manage_copy to simplify calls to isl::manage(isl_.._copy())Tobias Grosser
As part of this cleanup a couple of unnecessary isl::manage(obj.copy()) pattern are eliminated as well. We checked for all potential cleanups by scanning for: "grep -R isl::manage\( lib/ | grep copy" llvm-svn: 325558
2017-11-21Run polly-update-format. NFC.Michael Kruse
polly-check-format has been failing since at least r318517, due to more than one cause. llvm-svn: 318795
2017-11-19Port ScopInfo to the isl cpp bindingsPhilip Pfaffe
Summary: Most changes are mechanical, but in one place I changed the program semantics by fixing a likely bug: In `Scop::hasFeasibleRuntimeContext()`, I'm now explicitely handling the error-case. Before, when the call to `addNonEmptyDomainConstraints()` returned a null set, this (probably) accidentally worked because isl_bool_error converts to true. I'm checking for nullptr now. Reviewers: grosser, Meinersbur, bollu Reviewed By: Meinersbur Subscribers: nemanjai, kbarton, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D39971 llvm-svn: 318632