summaryrefslogtreecommitdiffstats
path: root/polly/test/DependenceInfo
Commit message (Collapse)AuthorAgeFilesLines
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-241-1/+1
| | | | as cleanups after D56351
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-151-1/+1
| | | | | | | | | compiler identification lines in test-cases. (Doing so only because it's then easier to search for references which are actually important and need fixing.) llvm-svn: 351200
* [ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.Michael Kruse2018-02-033-5/+5
| | | | | | | | | | | | | | | | | | | | 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
* Bump isl to isl-0.18-768-g033b61aeTobias Grosser2017-07-042-2/+2
| | | | | | | | | | | | | | Summary: This is a general maintenance update Reviewers: grosser Subscribers: srhines, fedor.sergeev, pollydev, llvm-commits Contributed-by: Maximilian Falkenstein <falkensm@student.ethz.ch> Differential Revision: https://reviews.llvm.org/D34903 llvm-svn: 307090
* Update some tests to changes in isl's internal representationTobias Grosser2017-05-275-9/+11
| | | | | | This was forgotten as part of r304069. llvm-svn: 304070
* [ScopInfo] Do not add array name into memory reference idsTobias Grosser2017-05-035-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Before this change a memory reference identifier had the form: <STMT>_<ACCESSTYPE><ID>_<MEMREF>, e.g., Stmt_bb9_Write0_MemRef_tmp11 After this change, we use the format: <STMT>_<ACCESSTYPE><ID>, e.g., Stmt_bb9_Write0 The name of the array that is accessed through a memory reference is not necessary to uniquely identify a memory reference, but was only added to provide additional information for debugging. We drop this information now for the following two reasons: 1) This shortens the names and consequently improves readability 2) This removes a second location where we decide on the name of a scop array, leaving us only with the location where the actual scop array is created. Having after 2) only a single location to name scop arrays will allow us to change the naming convention of scop arrays more easily, which we will do in a future commit to reduce compilation time. llvm-svn: 302004
* [Polly] [DependenceInfo] change WAR generation, Read will not block ReadSiddharth Bhat2017-04-243-3/+3
| | | | | | | | | | | | | | | | | | | | | Earlier, the call to buildFlow was: WAR = buildFlow(Write, Read, MustWrite, Schedule). This meant that Read could block another Read, since must-sources can block each other. Fixed the call to buildFlow to correctly compute Read. The resulting code needs to do some ISL juggling to get the output we want. Bug report: https://bugs.llvm.org/show_bug.cgi?id=32623 Reviewers: Meinersbur Tags: #polly Differential Revision: https://reviews.llvm.org/D32011 llvm-svn: 301266
* [Polly] [DependenceInfo] change WAR, WAW generation to correct semanticsSiddharth Bhat2017-04-0415-19/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | = Change of WAR, WAW generation: = - `buildFlow(Sink, MustSource, MaySource, Sink)` treates any flow of the form `sink <- may source <- must source` as a *may* dependence. - we used to call: ```lang=cpp, name=old-flow-call.cpp Flow = buildFlow(MustWrite, MustWrite, Read, Schedule); WAW = isl_union_flow_get_must_dependence(Flow); WAR = isl_union_flow_get_may_dependence(Flow); ``` - This caused some WAW dependences to be treated as WAR dependences. - Incorrect semantics. - Now, we call WAR and WAW correctly. == Correct WAW: == ```lang=cpp, name=new-waw-call.cpp Flow = buildFlow(Write, MustWrite, MayWrite, Schedule); WAW = isl_union_flow_get_may_dependence(Flow); isl_union_flow_free(Flow); ``` == Correct WAR: == ```lang=cpp, name=new-war-call.cpp Flow = buildFlow(Write, Read, MustaWrite, Schedule); WAR = isl_union_flow_get_must_dependence(Flow); isl_union_flow_free(Flow); ``` - We want the "shortest" WAR possible (exact dependences). - We mark all the *must-writes* as may-source, reads as must-souce. - Then, we ask for *must* dependence. - This removes all the reads that flow through a *must-write* before reaching a sink. - Note that we only block ealier writes with *must-writes*. This is intuitively correct, as we do not want may-writes to block must-writes. - Leaves us with direct (R -> W). - This affects reduction generation since RED is built using WAW and WAR. = New StrictWAW for Reductions: = - We used to call: ```lang=cpp,name=old-waw-war-call.cpp Flow = buildFlow(MustWrite, MustWrite, Read, Schedule); WAW = isl_union_flow_get_must_dependence(Flow); WAR = isl_union_flow_get_may_dependence(Flow); ``` - This *is* the right model of WAW we need for reductions, just not in general. - Reductions need to track only *strict* WAW, without any interfering reductions. = Explanation: Why the new WAR dependences in tests are correct: = - We no longer set WAR = WAR - WAW - Hence, we will have WAR dependences that were originally removed. - These may look incorrect, but in fact make sense. == Code: == ```lang=llvm, name=new-war-dependence.ll ; void manyreductions(long *A) { ; for (long i = 0; i < 1024; i++) ; for (long j = 0; j < 1024; j++) ; S0: *A += 42; ; ; for (long i = 0; i < 1024; i++) ; for (long j = 0; j < 1024; j++) ; S1: *A += 42; ; ``` === WAR dependence: === { S0[1023, 1023] -> S1[0, 0] } - Between `S0[1023, 1023]` and `S1[0, 0]`, we will have the dependences: ```lang=cpp, name=dependence-incorrect, counterexample S0[1023, 1023]: *-- tmp = *A (load0)--* WAR 2 add = tmp + 42 | *-> *A = add (store0) | WAR 1 S1[0, 0]: | tmp = *A (load1) | add = tmp + 42 | A = add (store1)<-* ``` - One may assume that WAR2 *hides* WAR1 (since store0 happens before store1). However, within a statement, Polly has no idea about the ordering of loads and stores. - Hence, according to Polly, the code may have looked like this: ```lang=cpp, name=dependence-correct S0[1023, 1023]: A = add (store0) tmp = A (load0) ---* add = A + 42 | WAR 1 S1[0, 0]: | tmp = A (load1) | add = A + 42 | A = add (store1) <-* ``` - So, Polly generates (correct) WAR dependences. It does not make sense to remove these dependences, since they are correct with respect to Polly's model. Reviewers: grosser, Meinersbur tags: #polly Differential revision: https://reviews.llvm.org/D31386 llvm-svn: 299429
* [DependenceInfo] Track may-writes and build flow information inSiddharth Bhat2017-03-171-0/+67
| | | | | | | | | | | | Dependences::calculateDependences. This ensures that we handle may-writes correctly when building dependence information. Also add a test case checking correctness of may-write information. Not handling it before was an oversight. Differential Revision: https://reviews.llvm.org/D31075 llvm-svn: 298074
* Set Dependences::RED to be non-null once Dependences::calculateDependences()Siddharth Bhat2017-03-161-0/+34
| | | | | | | occurs, even if there is no actual reduction. This ensures correctness with isl operations. llvm-svn: 297981
* [test] Add reduction sequence test case [NFC]Tobias Grosser2017-02-181-0/+539
| | | | | | | | | | | | | | | | | This test case is a mini performance test case that shows the time needed for a couple of simple reductions. It takes today about 325ms on my machine to run this test case through 'opt' with scop construction and reduction detection. It can be used as mini-proxy for further tuning of the reduction code. Generally we do not commit performance test cases, but as this is very small and also very fast it seems OK to keep it in the lit test suite. This test case will also help to verify that future changes to the reduction code will not affect the ordering of the reduction sets and will consequently not cause spurious performance changes that only result from reordering of dependences in the reduction set. llvm-svn: 295549
* [GSoC] Do not process SCoPs with infeasible runtime contextJohannes Doerfert2016-07-251-0/+69
| | | | | | | | | | | | Do not process SCoPs with infeasible runtime context in the new ScopInfoWrapperPass. Do not compute dependences for such SCoPs in the new DependenceInfoWrapperPass. Patch by Utpal Bora <cs14mtech11017@iith.ac.in> Differential Revision: https://reviews.llvm.org/D22402 llvm-svn: 276631
* Fix assertion due to buildMemoryAccess.Michael Kruse2016-07-081-0/+74
| | | | | | | | | | | | | For llvm the memory accesses from nonaffine loops should be visible, however for polly those nonaffine loops should be invisible/boxed. This fixes llvm.org/PR28245 Cointributed-by: Huihui Zhang <huihuiz@codeaurora.org> Differential Revision: http://reviews.llvm.org/D21591 llvm-svn: 274842
* [GSoC 2016] New function pass DependenceInfoWrapperPassJohannes Doerfert2016-06-274-0/+37
| | | | | | | | | | | | | | This patch addresses: - A new function pass to compute polyhedral dependences. This is required to avoid the region pass manager. - Stores a map of Scop to Dependence object for all the scops present in a function. By default, access wise dependences are stored. Patch by Utpal Bora <cs14mtech11017@iith.ac.in> Differential Revision: http://reviews.llvm.org/D21105 llvm-svn: 273881
* Add fine-grain dependences analysis to release notes.Hongbin Zheng2016-03-284-7/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D17905 llvm-svn: 264575
* Drop explicit -polly-delinearize parameterTobias Grosser2016-03-231-1/+1
| | | | | | | Delinearization is now enabled by default and does not need to explicitly need to be enabled in our tests. llvm-svn: 264154
* Update the fine-grain dependences analysis test case.Hongbin Zheng2016-02-271-10/+20
| | | | llvm-svn: 262101
* Introduce fine-grain dependence analysis by tagging access functions and ↵Hongbin Zheng2016-02-264-0/+100
| | | | | | | | schedules tree with either the id of memory access or memory references. Differential Revision: http://reviews.llvm.org/D17381 llvm-svn: 262039
* Update to ISL 0.16.1Michael Kruse2016-01-1522-66/+66
| | | | llvm-svn: 257898
* Prepare unit tests for update to ISL 0.16Michael Kruse2016-01-1522-348/+281
| | | | | | | | | | | | | | | | | | | | | ISL 0.16 will change how sets are printed which breaks 117 unit tests that text-compare printed sets. This patch re-formats most of these unit tests using a script and small manual editing on top of that. When actually updating ISL, most work is done by just re-running the script to adapt to the changed output. Some tests that compare IR and tests with single CHECK-lines that can be easily updated manually are not included here. The re-format script will also be committed afterwards. The per-test formatter invocation command lines options will not be added in the near future because it is ad hoc and would overwrite the manual edits. Ideally it also shouldn't be required anymore because ISL's set printing has become more stable in 0.16. Differential Revision: http://reviews.llvm.org/D16095 llvm-svn: 257851
* Remove read-only statements from the SCoPJohannes Doerfert2015-11-031-2/+3
| | | | | | | | | | | We do not need to model read-only statements in the SCoP as they will not cause any side effects that are visible to the outside anyway. Removing them should safe us time and might even simplify the ASTs we generate. Differential Revision: http://reviews.llvm.org/D14272 llvm-svn: 251948
* tests: Drop -polly-detect-unprofitable and -polly-no-early-exitTobias Grosser2015-10-0624-27/+27
| | | | | | | | These flags are now always passed to all tests and need to be disabled if not needed. Disabling these flags, rather than passing them to almost all tests, significantly simplfies our RUN: lines. llvm-svn: 249422
* Do not model delinearized and linearized access relation for a single accessTobias Grosser2015-09-211-3/+3
| | | | | | | | | | A missing return statement that previously did not have a visibly negative effect caused after some data-structure changes in r248024 multi-dimensional accesses to be modeled both multi-dimensional as well as linearized. This commit adds the missing return to avoid the incorrect double modeling as well as the compile time increases it caused. llvm-svn: 248171
* Merge IRAccess into MemoryAccessMichael Kruse2015-09-181-3/+3
| | | | | | | | | | | | | | | All MemoryAccess objects will be owned by ScopInfo::AccFuncMap which previously stored the IRAccess objects. Instead of creating new MemoryAccess objects, the already created ones are reused, but their order might be different now. Some fields of IRAccess and MemoryAccess had the same meaning and are merged. This is the last step of fusioning TempScopInfo.{h|cpp} and ScopInfo.{h.cpp}. Some refactoring might still make sense. Differential Revision: http://reviews.llvm.org/D12843 llvm-svn: 248024
* Model fixed-size multi-dimensional arrays if possible multi-dimensionalTobias Grosser2015-09-171-1/+0
| | | | | | | | | If the GEP instructions give us enough insights, model scalar accesses as multi-dimensional (and generate the relevant run-time checks to ensure correctness). This will allow us to simplify the dependence computation in a subsequent commit. llvm-svn: 247906
* Use modulo semantic to generate non-integer-overflow assumptionsJohannes Doerfert2015-09-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This will allow to generate non-wrap assumptions for integer expressions that are part of the SCoP. We compare the common isl representation of the expression with one computed with modulo semantic. For all parameter combinations they are not equal we can have integer overflows. The nsw flags are respected when the modulo representation is computed, nuw and nw flags are ignored for now. In order to not increase compile time to much, the non-wrap assumptions are collected in a separate boundary context instead of the assumed context. This helps compile time as the boundary context can become complex and it is therefor not advised to use it in other operations except runtime check generation. However, the assumed context is e.g., used to tighten dependences. While the boundary context might help to tighten the assumed context it is doubtful that it will help in practice (it does not effect lnt much) as the boundary (or no-wrap assumptions) only restrict the very end of the possible value range of parameters. PET uses a different approach to compute the no-wrap context, though lnt runs have shown that this version performs slightly better for us. llvm-svn: 247732
* Traverse the SCoP to compute non-loop-carried domain conditionsJohannes Doerfert2015-08-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to compute domain conditions for conditionals we will now traverse the region in the ScopInfo once and build the domains for each block in the region. The SCoP statements can then use these constraints when they build their domain. The reason behind this change is twofold: 1) This removes a big chunk of preprocessing logic from the TempScopInfo, namely the Conditionals we used to build there. Additionally to moving this logic it is also simplified. Instead of walking the dominance tree up for each basic block in the region (as we did before), we now traverse the region only once in order to collect the domain conditions. 2) This is the first step towards the isl based domain creation. The second step will traverse the region similar to this step, however it will propagate back edge conditions. Once both are in place this conditional handling will allow multiple exit loops additional logic. Reviewers: grosser Differential Revision: http://reviews.llvm.org/D12428 llvm-svn: 246398
* Do not detect Scops with only one loop.Tobias Grosser2015-08-271-1/+2
| | | | | | | | | | | | | | | | | | | | If a region does not have more than one loop, we do not identify it as a Scop in ScopDetection. The main optimizations Polly is currently performing (tiling, preparation for outer-loop vectorization and loop fusion) are unlikely to have a positive impact on individual loops. In some cases, Polly's run-time alias checks or conditional hoisting may still have a positive impact, but those are mostly enabling transformations which LLVM already performs for individual loops. As we do not focus on individual loops, we leave them untouched to not introduce compile time regressions and execution time noise. This results in good compile time reduction (oourafft: -73.99%, smg2000: -56.25%). Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in> Reviewers: grosser Differential Revision: http://reviews.llvm.org/D12268 llvm-svn: 246161
* Fix test cases which fail due to changes in isl's set representationTobias Grosser2015-08-183-10/+10
| | | | llvm-svn: 245301
* Dependences: Zero pad the schedule mapTobias Grosser2015-08-021-0/+48
| | | | | | | | | The schedule map we derive from a schedule tree map may map statements into schedule spaces of different dimensionality. This change adds zero padding to ensure just a single schedule space is used and the translation from a union_map to an isl_multi_union_pw_aff does not fail. llvm-svn: 243849
* Use schedule trees to represent execution order of statementsTobias Grosser2015-07-141-4/+0
| | | | | | | | | | | | | | | | | | 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
* Update isl to c3892bebc0Tobias Grosser2015-05-091-8/+8
| | | | | | Various smaller improvements and bugfixes. llvm-svn: 236932
* Remove target triples from test casesTobias Grosser2015-04-213-3/+0
| | | | | | | | I just learned that target triples prevent test cases to be run on other architectures. Polly test cases are until now sufficiently target independent to not require any target triples. Hence, we drop them. llvm-svn: 235384
* Drop unneccessary -basicaa passes in DependenceInfo test casesTobias Grosser2015-04-213-4/+4
| | | | llvm-svn: 235374
* Rename the Dependences pass to DependenceInfo [NFC]Johannes Doerfert2015-03-0423-0/+1930
We rename the Dependences pass to DependenceInfo as a first step to a caching pass policy. The new DependenceInfo pass will later provide "Dependences" for a SCoP. To keep consistency the test folder is renamed too. llvm-svn: 231308
OpenPOWER on IntegriCloud