summaryrefslogtreecommitdiffstats
path: root/polly/test/DeLICM
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update polly test for SCEV change."Tim Northover2019-09-301-1/+1
| | | | | | The motivating SCEV change was reverted as incorrect. llvm-svn: 373185
* Update polly test for SCEV change.Eli Friedman2019-07-181-1/+1
| | | | | | | r366419 adds nsw to more SCEV expressions, which allows polly to make more aggressive assumptions about the input expressions. llvm-svn: 366510
* [DeLICM] Use polly::singleton to allow empty result.Michael Kruse2019-05-211-0/+77
| | | | | | | | | | | isl_map_from_union_map cannot determine the map's space if the union_map is empty. polly::singleton was designed for this case. We pass the expected map space to avoid crashing in isl_map_from_union_map. This fixes an issue found by the aosp buildbot. Thanks to Eli Friedman for the reproducer. llvm-svn: 361290
* [ZoneAlgo] Fix PHI inconsistency in invalid contexts.Michael Kruse2019-05-102-1/+90
| | | | | | | | | | PHI nodes (reads) could point to multiple instances of predecessor blocks (PHI writes) when in an invalid context. Fix by removing PHI instances that are in an invalid or ouside assumed context. This fixes llvm.org/PR41656. llvm-svn: 360454
* [DeLICM] Avoid assertion on out-of-quota.Michael Kruse2018-05-161-0/+131
| | | | | | | | | | An assertion was not prepared to be passed a nullptr because the out-of-quota limit was exceeded. Bail-out before the assertion since the assertion does not apply on out-of-quote. This fixes llvm.org/PR37477. llvm-svn: 332488
* Update isl to isl-0.18-1047-g4a20ef8Tobias Grosser2018-02-201-1/+1
| | | | | | | | | | | | | | | | | | This update: - Removes several deprecated functions (e.g., isl_band). - Improves the pretty-printing of sets by detecting modulos and "false" equalities. - Minor improvements to coalescing and increased robustness of the isl scheduler. This update does not yet include isl commit isl-0.18-90-gd00cb45 (isl_pw_*_alloc: add missing check for compatible spaces, Wed Sep 6 12:18:04 2017 +0200), as this additional check is too tight and unfortunately causes two test case failures in Polly. A patch has been submitted to isl and will be included in the next isl update for Polly. llvm-svn: 325557
* [ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.Michael Kruse2018-02-0325-29/+29
| | | | | | | | | | | | | | | | | | | | Splitting basic blocks into multiple statements if there are now additional scalar dependencies gives more freedom to the scheduler, but more statements also means higher compile-time complexity. Switch to finer statement granularity, the additional compile time should be limited by the number of operations quota. The regression tests are written for the -polly-stmt-granularity=bb setting, therefore we add that flag to those tests that break with the new default. Some of the tests only fail because the statements are named differently due to a basic block resulting in multiple statements, but which are removed during simplification of statements without side-effects. Previous commits tried to reduce this effect, but it is not completely avoidable. Differential Revision: https://reviews.llvm.org/D42151 llvm-svn: 324169
* Fix isl out-of-quota errors affecting later quota guards.Michael Kruse2017-12-221-0/+14
| | | | | | | | | | | | | | | | | | | If an out-of-quota error occurred, the last error would be isl_error_quota unless a different error occured. We typically check whether the max-operations occured by comparing to that error value after leaving the quota guard. This would check whether there ever was a quota-error, not just in the last quota guards. The observable bug occurred if the max-operations limit was reached in DeLICM, and if -polly-dependences-computout=0, DependenceInfo would think that the quota for computing dependencies was the reason, i.e., fail the operation even if the calculation itself was successful. Fix by reseting the last error to isl_error_none when entering a quota guard, signaling that no quota error occured unless in the guard's scope. llvm-svn: 321329
* [DeLICM] Fix wrong assumed access execution order.Michael Kruse2017-10-313-0/+135
| | | | | | | | | | | | | | ForwardOpTree may already transform a scalar access to an array accesses. The access remains implicit (isOriginalScalarKind(), meaning that the access is always executed at the begin/end of a statement), but targets an array (isLatestArrayKind(), which is unrelated to whether the execution is implicit/explicit). Fix by properly using isOriginalXXX() to determine execution order. This fixes the buildbots on MultiSource/Benchmarks/DOE-ProxyApps-C/miniGMG. llvm-svn: 316995
* [DeLICM] Add more tests for loop layouts. NFC.Michael Kruse2017-10-269-0/+1033
| | | | llvm-svn: 316642
* [DeLICM] Do not try to map to multiple array elements.Michael Kruse2017-10-242-115/+70
| | | | | | | | | | | | | | | | | Add check and skip when the store used to determine the target accesses multiple array elements. Only a single array location should for mapping the scalar. Having multiple creates problems when deciding which element to load from. While MemoryAccess::getAddressFunction() should select just one of them, other problems arise in code that assumes that there is just one target element per statement instance. This fixes llvm.org/PR34989 This also reverts r313902 which fixed llvm.org/PR34485 also caused by a non-functional target array element. This patch avoids the situation to occur in the first place. llvm-svn: 316432
* [DeLICM] Allow non-injective PHIRead->PHIWrite mapping.Michael Kruse2017-09-211-0/+115
| | | | | | | | | | | | | | | | | | | | Remove an assertion that tests the injectivity of the PHIRead -> PHIWrite relation. That is, allow a single PHI write to be used by multiple PHI reads. This may happen due to some statements containing the PHI write not having the statement instances that would overwrite the previous incoming value due to (assumed/invalid) contexts. This result in that PHI write is mapped to multiple targets which is not supported. Codegen will select one one of the targets using getAddressFunction(). However, the runtime check should protect us from this case ever being executed. We therefore allow injective PHI relations. Additional calculations to detect/santitize this case would probably not be worth the compuational effort. This fixes llvm.org/PR34485 llvm-svn: 313902
* [test] Add forgotten REQUIRES: line.Michael Kruse2017-09-061-0/+1
| | | | llvm-svn: 312632
* [ZoneAlgo] Handle non-StoreInst/LoadInst MemoryAccesses including memset.Michael Kruse2017-09-062-7/+79
| | | | | | | | | | | Up to now ZoneAlgo considered array elements access by something else than a LoadInst or StoreInst as not analyzable. This patch removes that restriction by using the unknown ValInst to describe the written content, repectively the element type's null value in case of memset. Differential Revision: https://reviews.llvm.org/D37362 llvm-svn: 312630
* [ZoneAlgo] More fine-grained bail-out.Michael Kruse2017-08-281-0/+103
| | | | | | | | | | | | | | | | | | | | | ZoneAlgo used to bail out for the complete SCoP if it encountered something violating its assumption. This meant the neither OpTree can forward any load nor DeLICM do anything in such cases, even if their transformations are unrelated to the violations. This patch adds a list of compatible elements (currently with the granularity of entire arrays) that can be used for analysis. OpTree and DeLICM can then check whether their transformations only concern compatible elements, and skip non-compatible ones. This will be useful for e.g. Polybench's benchmarks covariance, correlation, bicg, doitgen, durbin, gramschmidt, adi that have assumption violation, but which are not necessarily relevant for all transformations. Differential Revision: https://reviews.llvm.org/D37219 llvm-svn: 311929
* [DeLICM] Properly handle PHI writes becoming empty partial writes.Michael Kruse2017-08-081-0/+80
| | | | | | | | | | | | | It is possible that partial writes are empty (write is never executed). In this case, when in PHINode's incoming edge is never taken such that the incoming write becomes an empty partial write, if enabled. The issue is that when converting the union_map to an map, it's space cannot be derived from the union_map itself. Rather, we need to determine its space independently. This fixes test-suite's MultiSource/Benchmarks/ASC_Sequoia/CrystalMk. llvm-svn: 310348
* [test] Add some missing options that become necessary after the recent ↵Tobias Grosser2017-08-071-2/+2
| | | | | | default changes llvm-svn: 310315
* [test] Add one more test case for the previous commitTobias Grosser2017-08-071-0/+108
| | | | llvm-svn: 310312
* [test] Fix typo in filename. NFC.Michael Kruse2017-07-281-0/+0
| | | | llvm-svn: 309403
* [ScopInfo] Simplify new access functions under domain contextTobias Grosser2017-07-1711-105/+105
| | | | | | | | | | | | | | | | | | | | | | | Summary: We do not keep domain constraints on access functions when building the scop. Hence, for consistency reasons, it makes also sense to not include them when storing a new access function. This change results in simpler access functions that make output easier to read. This patch also helps to make DeLICMed memory accesses to be understood by our matrix multiplication pattern matching pass. Further changes to the matrix multiplication pattern matching are needed for this to work, so the corresponding test case will be added in a future commit. Reviewers: Meinersbur, bollu, gareevroman, efriedma, huihuiz, sebpop, simbuerg Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D35237 llvm-svn: 308215
* [Invariant Loads] Do not consider invariant loads to have dependences.Siddharth Bhat2017-07-131-14/+4
| | | | | | | | | | | | | | | | | We need to relax constraints on invariant loads so that they do not create fake RAW dependences. So, we do not consider invariant loads as scalar dependences in a region. During these changes, it turned out that we do not consider `llvm::Value` replacements correctly within `PPCGCodeGeneration` and `ISLNodeBuilder`. The replacements dictated by `ValueMap` were not being followed in all places. This was fixed in this commit. There is no clean way to decouple this change because this bug only seems to arise when the relaxed version of invariant load hoisting was enabled. Differential Revision: https://reviews.llvm.org/D35120 llvm-svn: 307907
* [DeLICM] Partial writes for PHIs.Michael Kruse2017-05-243-0/+166
| | | | | | | | | | | | | | Enable the use for partial writes for PHI write accesses with a switch. This simply skips the test for whether a PHI write would be partial. The analog test for partial value writes also protects for partial reads which we do not support (yet). It is possible to test for partial reads separately such that we could skip the partial write check as well. In case this shows up to be useful, I can implement it as well. Differential Revision: https://reviews.llvm.org/D33487 llvm-svn: 303762
* [DeLICM] Always normalize domain. NFC.Michael Kruse2017-05-101-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some isl functions can simplify their __isl_keep arguments. The argument object after the call uses different contraints to represent the same set. Different contraints can result in different outputs when printed to a string. In assert builds additional isl functions are called (in assert() or mentioned, these can change the internal representation of its read-only arguments such that printed strings are different in debug and non-debug builds. What happened here is that a call to isl_set_is_equal inside an assert in getScatterFor normalizes one of its arguments such that one redundant constraint is removed. The redundant constraint therefore does not appear in the string representing the domain, which FileCheck notices as a regression test failure compared to a build with assertions disabled. This fix removes the redundant contraints the domain from the start such that the redundant contraint is removed in assert and non-assert builds. Isl adds a flag to such sets such that the removal of redundancies is not done multiple times (here: by isl_set_is_equal). Thanks to Tobias Grosser for reporting and hinting to the cause. llvm-svn: 302711
* Really disable test as intended in the previous commitTobias Grosser2017-05-061-1/+1
| | | | llvm-svn: 302360
* Disable test to avoid buildbot noiseTobias Grosser2017-05-061-1/+4
| | | | | | | This test was introduced in r302339. It works on my system, but breaks on the buildbots. llvm-svn: 302358
* [DeLICM] Known knowledge.Michael Kruse2017-05-0610-5/+872
| | | | | | | | | | | | | Extend the Knowledge class to store information about the contents of array elements and which values are written. Two knowledges do not conflict the known content is the same. The content information if computed from writes to and loads from the array elements, and represented by "ValInst": isl spaces that compare equal if the value represented is the same. Differential Revision: https://reviews.llvm.org/D31247 llvm-svn: 302339
* [DeLICM] Add -polly-delicm-overapproximate-writes option.Michael Kruse2017-03-091-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the current limitations of DeLICM is that it only creates PHI WRITEs that it knows are read by some PHI. Such writes may not span all instances of a statement. Polly's code generator currently does not support MemoryAccesses that are not executed in all instances ('partial accesses') and so has to give up on a possible mapping. This workaround has once been suggested by Tobias Grosser: Try to interpolate an arbitrary expansion to all instances. It will be checked for possible conflicts with the existing Knowledge and can be applied if the conflict checking result is that no semantics are changed. Expansion is done by simplifying the mapping by coalescing with the hope that coalescing will find a polyhedral 'rule' of the relevant map. It is then 'gist'-ed using the domain of the relevant instances such that the rule is expanded to the universe and finally intersected with the domain of all statement instances. The expansion makes conflicts become more likely, the found rule may still not encompass all statement instances and the found rule exposes internals of isl's implementation of coalesce and gist. The latter means that the result depends on how much effort the implementation invests into finding a rule which may change between versions of isl. Trivial implementations of gist and coalesce just return the input arguments. A patch that makes codegen support partial accesses is in preparation as well. Differential Revision: https://reviews.llvm.org/D30763 llvm-svn: 297373
* [DeLICM] Add nomap regressions tests. NFC.Michael Kruse2017-02-277-0/+547
| | | | | | | | | | | | These verify that some scalars are not mapped because it would be incorrect to do so. For these check we verify that no transformation has been executed from output of the pass's '-analyze'. Adding optimization remarks is not useful as it would result in too many messages, even repeated ones. I avoided checking the '-debug-only=polly-delicm' output which is an antipattern. llvm-svn: 296348
* [DeLICM] Regression test for skipping map targets.Michael Kruse2017-02-233-0/+183
| | | | | | | Add optimization-remarks-missed for when mapping targets have been skipped and add regression tests for them. llvm-svn: 295953
* [DeLICM] Add regression tests for DeLICM reject cases.Michael Kruse2017-02-225-0/+349
| | | | | | | | | | | | | | | | | These tests were not included in the main DeLICM commit. These check the cases where zone analysis cannot be successful because of assumption violations. We use the LLVM optimization remark infrastructure as it seems to be the best fit for this kind of messages. I tried to make use if the OptimizationRemarkEmitter. However, it would insert additional function passes into the pass manager to get the hotness information. The pass manager would insert them between the flatten pass and delicm, causing the ScopInfo with the flattened schedule being thrown away. Differential Revision: https://reviews.llvm.org/D30253 llvm-svn: 295846
* [DeLICM] Map values hoisted by LICM back to the array.Michael Kruse2017-02-211-0/+130
| | | | | | | | | | | | | | | | | | | | Implement the -polly-delicm pass. The pass intends to undo the effects of LoopInvariantCodeMotion (LICM) which adds additional scalar dependencies into SCoPs. DeLICM will try to map those scalars back to the array elements they were promoted from, as long as the array element is unused. The is the main patch from the DeLICM/DePRE patch series. It does not yet undo GVN PRE for which additional information about known values is needed and does not handle PHI write accesses that have have no target. As such its usefulness is limited. Patches for these issues including regression tests for error situatons will follow. Reviewers: grosser Differential Revision: https://reviews.llvm.org/D24716 llvm-svn: 295713
* [DeLICM] Add pass boilerplate code.Michael Kruse2016-11-291-0/+36
Add an empty DeLICM pass, without any functional parts. Extracting the boilerplate from the the functional part reduces the size of the code to review (https://reviews.llvm.org/D24716) Suggested-by: Tobias Grosser <tobias@grosser.es> llvm-svn: 288160
OpenPOWER on IntegriCloud