- Sep 13, 2016
-
-
Michael Kruse authored
The alias to the array element is read-only and a primitive type (pointer), therefore use the value directly instead of a reference to it. llvm-svn: 281311
-
Tobias Grosser authored
llvm-svn: 281305
-
Tobias Grosser authored
This prevents a compiler crash. llvm-svn: 281303
-
- Sep 12, 2016
-
-
Michael Kruse authored
The flag -fvisibility=hidden flag was used for the integrated Integer Set Library (and PPCG) to keep their definitions local to Polly. The motivation was the be loaded into a DragonEgg-powered GCC, where GCC might itself use ISL for its Graphite extension. The symbols of Polly's ISL and GCC's ISL would clash. The DragonEgg project is not actively developed anymore, but Polly's unittests need to call ISL functions to set up a testing environment. Unfortunately, the -fvisibility=hidden flag means that the ISL symbols are not available to the gtest executable as it resides outside of libPolly when linked dynamically. Currently, CMake links a second copy of ISL into the unittests which leads to subtle bugs. What got observed is that two isl_ids for isl_id_none exist, one for each library instance. Because isl_id's are compared by address, isl_id_none could happen to be different from isl_id_none, depending on which library instance set the address and does the comparison. Also remove the FORCE_STATIC flag which was introduced to keep the ISL symbols visible inside the same libPolly shared object, even when build with BUILD_SHARED_LIBS. Differential Revision: https://reviews.llvm.org/D24460 llvm-svn: 281242
-
Roman Gareev authored
Store the size of the outermost dimension in case of newly created arrays 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
-
Tobias Grosser authored
Instead of aborting, we now bail out gracefully in case the kernel IR we generate is invalid. This can currently happen in case the SCoP stores pointer values, which we model as arrays, as data values into other arrays. In this case, the original pointer value is not available on the device and can consequently not be stored. As detecting this ahead of time is not so easy, we detect these situations after the invalid IR has been generated and bail out. llvm-svn: 281193
-
- Sep 11, 2016
-
-
Tobias Grosser authored
If these arrays have never been accessed we failed to derive an upper bound of the accesses and consequently a size for the outermost dimension. We now explicitly check for empty access sets and then just use zero as size for the outermost dimension. llvm-svn: 281165
-
- Sep 09, 2016
-
-
Tobias Grosser authored
This resolves "isl_space.c:1775: not a parameter space" errors I have seen on two systems. llvm-svn: 281052
-
Tobias Grosser authored
llvm-svn: 281034
-
- Sep 08, 2016
-
-
Michael Kruse authored
The -polly-flatten-schedule pass reduces the number of scattering dimensions in its isl_union_map form to make them easier to understand. It is not meant to be used in production, only for debugging and regression tests. To illustrate, how it can make sets simpler, here is a lifetime set used computed by the porposed DeLICM pass without flattening: { Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0; Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5; Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0; Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3; Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 } And here the same lifetime for a semantically identical one-dimensional schedule: { Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 } Differential Revision: https://reviews.llvm.org/D24310 llvm-svn: 280948
-
Tobias Grosser authored
... to preserve reference counting logic. In practice the missing assignment would not have caused any issues. We still fix it as the code is wrong and it also causes noise in the clang static analysis runs. llvm-svn: 280946
-
Tobias Grosser authored
llvm-svn: 280943
-
Tobias Grosser authored
When running the clang static analyser to check for memory issues, this code originally showed a double free, as the analyser was unable to understand that isl_set_free always returns NULL and consequently later uses of the isl object we just freed will never be reached. Without this knowledge, the analyser has to issue a warning. We refactor the code to make it clear that for empty maps the current loop iteration is aborted. llvm-svn: 280940
-
Tobias Grosser authored
This code path is likely never triggered, but by still handling this case locally we avoid warnings in clangs static analyzer. llvm-svn: 280939
-
Tobias Grosser authored
When running the clang static analyser to check for memory issues, this code originally showed a double free, as the analyser was unable to understand that isl_union_map_free always returns NULL and consequently later uses of the isl object we just freed will never be reached. Without this knowledge, the analyser has to issue a warning. We refactor the code to make it clear that for empty maps the current loop iteration is aborted. llvm-svn: 280938
-
Tobias Grosser authored
llvm-svn: 280936
-
Tobias Grosser authored
llvm-svn: 280923
-
- Sep 07, 2016
-
-
Michael Kruse authored
Disable some Visual C++ warnings on ISL. These are not reported by GCC/Clang in the ISL build system. We do not intend to fix them in the Polly in-tree copy, hence disable these warnings. llvm-svn: 280811
-
- Sep 03, 2016
-
-
Tobias Grosser authored
... but instead rely on the assumptions that we derive for load/store instructions. Before we were able to delinearize arrays, we used GEP pointer instructions to derive information about the likely range of induction variables, which gave us more freedom during loop scheduling. Today, this is not needed any more as we delinearize multi-dimensional memory accesses and as part of this process also "assume" that all accesses to these arrays remain inbounds. The old derive-assumptions-from-GEP code has consequently become mostly redundant. We drop it both to clean up our code, but also to improve compile time. This change reduces the scop construction time for 3mm in no-asserts mode on my machine from 48 to 37 ms. llvm-svn: 280601
-
Tobias Grosser authored
Without reductions we do not need a flat union_map schedule describing the computation we want to perform, but can work purely on the schedule tree. This reduces the dependence computation and scheduling time from 33ms to 25ms. Another 30% reduction. llvm-svn: 280558
-
Tobias Grosser authored
In case we do not compute reduction dependences or dependences that are more fine-grained than statement level dependences, we can avoid the corresponding part of the dependence analysis all together. For the 3mm benchmark, this reduces scheduling + dependence analysis time from 62ms to 33ms for a no-asserts build. The majority of the compile time is anyhow spent in the LLVM backends, when doing code generation. Nevertheless, there is no need to waste compile time either. llvm-svn: 280557
-
Tobias Grosser authored
We replace the options -polly-code-generator=none =isl with the options -polly-code-generation=none =ast =full This allows us to measure the overhead of Polly itself, versus the compile time increases due to us generating more IR and consequently the LLVM backends spending more time on this IR. We also use this opportunity to rename the option. The original name was introduced at a point where we still had two code generators. CLooG and the isl AST generator. Since we only have one AST generator left, there is no need to distinguish between 'isl' and something else. However, being able to disable code generation all together has been shown useful for debugging. Hence, we rename and extend this option to make it a good fit for its new use case. llvm-svn: 280554
-
- Sep 02, 2016
-
-
Tobias Grosser authored
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
-
- Sep 01, 2016
-
-
Michael Kruse authored
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
-
Michael Kruse authored
There are some constraints on maps that can be access relations. In builds with assertions enabled, verify - The access domain is the same space as the statement's domain (modulo parameters). - Whether an access is defined for every instance of the statement. (codegen does not yet support partial access relations) - Whether the access range links to an array, represented by a ScopArrayInfo. - The number of access dimensions equals the dimensions of the array. - The array is not an indirect access. (also not supported by codegen) Differential Revision: https://reviews.llvm.org/D23916 llvm-svn: 280404
-
Michael Kruse authored
llvm-svn: 280343
-
Michael Kruse authored
This version has isl_space_has_equal_tuples added to the public API. llvm-svn: 280341
-
- Aug 26, 2016
-
-
Michael Kruse authored
llvm-svn: 279826
-
Tobias Grosser authored
The recent unit tests we gained made clear that the semantics of isl_valFromAPInt are not clear, due to missing documentation. In this change we document both the calling interface as well as the implementation of isl_valFromAPInt. We also make the implementation easier to read by removing integer wrappig in abs() when passing in the minimal integer value for a given bitwidth. Even though wrapping and subsequently interpreting the result as unsigned value gives the correct result, this is far from obvious. Instead, we explicitly add one more bit to the input type to ensure that abs will never wrap. This change did not uncover a bug in the old implementation, but was introduced to increase readability. We update the tests to add a test case for this special case and use this opportunity to also test a number larger than 64 bit. Finally, we order the arguments of the test cases to make sure the expected output is first. This helps readability in case of failing test cases as gtest assumes the first value to be the exected value. Reviewed-by:
Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D23917 llvm-svn: 279815
-
Tobias Grosser authored
The recent unit tests we gained made clear that the semantics of APIntFromVal are not clear, due to missing documentation. In this change we document both the calling interface as well as the implementation of APIntFromVal. We also make the implementation easier to read by removing the use of magic numbers. Finally, we add tests to check the bitwidth of the created values as well as the correct modeling of very large numbers. Reviewed-by:
Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D23910 llvm-svn: 279813
-
- Aug 23, 2016
-
-
Tim Shen authored
llvm-svn: 279488
-
- Aug 21, 2016
-
-
Roman Gareev authored
Dump polyhedral descriptions of Scops optimized with the isl scheduling optimizer and the set of post-scheduling transformations applied on the schedule tree to be able to check the work of the IslScheduleOptimizer pass at the polyhedral level. Reviewed-by:
Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D23740 llvm-svn: 279395
-
Roman Gareev authored
getAccessFunctions() is dead code and the 'BB' argument of getOrCreateAccessFunctions() is not used. This patch deletes getAccessFunctions and transforms AccFuncMap into a std::vector<std::unique_ptr<MemoryAccess>> AccessFunctions. Reviewed-by:
Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D23759 llvm-svn: 279394
-
- Aug 18, 2016
-
-
Eli Friedman authored
The existing code would add the operands in the wrong order, and eventually crash because the SCEV expression doesn't exactly match the parameter SCEV expression in SCEVAffinator::visit. (SCEV doesn't sort the operands to getMulExpr in general.) Differential Revision: https://reviews.llvm.org/D23592 llvm-svn: 279087
-
Tobias Grosser authored
We already invalidated a couple of critical values earlier on, but we now invalidate all instructions contained in a scop after the scop has been code generated. This is necessary as later scops may otherwise obtain SCEV expressions that reference values in the earlier scop that before dominated the later scop, but which had been moved into the conditional branch and consequently do not dominate the later scop any more. If these very values are then used during code generation of the later scop, we generate used that are dominated by the values they use. This fixes: http://llvm.org/PR28984 llvm-svn: 279047
-
- Aug 17, 2016
-
-
Michael Kruse authored
This version fixes a bug in set coalescing. llvm-svn: 278936
-
- Aug 16, 2016
-
-
Tobias Grosser authored
Normally this is ensured when adding PHI nodes, but as PHI node dependences do not need to be added in case all incoming blocks are within the same non-affine region, this was missed. This corrects an issue visible in LNT's sqlite3, in case invariant load hoisting was disabled. llvm-svn: 278792
-
- Aug 15, 2016
-
-
Tobias Grosser authored
llvm-svn: 278738
-
Tobias Grosser authored
With invariant load hoisting enabled the LLVM buildbots currently show some miscompiles, which are possibly caused by invariant load hosting itself. Confirming and fixing this requires a more in-depth analysis. To meanwhile get back green buildbots that allow us to observe other regressions, we disable invariant code hoisting temporarily. The relevant bug is tracked at: http://llvm.org/PR28985 llvm-svn: 278681
-
Roman Gareev authored
Perform replacement of access relations and creation of new arrays according to the packing transformation This is the third 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 replacement of the access relations and create empty arrays, which are steps to implement the packing transformation. In subsequent changes we will implement copying to created arrays. Reviewed-by:
Tobias Grosser <tobias@grosser.es> Differential Revision: http://reviews.llvm.org/D22187 llvm-svn: 278666
-