summaryrefslogtreecommitdiffstats
path: root/polly/test/ScopDetectionDiagnostics
Commit message (Collapse)AuthorAgeFilesLines
* Migrate function attribute "no-frame-pointer-elim"="false" to ↵Fangrui Song2019-12-241-1/+1
| | | | "frame-pointer"="none" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-245-5/+5
| | | | as cleanups after D56351
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-151-2/+2
| | | | | | | | | 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
* Fix another error related to YAML quoting.Zachary Turner2018-10-121-6/+6
| | | | | | | This one occured in polly, which I didn't build / test the first time so I didn't catch it. llvm-svn: 344378
* Adjust to debug info metadata format change.Tobias Grosser2018-05-1010-12/+12
| | | | | | Rename variable to retainedNodes. This unbreaks the Polly builds. llvm-svn: 331960
* [ScopDetect] Reject loop with multiple exit blocks.Michael Kruse2018-04-251-0/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current statement domain derivation algorithm does not (always) consider that different exit blocks of a loop can have different conditions to be reached. From the code for (int i = n; ; i-=2) { if (i <= 0) goto even; if (i <= 1) goto odd; A[i] = i; } even: A[0] = 42; return; odd: A[1] = 21; return; Polly currently derives the following domains: Stmt_even_critedge Domain := [n] -> { Stmt_even_critedge[] }; Stmt_odd Domain := [n] -> { Stmt_odd[] : (1 + n) mod 2 = 0 and n > 0 }; while the domain for the odd case is correct, Stmt_even is assumed to be executed unconditionally, which is obviously wrong. While projecting out the loop dimension in `adjustDomainDimensions`, it does not consider that there are other exit condition that have matched before. I don't know a how to fix this without changing a lot of code. Therefore This patch rejects loops with multiple exist blocks to fix the miscompile of test-suite's uuencode. The odd condition is transformed by LLVM to %cmp1 = icmp eq i64 %indvars.iv, 1 such that the project_out in adjustDomainDimensions() indeed only matches for odd n (using this condition only, we'd have an infinite loop otherwise). The even condition manifests as %cmp = icmp slt i64 %indvars.iv, 3 Because buildDomainsWithBranchConstraints() does not consider other exit conditions, it has to assume that the induction variable will eventually be lower than 3 and taking this exit. IMHO we need to reuse the algorithm that determines the number of iterations (addLoopBoundsToHeaderDomain) to determine which exit condition applies first. It has to happen in buildDomainsWithBranchConstraints() because the result will need to propagate to successor BBs. Currently addLoopBoundsToHeaderDomain() just look for union of all backedge conditions (which means leaving not the loop here). The patch in llvm.org/PR35465 changes it to look for exit conditions instead. This is required because there might be other exit conditions that do not alternatively go back to the loop header. Differential Revision: https://reviews.llvm.org/D45649 llvm-svn: 330858
* Revert "[polly] Fix ScopDetectionDiagnostic test failure caused by r310940"Tobias Grosser2017-08-241-1/+1
| | | | | | | | This reverts commit 950849ece9bb8fdd2b41e3ec348b9653b4e37df6. This commit broke various buildbots. llvm-svn: 311692
* [polly] Fix ScopDetectionDiagnostic test failure caused by r310940Jakub Kuderski2017-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: ScopDetection used to check if a loop withing a region was infinite and emitted a diagnostic in such cases. After r310940 there's no point checking against that situation, as infinite loops don't appear in regions anymore. The test failure was observed on these two polly buildbots: http://lab.llvm.org:8011/builders/polly-arm-linux/builds/8368 http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/10310 This patch XFAILs `ReportLoopHasNoExit.ll` and turns infinite loop detection into an assert. Reviewers: grosser, sanjoy, bollu Reviewed By: grosser Subscribers: efriedma, aemerson, kristof.beyls, dberlin, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D36776 llvm-svn: 311503
* [Polly] XFAIL ReportLoopHasNoExit tests after r310940Jakub Kuderski2017-08-161-0/+6
| | | | | | | | | | | ReportLoopHasNoExit started failing after r310940 that added infinite loops to postdominators. The change made regions not contain infinite loops anymore. This patch unbreaks the polly tree by XFAILING the ReportLoopHasNoExit test. Full fix is under review in D36776. llvm-svn: 310980
* [Polly] [OptDiag] Updating Polly Diagnostics RemarksEli Friedman2017-07-171-1/+54
| | | | | | | | | | | | | | | | | Utilizing newer LLVM diagnostic remark API in order to enable use of opt-viewer tool. Polly Diagnostic Remarks also now appear in YAML remark file. In this patch, I've added the OptimizationRemarkEmitter into certain classes where remarks are being emitted and update the remark emit calls itself. I also provide each remark a BasicBlock or Instruction from where it is being called, in order to compute the hotness of the remark. Patch by Tarun Rajendran! Differential Revision: https://reviews.llvm.org/D35399 llvm-svn: 308233
* [ScopDetection] If a loop is not part of a scop, none of it backedges can beTobias Grosser2017-07-152-0/+58
| | | | | | | | | | | | | | | | | | This patch makes sure that in case a loop is not fully contained within a region that later forms a SCoP, none of the loop backedges are allowed to be part of the region. We currently do not support the situation where only some of a loops backedges are part of a scop. Today, this can break both scop modeling and code generation. One such breaking test case is for example test/ScopDetectionDiagnostics/loop_partially_in_scop-2.ll, where we totally forgot to code generate some of the backedges. Fortunately, it is commonly not necessary to support these partial loops, it is way more common that either no backedge is included in a region or all loop backedge are included. This fixes a recent miscompile in MultiSource/Benchmarks/MiBench/consumer-typeset which was exposed after r306477. llvm-svn: 308113
* [ScopDetection] Require LoadInst base pointers to be hoisted.Michael Kruse2017-03-071-1/+6
| | | | | | | | | | | | | | | | | | Only when load-hoisted we can be sure the base pointer is invariant during the SCoP's execution. Most of the time it would be added to the required hoists for the alias checks anyway, except with -polly-ignore-aliasing, -polly-use-runtime-alias-checks=0 or if AliasAnalysis is already sure it doesn't alias with anything (for instance if there is no other pointer to alias with). Two more parts in Polly assume that this load-hoisting took place: - setNewAccessRelation() which contains an assert which tests this. - BlockGenerator which would use to the base ptr from the original code if not load-hoisted (if the access expression is regenerated) Differential Revision: https://reviews.llvm.org/D30694 llvm-svn: 297195
* [ScopDetection] Do not detect scops that exit to an unreachableTobias Grosser2017-03-071-0/+31
| | | | | | | | | | | | | | | Scops that exit with an unreachable are today still permitted, but make little sense to optimize. We therefore can already skip them during scop detection. This speeds up scop detection in certain cases and also ensures that bugpoint does not introduce unreachables when reducing test cases. In practice this change should have little impact, as the performance of unreachable code is unlikely to matter. This commit is part of a series that makes Polly more robust in the presence of unreachables. llvm-svn: 297151
* Revert "Currently broken by recent LLVM upstream changes"Tobias Grosser2017-03-021-2/+0
| | | | | | | This reverts commit r296579, which is not needed anymore as the relevant changes in trunk have been reverted. llvm-svn: 296817
* Currently broken by recent LLVM upstream changesTobias Grosser2017-03-011-0/+2
| | | | | | | We mark it as XFAIL to get buildbots back to green, until the upstream changes have been addressed. llvm-svn: 296579
* Add forgotten test case for r293169Tobias Grosser2017-01-281-0/+26
| | | | llvm-svn: 293383
* ScopDetectionDiagnostics: Also emit diagnostics in case no debug info is ↵Tobias Grosser2017-01-261-0/+26
| | | | | | | | available In this case, we just use the start of the scop as the debug location. llvm-svn: 293165
* [ScopDetection] Remove redundant checks for endless loopsTobias Grosser2016-09-201-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Both `canUseISLTripCount()` and `addOverApproximatedRegion()` contained checks to reject endless loops which are now removed and replaced by a single check in `isValidLoop()`. For reporting such loops the `ReportLoopOverlapWithNonAffineSubRegion` is renamed to `ReportLoopHasNoExit`. The test case `ReportLoopOverlapWithNonAffineSubRegion.ll` is adapted and renamed as well. The schedule generation in `buildSchedule()` is based on the following assumption: Given some block B that is contained in a loop L and a SESE region R, we assume that L is contained in R or the other way around. However, this assumption is broken in the presence of endless loops that are nested inside other loops. Therefore, in order to prevent erroneous behavior in `buildSchedule()`, r265280 introduced a corresponding check in `canUseISLTripCount()` to reject endless loops. Unfortunately, it was possible to bypass this check with -polly-allow-nonaffine-loops which was fixed by adding another check to reject endless loops in `allowOverApproximatedRegion()` in r273905. Hence there existed two separate locations that handled this case. Thank you Johannes Doerfert for helping to provide the above background information. Reviewers: Meinersbur, grosser Subscribers: _jdoerfert, pollydev Differential Revision: https://reviews.llvm.org/D24560 Contributed-by: Matthias Reisinger <d412vv1n@gmail.com> llvm-svn: 281987
* Fix assertion due to loop overlap with nonaffine region.Michael Kruse2016-06-271-0/+112
| | | | | | | | | | | | Reject and report regions that contains loops overlapping nonaffine region. This situation typically happens in the presence of inifinite loops. This addresses bug llvm.org/PR28071. Differential Revision: http://reviews.llvm.org/D21312 Contributed-by: Huihui Zhang <huihuiz@codeaurora.org> llvm-svn: 273905
* Cleanup rejection log handling [NFC]Johannes Doerfert2016-05-121-4/+4
| | | | | | | | | | | | This patch cleans up the rejection log handling during the ScopDetection. It consists of two interconnected parts: - We keep all detection contexts for a function in order to provide more information to the user, e.g., about the rejection of extended/intermediate regions. - We remove the mutable "RejectLogs" member as the information is available through the detection contexts. llvm-svn: 269323
* Update debug metadata after LLVM commits r266445+r266446Tobias Grosser2016-04-158-25/+17
| | | | llvm-svn: 266473
* Drop explicit -polly-delinearize parameterTobias Grosser2016-03-231-3/+3
| | | | | | | Delinearization is now enabled by default and does not need to explicitly need to be enabled in our tests. llvm-svn: 264154
* Support accesses with differently sized types to the same arrayTobias Grosser2016-02-041-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows code such as: void multiple_types(char *Short, char *Float, char *Double) { for (long i = 0; i < 100; i++) { Short[i] = *(short *)&Short[2 * i]; Float[i] = *(float *)&Float[4 * i]; Double[i] = *(double *)&Double[8 * i]; } } To model such code we use as canonical element type of the modeled array the smallest element type of all original array accesses, if type allocation sizes are multiples of each other. Otherwise, we use a newly created iN type, where N is the gcd of the allocation size of the types used in the accesses to this array. Accesses with types larger as the canonical element type are modeled as multiple accesses with the smaller type. For example the second load access is modeled as: { Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 } To support code-generating these memory accesses, we introduce a new method getAccessAddressFunction that assigns each statement instance a single memory location, the address we load from/store to. Currently we obtain this address by taking the lexmin of the access function. We may consider keeping track of the memory location more explicitly in the future. We currently do _not_ handle multi-dimensional arrays and also keep the restriction of not supporting accesses where the offset expression is not a multiple of the access element type size. This patch adds tests that ensure we correctly invalidate a scop in case these accesses are found. Both types of accesses can be handled using the very same model, but are left to be added in the future. We also move the initialization of the scop-context into the constructor to ensure it is already available when invalidating the scop. Finally, we add this as a new item to the 2.9 release notes Reviewers: jdoerfert, Meinersbur Differential Revision: http://reviews.llvm.org/D16878 llvm-svn: 259784
* Revert "Support loads with differently sized types from a single array"Tobias Grosser2016-02-031-0/+67
| | | | | | This reverts commit (@259587). It needs some further discussions. llvm-svn: 259629
* Support loads with differently sized types from a single arrayTobias Grosser2016-02-021-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We support now code such as: void multiple_types(char *Short, char *Float, char *Double) { for (long i = 0; i < 100; i++) { Short[i] = *(short *)&Short[2 * i]; Float[i] = *(float *)&Float[4 * i]; Double[i] = *(double *)&Double[8 * i]; } } To support such code we use as element type of the modeled array the smallest element type of all original array accesses. Accesses with larger types are modeled as multiple accesses with the smaller type. For example the second load access is modeled as: { Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 } To support jscop-rewritable memory accesses we need each statement instance to only be assigned a single memory location, which will be the address at which we load the value. Currently we obtain this address by taking the lexmin of the access function. We may consider keeping track of the memory location more explicitly in the future. llvm-svn: 259587
* ScopDetection: Do not detect regions with irreducible control as scopsTobias Grosser2016-01-221-0/+120
| | | | | | | | | | | | | | Polly currently does not support irreducible control and it is probably not worth supporting. This patch adds code that checks for irreducible control and refuses regions containing irreducible control. Polly traditionally had rather restrictive checks on the control flow structure which would have refused irregular control, but within the last couple of months most of the control flow restrictions have been removed. As part of this generalization we accidentally allowed irregular control flow. Contributed-by: Karthik Senthil and Ajith Pandel llvm-svn: 258497
* Adjust debug metadata to LLVM changes in 252219Tobias Grosser2015-11-068-18/+18
| | | | llvm-svn: 252273
* Allow invariant loads in the SCoP descriptionJohannes Doerfert2015-10-072-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows invariant loads to be used in the SCoP description, e.g., as loop bounds, conditions or in memory access functions. First we collect "required invariant loads" during SCoP detection that would otherwise make an expression we care about non-affine. To this end a new level of abstraction was introduced before SCEVValidator::isAffineExpr() namely ScopDetection::isAffine() and ScopDetection::onlyValidRequiredInvariantLoads(). Here we can decide if we want a load inside the region to be optimistically assumed invariant or not. If we do, it will be marked as required and in the SCoP generation we bail if it is actually not invariant. If we don't it will be a non-affine expression as before. At the moment we optimistically assume all "hoistable" (namely non-loop-carried) loads to be invariant. This causes us to expand some SCoPs and dismiss them later but it also allows us to detect a lot we would dismiss directly if we would ask e.g., AliasAnalysis::canBasicBlockModify(). We also allow potential aliases between optimistically assumed invariant loads and other pointers as our runtime alias checks are sound in case the loads are actually invariant. Together with the invariant checks this combination allows to handle a lot more than LICM can. The code generation of the invariant loads had to be extended as we can now have dependences between parameters and invariant (hoisted) loads as well as the other way around, e.g., test/Isl/CodeGen/invariant_load_parameters_cyclic_dependence.ll First, it is important to note that we cannot have real cycles but only dependences from a hoisted load to a parameter and from another parameter to that hoisted load (and so on). To handle such cases we materialize llvm::Values for parameters that are referred by a hoisted load on demand and then materialize the remaining parameters. Second, there are new kinds of dependences between hoisted loads caused by the constraints on their execution. If a hoisted load is conditionally executed it might depend on the value of another hoisted load. To deal with such situations we sort them already in the ScopInfo such that they can be generated in the order they are listed in the Scop::InvariantAccesses list (see compareInvariantAccesses). The dependences between hoisted loads caused by indirect accesses are handled the same way as before. llvm-svn: 249607
* Introduce -polly-process-unprofitableTobias Grosser2015-10-062-2/+2
| | | | | | | | | | This single option replaces -polly-detect-unprofitable and -polly-no-early-exit and is supposed to be the only option that disables compile-time heuristics that aim to bail out early on scops that are believed to not benefit from Polly optimizations. Suggested-by: Johannes Doerfert llvm-svn: 249426
* tests: Drop -polly-detect-unprofitable and -polly-no-early-exitTobias Grosser2015-10-067-13/+13
| | | | | | | | 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
* tests: Explicitly state if profitability tests should be usedTobias Grosser2015-10-062-4/+16
| | | | | | | | | | | | Polly's profitability heuristic saves compile time by skipping trivial scops or scops were we know no good optimization can be applied. For almost all our tests this heuristic makes little sense as we aim for minimal test cases when testing functionality. Hence, in almost all cases this heuristic is better be disabled. In preparation of disabling Polly's compile time heuristic by default in the test suite we first explicitly enable it in the couple of test cases that really use it (or run with/without heuristic side-by-side). llvm-svn: 249418
* Move more compile-time bailouts into -polly-detect-unprofitableTobias Grosser2015-09-081-1/+1
| | | | | | | | | | Instead of having two separate options -polly-detect-scops-in-functions-without-loops and -polly-detect-scops-in-regions-without-loops we now just use -polly-detect-unprofitable to force the detection of scops ignoring any compile time saving bailout heuristics. llvm-svn: 247057
* DI: Fix testcases after LLVM r246327Duncan P. N. Exon Smith2015-08-288-9/+9
| | | | | | | | | | I ran the script from r246327 and it touched all the right files; committing now to hopefully right the bots, but if my check-polly doesn't come back clean I'll keep looking. http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/33648 llvm-svn: 246341
* Update testcases after LLVM r243885Duncan P. N. Exon Smith2015-08-038-8/+8
| | | | llvm-svn: 243887
* Fix polly tests after LLVM IR change in r243774Duncan P. N. Exon Smith2015-07-315-14/+14
| | | | llvm-svn: 243801
* Update polly for LLVM rename of debug info metadata with DI* prefixDuncan P. N. Exon Smith2015-04-298-183/+183
| | | | | | | Ran the same rename-md-di-prefix.sh script attached to PR23080 as in LLVM r236120 and CFE r236121. llvm-svn: 236127
* Remove target triples from test casesTobias Grosser2015-04-216-6/+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
* [FIX] Change old diagnostic outputJohannes Doerfert2015-04-121-1/+1
| | | | llvm-svn: 234712
* Allow loops in non-affine subregions -- SCoP DetectionJohannes Doerfert2015-04-121-4/+20
| | | | | | | | | | | | | | | | | This will allow the ScopDetection to detect non-affine regions that contain loops. All loops contained will be collected and are accessible to later passes in order to adjust the access functions. As the loops are non-affine and will not be part of the polyhedral representation later, all accesses that are variant in these loops have to be over approximated as non-affine accesses. They are therefore handled the same way as other non-affine accesses. Additionally, we do not count non-affine loops for the profitability heuristic, thus a region with only a non-affine loop will only be detected if the general detection of loop free regions is enabled. Differential Revision: http://reviews.llvm.org/D8152 llvm-svn: 234711
* Upgrade testcases after LLVM r234181Duncan P. N. Exon Smith2015-04-064-20/+21
| | | | | | | Until r234181 we were silently upgrading old `@llvm.dbg` intrinsics. Fix testcases in polly that were relying on that. llvm-svn: 234192
* Shorten user report message slightlyTobias Grosser2015-03-091-2/+2
| | | | llvm-svn: 231633
* Update test cases to work independently of delinearization defaultTobias Grosser2015-03-081-1/+1
| | | | llvm-svn: 231594
* Add end user report message for unprofitable regions [NFC]Johannes Doerfert2015-03-081-0/+2
| | | | llvm-svn: 231593
* Update Polly tests for the great metadata schema changeDavid Blaikie2015-03-038-101/+101
| | | | llvm-svn: 231089
* Update Polly tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-276-17/+17
| | | | llvm-svn: 230796
* Update Polly tests to handle explicitly typed gep changes in LLVMDavid Blaikie2015-02-278-23/+23
| | | | llvm-svn: 230784
* ScopDetection: Only detect scops that have at least one read and one writeTobias Grosser2015-02-198-12/+140
| | | | | | | | | | Scops that only read seem generally uninteresting and scops that only write are most likely initializations where there is also little to optimize. To not waste compile time we bail early. Differential Revision: http://reviews.llvm.org/D7735 llvm-svn: 229820
* Adjust to the new explicit debug metadataTobias Grosser2015-01-157-58/+58
| | | | | | This fixes the outfall of r226048 llvm-svn: 226134
* (diagnostics) fix typo in test...Andreas Simbuerger2014-12-191-1/+1
| | | | llvm-svn: 224591
* Run upgrade script from PR21532 to match LLVM changesDuncan P. N. Exon Smith2014-12-157-205/+205
| | | | | | | | | Update tests for LLVM assembly format change in r224257 using the script attached to PR21532. I'm hoping this unsticks the bot [1]. [1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25432 llvm-svn: 224269
OpenPOWER on IntegriCloud