summaryrefslogtreecommitdiffstats
path: root/polly/lib/Exchange
Commit message (Collapse)AuthorAgeFilesLines
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-281-4/+0
| | | | | | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [DepInfo] Use isl++ in Dependences::isValidSchedule. NFC.Michael Kruse2018-08-101-11/+3
| | | | | | | Also change StatementToIslMapTy to hold isl::map, because it is used as a parameter. llvm-svn: 339484
* [JSONExporter] Print instead of ignoring parser error.Michael Kruse2018-08-021-2/+3
| | | | | | | | | | | Silence the warning warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] JSONExporter is a developer tool, there is no mechanism for error handling. Print the parser error and abort with a fatal error. llvm-svn: 338659
* [JSONExporter] Try to appease buildbot. NFC.Michael Kruse2018-08-011-1/+1
| | | | | | | The compiler does not seem to able move a local variable in the function's return statement. llvm-svn: 338466
* [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.Michael Kruse2018-08-011-67/+79
| | | | | | Differential Revision: https://reviews.llvm.org/D49950 llvm-svn: 338461
* [CodeGen] Allow undefined loads in statement instances outside context.Michael Kruse2018-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | A check in assert-builds was meant to verify that a load provides a value in all statement instances (i.e. its domain). The domain is commonly gist'ed within the parameter context to contain fewer constraints. However, statement instances outside the context are no valid executions, hence the value provided can be undefined. Refine the check for valid loads to only needed to be defined within the SCoP context. In addition, the JSONImporter had to be changed to allow importing access relations that are broader than the current access relation, but still defined over all statement instances. This should fix the compiler crash in test-suite's oggenc of the -polly-process-unprofitable buildbot. llvm-svn: 329655
* Port ScopInfo to the isl cpp bindingsPhilip Pfaffe2017-11-191-22/+14
| | | | | | | | | | | | | | | | | | | | | 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
* [Support] Rename tool_output_file to ToolOutputFile, NFCReid Kleckner2017-09-231-1/+1
| | | | | | | This class isn't similar to anything from the STL, so it shouldn't use the STL naming conventions. llvm-svn: 314050
* [PM] Properly require and preserve OptimizationRemarkEmitter. NFCI.Michael Kruse2017-08-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | Properly require and preserve the OptimizationRemarkEmitter for use in ScopPass. Previously one had to get the ORE from ScopDetection because CodeGeneration did not mark it as preserved. It would need to be recomputed which results in the legacy PM to throw away all previous SCoP analysis. This also changes the implementation of ScopPass::getAnalysisUsage to not unconditionally preserve all passes, but only those needed to be preserved by any SCoP pass (at least when using the legacy PM). This allows invalidating DependenceInfo (and IslAstInfo) in case the pass would cause them to change (e.g. OpTree, DeLICM, MaximalArrayExpansion) JSONImporter should also invalidate the DependenceInfo. In this patch it marks DependenceInfo as preserved anyway because some regression tests depend on it. Differential Revision: https://reviews.llvm.org/D37010 llvm-svn: 311888
* [JSON] Make the failure to parse a jscop file a hard errorPhilip Pfaffe2017-08-101-5/+10
| | | | | | | | | | | | | | | | | | Summary: Before, if we fail to parse a jscop file, this will be reported as an error and importing is aborted. However, this isn't actually strong enough, since although the import is aborted, the scop has already been modified and is very likely broken. Instead, make this a hard failure and throw an LLVM error. This new behaviour requires small changes to the tests for the legacy pass, namely using `not` to verify the error. Further, fixed the jscop file for the base_pointer_load_is_inst_inside_invariant_1 testcase. Reviewed By: Meinersbur Split out of D36578. llvm-svn: 310599
* [JSON][PM] Port json import/export over to new pmPhilip Pfaffe2017-08-101-96/+121
| | | | | | | | | | | | | | | | Summary: I pulled out all functionality into static functions, and use those both in the legacy passes and in the new ones. Reviewers: grosser, Meinersbur, bollu Reviewed By: Meinersbur Subscribers: llvm-commits, pollydev Differential Revision: https://reviews.llvm.org/D36578 llvm-svn: 310597
* [ScopInfo] Translate Scop::getParamSpace to isl++ [NFC]Tobias Grosser2017-08-061-3/+3
| | | | llvm-svn: 310224
* [ScopInfo] Translate Scop::getContext to isl++ [NFC]Tobias Grosser2017-08-061-3/+3
| | | | llvm-svn: 310221
* [ScopInfo] Move ScopStmt::getSchedule to isl++Tobias Grosser2017-08-061-1/+2
| | | | llvm-svn: 310215
* Move ScopInfo::getDomain(), getDomainSpace(), getDomainId() to isl++Tobias Grosser2017-08-061-1/+1
| | | | llvm-svn: 310209
* Move setNewAccessRelation to isl++Tobias Grosser2017-08-021-1/+1
| | | | llvm-svn: 309871
* Move ScopArrayInfo::getFromAccessFunction and getFromId to isl++Tobias Grosser2017-07-241-1/+1
| | | | llvm-svn: 308892
* Move MemoryAccess::NewAccessRelation to isl++Tobias Grosser2017-07-231-1/+1
| | | | | | We also move related accessor functions llvm-svn: 308840
* Move ScopArrayInfo to isl++Tobias Grosser2017-07-211-1/+1
| | | | | | This moves the full ScopArrayInfo class to isl++ llvm-svn: 308801
* [ScopInfo] Print instructions in dump().Michael Kruse2017-07-211-2/+2
| | | | | | | | | | | | | | | | | | | Print a statement's instruction on dump() regardless of -polly-print-instructions. dump() is supposed to be used in the debugger only and never in regression tests. While debugging, get all the information we have and we are not bound to break anything. For non-dump purposes of print, forward the setting of -polly-print-instructions as parameters. Some calls to print() had to be changed because the PollyPrintInstructions setting is only available in ScopInfo.cpp. In ScheduleOptimizer.cpp, dump() was used in regression tests. That's not what dump() is for. The print parameter "PrintInstructions" will also be useful for an explicit print SCoP pass in a future patch. llvm-svn: 308746
* Always export the latest memory access relationsTobias Grosser2017-07-111-1/+1
| | | | | | This allows us to export the results from transformations such as DeLICM. llvm-svn: 307641
* Heap allocation for new arrays.Michael Kruse2017-06-281-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch aims to implement the option of allocating new arrays created by polly on heap instead of stack. To enable this option, a key named 'allocation' must be written in the imported json file with the value 'heap'. We need such a feature because in a next iteration, we will implement a mechanism of maximal static expansion which will need a way to allocate arrays on heap. Indeed, the expansion is very costly in terms of memory and doing the allocation on stack is not worth considering. The malloc and the free are added respectively at polly.start and polly.exiting such that there is no use-after-free (for instance in case of Scop in a loop) and such that all memory cells allocated with a malloc are free'd when we don't need them anymore. We also add : - In the class ScopArrayInfo, we add a boolean as member called IsOnHeap which represents the fact that the array in allocated on heap or not. - A new branch in the method allocateNewArrays in the ISLNodeBuilder for the case of heap allocation. allocateNewArrays now takes a BBPair containing polly.start and polly.exiting. allocateNewArrays takes this two blocks and add the malloc and free calls respectively to polly.start and polly.exiting. - As IntPtrTy for the malloc call, we use the DataLayout one. To do that, we have modified : - createScopArrayInfo and getOrCreateScopArrayInfo such that it returns a non-const SAI, in order to be able to call setIsOnHeap in the JSONImporter. - executeScopConditionnaly such that it return both start block and end block of the scop, because we need this two blocs to be able to add the malloc and the free calls at the right position. Differential Revision: https://reviews.llvm.org/D33688 llvm-svn: 306540
* [JSONImport] Check, if the size of an imported array is positiveAndreas Simbuerger2017-06-271-1/+9
| | | | llvm-svn: 306479
* Fix a lot of typos. NFC.Michael Kruse2017-06-081-1/+1
| | | | llvm-svn: 304974
* [JScop] Emit error messages on error.Michael Kruse2017-06-061-3/+9
| | | | | | In importArrays instead of silently ignoring the file. llvm-svn: 304817
* [JSONImporter] misses checks whether the data it imports makes sense.Michael Kruse2017-05-241-7/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the JSONImporter did not verify if the data it loads were correct or not (Bug llvm.org/PR32543). I add some checks in the JSONImporter class and some test cases. Here are the checks (and test cases) I added : JSONImporter::importContext - The "context" key does not exist. - The context was not parsed successfully by ISL. - The isl_set has the wrong number of parameters. - The isl_set is not a parameter set. JSONImporter::importSchedule - The "statements" key does not exist. - There is not the right number of statement in the file. - The "schedule" key does not exist. - The schedule was not parsed successfully by ISL. JSONImporter::importAccesses - The "statements" key does not exist. - There is not the right number of statement in the file. - The "accesses" key does not exist. - There is not the right number of memory accesses in the file. - The "relation" key does not exist. - The memory access was not parsed successfully by ISL. JSONImporter::areArraysEqual - The "type" key does not exist. - The "sizes" key does not exist. - The "name" key does not exist. JSONImporter::importArrays /!\ Do not check if there is an key name "arrays" because it is not considered as an error. All checks are already in place or implemented in JSONImporter::areArraysEqual. Contributed-by: Nicolas Bonfante <nicolas.bonfante@insa-lyon.fr> Differential Revision: https://reviews.llvm.org/D32739 llvm-svn: 303759
* [CodeGen] Support partial write accesses.Michael Kruse2017-05-211-2/+3
| | | | | | | | | | | | | | | | | | | Allow the BlockGenerator to generate memory writes that are not defined over the complete statement domain, but only over a subset of it. It generates a condition that evaluates to 1 if executing the subdomain, and only then execute the access. Only write accesses are supported. Read accesses would require a PHINode which has a value if the access is not executed. Partial write makes DeLICM able to apply mappings that are not defined over the entire domain (for instance, a branch that leaves a loop with a PHINode in its header; a MemoryKind::PHI write when leaving is never read by its PHI read). Differential Revision: https://reviews.llvm.org/D33255 llvm-svn: 303517
* Perform copying to created arrays according to the packing transformationRoman Gareev2016-09-141-0/+2
| | | | | | | | | | | | | | | | This is the fourth patch to apply the BLIS matmul optimization pattern on matmul kernels (http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf). BLIS implements gemm as three nested loops around a macro-kernel, plus two packing routines. The macro-kernel is implemented in terms of two additional loops around a micro-kernel. The micro-kernel is a loop around a rank-1 (i.e., outer product) update. In this change we perform copying to created arrays, which is the last step to implement the packing transformation. Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D23260 llvm-svn: 281441
* Store the size of the outermost dimension in case of newly created arrays ↵Roman Gareev2016-09-121-4/+9
| | | | | | | | | | | | | that require memory allocation. We do not need the size of the outermost dimension in most cases, but if we allocate memory for newly created arrays, that size is needed. Reviewed-by: Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D23991 llvm-svn: 281234
* Drop '@brief' from doxygen commentsTobias Grosser2016-09-021-8/+8
| | | | | | | | LLVM's coding guideline suggests to not use @brief for one-sentence doxygen comments to improve readability. Switch this once and for all to ensure people do not copy @brief comments from other parts of Polly, when writing new code. llvm-svn: 280468
* Allow mapping scalar MemoryAccesses to array elements.Michael Kruse2016-09-011-2/+8
| | | | | | | | | | | | | | | | | | | | | | Change the code around setNewAccessRelation to allow to use a an existing array element for memory instead of an ad-hoc alloca. This facility will be used for DeLICM/DeGVN to convert scalar dependencies into regular ones. The changes necessary include: - Make the code generator use the implicit locations instead of the alloca ones. - A test case - Make the JScop importer accept changes of scalar accesses for that test case. - Adapt the MemoryAccess interface to the fact that the MemoryKind can change. They are named (get|is)OriginalXXX() to get the status of the memory access before any change by setNewAccessRelation() (some properties such as getIncoming() do not change even if the kind is changed and are still required). To get the modified properties, there is (get|is)LatestXXX(). The old accessors without Original|Latest become synonyms of the (get|is)OriginalXXX() to not make functional changes in unrelated code. Differential Revision: https://reviews.llvm.org/D23962 llvm-svn: 280408
* Add space between access string and follow-up.Michael Kruse2016-08-261-1/+1
| | | | llvm-svn: 279826
* Extend the jscop interface to allow the user to declare new arrays and to ↵Roman Gareev2016-07-301-6/+163
| | | | | | | | | | | | | | | | reference these arrays from access expressions Extend the jscop interface to allow the user to export arrays. It is required that already existing arrays of the list of arrays correspond to arrays of the SCoP. Each array that is appended to the list will be newly created. Furthermore, we allow the user to modify access expressions to reference any array in case it has the same element type. Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D22828 llvm-svn: 277263
* JScop: Factor out importContext [NFC]Tobias Grosser2016-07-211-85/+104
| | | | | | | | This makes the structure of the code clearer and reduces the size of runOnScop. We also adjust the coding style to the latest LLVM style guide. llvm-svn: 276246
* JScop: Factor out importContext [NFC]Tobias Grosser2016-07-211-11/+27
| | | | | | | | This makes the structure of the code clearer and reduces the size of runOnScop. We also adjust the coding style to the latest LLVM style guide. llvm-svn: 276245
* JScop: Factor out importSchedule [NFC]Tobias Grosser2016-07-211-39/+58
| | | | | | | | This makes the structure of the code clearer and reduces the size of runOnScop. We also adjust the coding style to the latest LLVM style guide. llvm-svn: 276244
* clang-tidy: Add llvm namespace commentsTobias Grosser2016-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | llvm commonly adds a comment to the closing brace of a namespace to indicate which namespace is closed. clang-tidy provides with llvm-namespace-comment a handy tool to check for this habit. We use it to ensure we consitently use namespace comments in Polly. There are slightly different styles in how namespaces are closed in LLVM. As there is no large difference between the different comment styles we go for the style clang-tidy suggests by default. To reproduce this fix run: for i in `ls tools/polly/lib/*/*.cpp`; \ clang-tidy -checks='-*,llvm-namespace-comment' -p build $i -fix \ -header-filter=".*"; \ done This cleanup was suggested by Eugene Zelenko <eugene.zelenko@gmail.com> in http://reviews.llvm.org/D21488 and was split out to increase readability. llvm-svn: 273621
* Decouple SCoP building logic from passJohannes Doerfert2016-05-311-1/+1
| | | | | | | | | | | | | | | | Created a new pass ScopInfoRegionPass. As name suggests, it is a region pass and it is there to preserve compatibility with our existing Polly passes. ScopInfoRegionPass will return a SCoP object for a valid region while the creation of the SCoP stays in the ScopInfo class. Contributed-by: Utpal Bora <cs14mtech11017@iith.ac.in> Reviewed-by: Tobias Grosser <tobias@grosser.es>, Johannes Doerfert <doerfert@cs.uni-saarland.de> Differential Revision: http://reviews.llvm.org/D20770 llvm-svn: 271259
* Directly access information through the Scop class [NFC]Johannes Doerfert2016-05-231-12/+8
| | | | llvm-svn: 270421
* Allow the client of DependenceInfo to obtain dependences at different ↵Hongbin Zheng2016-03-031-1/+2
| | | | | | granularities. llvm-svn: 262591
* Do not check JSON alignment of scalar accessesMichael Kruse2016-01-151-26/+28
| | | | | | | | | | | | | | | When importing a schedule, do not verify the load/store alignment of scalar accesses. Scalar loads/store are always created newly in code generation with no alignment restrictions. Previously, scalar alignment was checked if the access instruction happened to be a LoadInst or StoreInst, but only its array (MK_Array) access is relevant. This will be implicitly unit-tested when the access instruction of a value read can be nullptr. Differential Revision: http://reviews.llvm.org/D15680 llvm-svn: 257904
* Adjust formatting to clang-format changes in 256149Tobias Grosser2015-12-211-1/+1
| | | | llvm-svn: 256151
* [NFC] Consistenly use commented and annotated ScopPass functionsJohannes Doerfert2015-09-271-6/+19
| | | | | | | | | | | The changes affect methods that are part of the Pass interface and include: - Comments that describe the methods purpose. - A consistent use of the keywords override and virtual. Additionally, the printScop method is now optional and removed from SCoP passes that do not implement it. llvm-svn: 248685
* Allow the import of multi-dimensional access functionsTobias Grosser2015-09-051-6/+0
| | | | | | | | | | | Originally, we disallowed the import of multi-dimensional access functions due to our code generation not supporting the generation of new address expressions for multi-dimensional memory accesses. When building our run-time alias check infrastructure we added code generation support for multi-dimensional address calculations. Hence, we can now savely allow the import of new multi-dimensional access functions. llvm-svn: 246917
* Use schedule trees to represent execution order of statementsTobias Grosser2015-07-141-1/+7
| | | | | | | | | | | | | | | | | | Instead of flat schedules, we now use so-called schedule trees to represent the execution order of the statements in a SCoP. Schedule trees make it a lot easier to analyze, understand and modify properties of a schedule, as specific nodes in the tree can be choosen and possibly replaced. This patch does not yet fully move our DependenceInfo pass to schedule trees, as some additional performance analysis is needed here. (In general schedule trees should be faster in compile-time, as the more structured representation is generally easier to analyze and work with). We also can not yet perform the reduction analysis on schedule trees. For more information regarding schedule trees, please see Section 6 of https://lirias.kuleuven.be/handle/123456789/497238 llvm-svn: 242130
* Ensure memory access mappings are defined for full domainTobias Grosser2015-06-041-0/+22
| | | | | | | | | | | | | | We now verify that memory access functions imported via JSON are indeed defined for the full iteration domain. Before this change we accidentally imported memory mappings such as i -> i / 127, which only defined a mapped for values of i that are evenly divisible by 127, but which did not define any mapping for the remaining values, with the result that isl just generated an access expression that had undefined behavior for all the unmapped values. In the incorrect test cases, we now either use floor(i/127) or we use p/127 and provide the information that p is indeed a multiple of 127. llvm-svn: 239024
* Use value semantics for list of ScopStmt(s) instead of std::owningptrTobias Grosser2015-05-271-13/+13
| | | | | | | | | | | | | | | | David Blaike suggested this as an alternative to the use of owningptr(s) for our memory management, as value semantics allow to avoid the additional interface complexity caused by owningptr while still providing similar memory consistency guarantees. We could also have used a std::vector, but the use of std::vector would yield possibly changing pointers which currently causes problems as for example the memory accesses carry pointers to their parent statements. Such pointers should not change. Reviewer: jblaikie, jdoerfert Differential Revision: http://reviews.llvm.org/D10041 llvm-svn: 238290
* Use unique_ptr to clarify ownership of ScopStmtTobias Grosser2015-05-231-14/+8
| | | | llvm-svn: 238090
OpenPOWER on IntegriCloud