summaryrefslogtreecommitdiffstats
path: root/polly/test/ScopInfo
Commit message (Collapse)AuthorAgeFilesLines
* Migrate function attribute "no-frame-pointer-elim"="false" to ↵Fangrui Song2019-12-249-14/+14
| | | | "frame-pointer"="none" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-248-13/+13
| | | | as cleanups after D56351
* [ScopBuilder] Fix bug 38358 by preserving correct order of ScopStmts.Michael Kruse2019-10-171-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | ScopBuilder::buildEqivClassBlockStmts creates ScopStmts for instruction groups in basic block and inserts these ScopStmts into Scop::StmtMap, however, as described in llvm.org/PR38358, comment #5, StmtScops are inserted into vector ScopStmt[BB] in wrong order. As a result, ScopBuilder::buildSchedule creates wrong order sequence node. Looking closer to code, it's clear there is no equivalent classes with interleaving isOrderedInstruction(memory access) instructions after joinOrderedInstructions. Afterwards, ScopStmts need to be created and inserted in the original order of memory access instructions, however, at the moment ScopStmts are inserted in the order of leader instructions which are probably not memory access instructions. The fix is simple with a standalone loop scanning isOrderedInstruction(memory access) instructions in basic block and inserting elements into LeaderToInstList one by one. The patch also removes double reversing operations which are now unnecessary. New test preserve-equiv-class-order-in-basic_block.ll is also added. Differential Revision: https://reviews.llvm.org/D68941 llvm-svn: 375192
* [ScopBuilder] Skip getting leader when merging statements to close holes.Michael Kruse2019-09-131-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | Function joinOrderedInstructions merges instructions when a leader is encountered twice. It also notices that leaders in SeenLeaders may lose their leadership in previous merging, and tries to handle the case using following code: Instruction *PrevLeader = UnionFind.getLeaderValue(SeenLeaders.back()); However, this is wrong because it always gets leader for the last element of SeenLeaders, and I believe it's wrong even we get leader for Prev here. As a result, Statements in cases like the one in patch aren't merged as expected. After investigation, I believe it's unnecessary to get leader instruction at all. This is based on fact: Although leaders in SeenLeaders could lose leadership, they only lose to others in SeenLeaders, in other words, one existing leader will be chosen as new leader of merged equivalent statements. We can take advantage of this and simply check if current leader equals to Prev and break merging if it does. The patch also adds a new test. Patch by bin.narwal <bin.narwal@gmail.com> Differential Revision: https://reviews.llvm.org/D67007 llvm-svn: 371801
* [Polly] Don't crash on invalid delinearization result.Eli Friedman2019-05-141-0/+27
| | | | | | | | | | | | | | | | | | | In certain cases, it's possible for delinearization to decide one of the array dimensions should be some function of an induction variable inside the scop. Make sure if this happens, we refuse to use those dimensions for delinearization. Usually, we end up rejecting the scop before it actually crashes, but it looks like it's possible to slip past other checks in certain cases involving smax expressions. Fixes a crash that started showing up this week on the polly AOSP builder. As far as I can tell, this is a longstanding issue, though; it was just exposed by better SCEV analysis of smin expressions. Differential Revision: https://reviews.llvm.org/D61807 llvm-svn: 360708
* [ZoneAlgo] Fix PHI inconsistency in invalid contexts.Michael Kruse2019-05-101-1/+1
| | | | | | | | | | 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
* [polly][SCEV] Expand SCEV matcher cases for new smin/umin opsKeno Fischer2019-05-081-1/+1
| | | | | | | These were added in rL360159, but I neglected to update polly at the same time. llvm-svn: 360238
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-154-5/+5
| | | | | | | | | 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] Set domain to empty instead of NULL.Michael Kruse2018-08-011-0/+36
| | | | | | | | | | | | | | The domain generation used nullptr to mark the domain of an error block as never-executed. Later, nullptr domains are recreated with a zero-tuple domain that then mismatches with the expected domain the error block within the loop. Instead of using nullptr, assign an empty domain which preserves the expected space. Remove empty domains during SCoP simplification. Fixes llvm.org/PR38218. llvm-svn: 338646
* test: use regex matchers to make test-case robust against register renumberingsTobias Grosser2018-06-281-2/+2
| | | | | Suggested-by: Michael Kruse llvm-svn: 335813
* Adjust to recent LLVM changes to fix buildbotsTobias Grosser2018-06-161-2/+2
| | | | llvm-svn: 334893
* [test] Fix a typo in a test case [NFCI]Tobias Grosser2018-06-131-2/+2
| | | | | | Also remove an undef value that does not add any value to the test case. llvm-svn: 334661
* [SCEVAffinator] Fix handling of pwaff complexity limit.Eli Friedman2018-05-141-0/+37
| | | | | | | | | | | nullptr is not a valid affine expression, and none of the callers check for null, so we eventually hit an isl error and crash. Instead, invalidate the scop and return a constant zero. Differential Revision: https://reviews.llvm.org/D46445 llvm-svn: 332309
* Adjust to debug info metadata format change.Tobias Grosser2018-05-101-3/+3
| | | | | | Rename variable to retainedNodes. This unbreaks the Polly builds. llvm-svn: 331960
* [ScopInfo] Remove bail out condition in buildMinMaxAccess().Michael Kruse2018-05-091-0/+109
| | | | | | | | | | | | | | | | | | | | | The condition was introduced in r267142 to mitigate a long compile-time case. In r306087, a max-computation limit was introduced that should handle the same case while leaving the max disjuncts heuristic it should have replaced intact. Today, the max disjuncts bail-out causes problems in that it prematurely stops SCoPs from being detected, e.g. in SPEC's lbm. This would hit less like if isl_set_coalesce would be called after isl_set_remove_divs (which makes more basic_set likely to be coalescable) instead of before. This patch tries to remove the premature max-disjuncts bail-out condition by using simple_hull() to reduce the computational overhead, instead of directly invalidating that SCoP. Differential Revision: https://reviews.llvm.org/D45066 Contributed-by: Sahil Girish Yerawar <cs15btech11044@iith.ac.in> llvm-svn: 331891
* [test] Replace undef with true/false to make test case less fragileTobias Grosser2018-05-081-5/+5
| | | | | | | | This test case does not require undef to be present in branch conditions. Replace these undef values with true/false values to clarify the control-flow required to reach the loop under testing. llvm-svn: 331744
* [ScopDetect] Reject loop with multiple exit blocks.Michael Kruse2018-04-259-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow arbitrary function calls for debugging purposes.Michael Kruse2018-04-201-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the switch -polly-debug-func to define the name of a debug function. This function is ignored for any validity check. Its purpose is to allow to observe a value after transformation by a SCoP, and to follow which statements are executed in which order. For instance, consider the following code: static void dbg_printf(int sum, int i) { fprintf(stderr, "The value of sum is %d, i=%d\n", sum, i); fflush(stderr); } void func(int n) { int sum = 0; for (int i = 0; i < 16; i+=1) { sum += i; dbg_printf(sum, i); } } Executing this after Polly's codegen with -polly-debug-func=dbg_printf reveals the new execution order and the assumed values at that point of execution. Differential Revision: https://reviews.llvm.org/D45728 llvm-svn: 330466
* [ScopInfo] Avoid iterator invalidation.Michael Kruse2018-04-101-0/+58
| | | | | | | | | | | Commit r329640 introduced the removal of all MemoryAccesses of a Scop. It accidentally continued iterating over a vector whose iterators have been invalidated by a MemoryAccess removal. Make a copy of the MemoryAccesses to remove to iterate over while removing them. llvm-svn: 329653
* [ScopInfo] Completely remove MemoryAccesses when their parent statement is ↵Michael Kruse2018-04-091-0/+100
| | | | | | | | | | | | | | | removed. Removing a statement left its MemoryAccesses in some lists and maps of the SCoP. Which lists depends on at which phase of the SCoP construction the statement is deleted. Follow-up passes could still see the already deleted MemoryAccesses by iterating through these lists/maps, resulting in an access violation. When removing a ScopStmt, also remove all its MemoryAccesses by using the same mechnism that removes a MemoryAccess. llvm-svn: 329640
* Remove immediate dominator heuristic for error block detection.Michael Kruse2018-04-095-104/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the heuristic in - Polly :: lib/Support/ScopHelper.cpp The heuristic forces blocks that directly follow a loop header to not to be considered error blocks. It was introduced in r249611 with the following commit message: > This replaces the support for user defined error functions by a > heuristic that tries to determine if a call to a non-pure function > should be considered "an error". If so the block is assumed not to be > executed at runtime. While treating all non-pure function calls as > errors will allow a lot more regions to be analyzed, it will also > cause us to dismiss a lot again due to an infeasible runtime context. > This patch tries to limit that effect. A non-pure function call is > considered an error if it is executed only in conditionally with > regards to a cheap but simple heuristic. In the code below `CCK_Abort2()` would be considered as an error block, but not `CCK_Abort1()` due to this heuristic. ``` for (int i = 0; i < n; i+=1) { if (ErrorCondition1) CCK_Abort1(); // No __attribute__((noreturn)) if (ErrorCondition2) CCK_Abort2(); // No __attribute__((noreturn)) } ``` This does not seem useful. Checking error conditions in the beginning of some work is quite common. It causes a switch default-case to be not considered an error block in SPEC's cactuBSSN. The comment justifying the heuristic mentions a "load", which does not seem to be applicable here. It has been proposed to remove the heuristic. In addition, the patch fixes the following test cases: - Polly :: ScopDetect/mod_ref_read_pointer.ll - Polly :: ScopInfo/max-loop-depth.ll - Polly :: ScopInfo/mod_ref_access_pointee_arguments.ll - Polly :: ScopInfo/mod_ref_read_pointee_arguments.ll - Polly :: ScopInfo/mod_ref_read_pointer.ll - Polly :: ScopInfo/mod_ref_read_pointers.ll The test cases failed after removing the heuristic. Differential Revision: https://reviews.llvm.org/D45274 Contributed-by: Lorenzo Chelini <l.chelini@icloud.com> llvm-svn: 329548
* Move code generation test case to test/CodeGen/Tobias Grosser2018-03-192-81/+0
| | | | llvm-svn: 327857
* [ScopInfo] Do not use the set dimension ids to carry loop informationTobias Grosser2018-03-033-4/+4
| | | | | | | | | | | | | | isl does not guarantee that set dimension ids will be preserved, so using them to carry information is not a good idea. Furthermore, the loop information can be derived without problem from the statement itself. As this even requires less code than propagating loop information on set dimension ids, starting from this commit we just derive the loop information in collectSurroundingLoops directly from the IR. Interestingly this also results in a couple of isl sets to take a simpler representation. llvm-svn: 326664
* Update isl to isl-0.18-1047-g4a20ef8Tobias Grosser2018-02-2050-72/+72
| | | | | | | | | | | | | | | | | | 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] scalar-indep: Fix mutually referencing PHIs.Michael Kruse2018-02-122-0/+126
| | | | | | | | | | | | | | Two or more PHIs mutually using each other directly or indirectly as incoming value could cause that a PHI WRITE be added before the PHI READ (i.e. it overwrites the current incoming value with the next incoming value before it being read). Fix by ensuring that the PHI WRITE and PHI READ are in the same statement. This should fix the miscompile of SingleSource/Benchmark/Misc/whetstone from the test-suite. llvm-svn: 324934
* [ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.Michael Kruse2018-02-0345-56/+56
| | | | | | | | | | | | | | | | | | | | 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
* [ScopBuilder] Prefer PHI Write accesses in the statement the incoming value ↵Michael Kruse2018-01-232-12/+18
| | | | | | | | | | | | | | | | | | is defined. Theoretically, a PHI write can be added to any statement that represents the incoming basic block. We previously always chose the last because the incoming value's definition is guaranteed to be defined. With this patch the PHI write is added to the statement that defines the incoming value. It avoids the requirement for a scalar dependency between the defining statement and the statement containing the write. As such the logic for -polly-stmt-granularity=scalar-indep that ensures that there is such scalar dependencies can be removed. Differential Revision: https://reviews.llvm.org/D42147 llvm-svn: 323284
* Change memcpy/memove/memset to have dest and source alignment attributes ↵Daniel Neilson2018-01-193-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Step 1). Summary: Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset intrinsics. This change updates the polly tests for this change. The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument which is required to be a constant integer. It represents the alignment of the dest (and source), and so must be the minimum of the actual alignment of the two. This change removes the alignment argument in favour of placing the alignment attribute on the source and destination pointers of the memory intrinsic call. For example, code which used to read: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false) will now read call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false) At this time the source and destination alignments must be the same (Step 1). Step 2 of the change, to be landed shortly, will relax that contraint and allow the source and destination to have different alignments. llvm-svn: 322963
* [ScopBuilder] Revise statement naming when there are multiple statements per BB.Michael Kruse2018-01-1811-43/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to have -polly-stmt-granularity=bb and -polly-stmt-granularity=scalar-indep to have the same names if there is just one statement per basic block. This fixes a fluke when Polybench's jacobi-2d is optimized differently depending on the -polly-stmt-granularity option, although both options create the same SCoP, just with different statement names. The new naming scheme is: With -polly-use-llvm-names=0: Stmt<BBIdx as decimal><Idx within BB as letter> With -polly-use-llvm-names=1: Stmt_BBName_<Idx within BB as letter> The <Idx within BB> suffix is omitted for the main statement of a BB. The main statement is either the one containing the first store or call (those cannot be removed by the simplifyer), or if there is no such instruction, the first. If after simplification there is just a single statement left, it should be the main statement and have the same names as with -polly-stmt-granularity=bb. Differential Revision: https://reviews.llvm.org/D42136 llvm-svn: 322852
* [polly] [ScopInfo] Don't use isl_val_get_num_si.Eli Friedman2018-01-171-5/+35
| | | | | | | | | | | | | | | | | isl_val_get_num_si crashes on overflow, so don't use it on arbitrary integers. Testcase only crashes on platforms where long is 32 bits because of the signature of isl_val_get_num_si; not sure if it's possible to write a testcase which crashes if long is 64 bits. There are a few other places in polly which use isl_val_get_num_si; they probably need to be fixed as well. I don't think polly uses any of the other "long" isl APIs in an unsafe manner. Differential Revision: https://reviews.llvm.org/D42129 llvm-svn: 322766
* [ScopBuilder] Split statements on encountering store instructions.Michael Kruse2017-12-111-0/+62
| | | | | | | | | | Introduce -polly-stmt-granularity=store option. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D37337 llvm-svn: 320360
* [ScopBuilder] Introduce -polly-stmt-granularity=scalar-indep option.Michael Kruse2017-10-055-0/+331
| | | | | | | | | | | | | | | | | | | | | | | | | The option splits BasicBlocks into minimal statements such that no additional scalar dependencies are introduced. The algorithm is based on a union-find structure, and unites sets if putting them into separate statements would introduce a scalar dependencies. As a consequence, instructions may be split into separate statements such their relative order is different than the statements they are in. This is accounted for instructions whose relative order matters (e.g. memory accesses). The algorithm is generic in that heuristic changes can be made relatively easily. We might relax the order requirement for read-reads or accesses to different base pointers. Forwardable instructions can be made to not cause a join. This implementation gives us a speed-up of 82% in SPEC 2006 456.hmmer benchmark by allowing loop-distribution in a hot loop such that one of the loops can be vectorized. Differential Revision: https://reviews.llvm.org/D38403 llvm-svn: 314983
* [ScopBuilder] Build invariant loads separately.Michael Kruse2017-10-024-11/+11
| | | | | | | | | | | | | | | | | | Create the MemoryAccesses of invariant loads separately and before all other MemoryAccesses. Invariant loads are classified as synthesizable and therefore are not contained in any statement. When iterating over all instructions of all statements, the invariant loads are consequently not processed and iterating over them separately becomes necessary. This patch can change the order in which MemoryAccesses are created, but otherwise has no functional change. Some temporary code is introduced to ensure correctness, but will be removed in the next commit. llvm-svn: 314664
* [ScopBuilder] Build escaping dependencies separately.Michael Kruse2017-10-024-8/+8
| | | | | | | | | | | | | Instructions that compute escaping values might be synthesizable and therefore not contained in any ScopStmt. When buildAccessFunctions is changed to only iterate over the instruction list of statement, "free" instructions still need to be written. We do this after the main MemoryAccesses have been created. This can change the order in which MemoryAccesses are created, but has otherwise no functional change. llvm-svn: 314663
* [ScopInfo] Allow PHI nodes that reference an error blockTobias Grosser2017-09-261-0/+62
| | | | | | As long as these PHI nodes are only referenced by terminator instructions. llvm-svn: 314212
* [ScopInfo] Allow invariant loads in branch conditionsTobias Grosser2017-09-251-0/+51
| | | | | | | In case the value used in a branch condition is a load instruction, assume this load to be invariant. llvm-svn: 314146
* [ScopInfo] Allow uniform branch conditionsTobias Grosser2017-09-251-0/+68
| | | | | | | If all but one branch come from an error condition and the incoming value from this branch is a constant, we can model this branch. llvm-svn: 314116
* [ScopDetect/Info] Look through PHIs that follow an error blockTobias Grosser2017-09-241-0/+61
| | | | | | | | | | | In case a PHI node follows an error block we can assume that the incoming value can only come from the node that is not an error block. As a result, conditions that seemed non-affine before are now in fact affine. This is a recommit of r312663 after fixing test/Isl/CodeGen/phi_after_error_block_outside_of_scop.ll llvm-svn: 314075
* [IslExprBuilder] Do not generate RTC with more than 64 bitTobias Grosser2017-09-232-18/+17
| | | | | | | | | | Such RTCs may introduce integer wrapping intrinsics with more than 64 bit, which are translated to library calls on AOSP that are not part of the runtime and will consequently cause linker errors. Thanks to Eli Friedman for reporting this issue and reducing the test case. llvm-svn: 314065
* Revert "[ScopDetect/Info] Look through PHIs that follow an error block"Michael Kruse2017-09-061-61/+0
| | | | | | | | | | This reverts commit r312410 - [ScopDetect/Info] Look through PHIs that follow an error block The commit caused generation of invalid IR due to accessing a parameter that does not dominate the SCoP. llvm-svn: 312663
* [ScopDetect/Info] Look through PHIs that follow an error blockTobias Grosser2017-09-021-0/+61
| | | | | | | | In case a PHI node follows an error block we can assume that the incoming value can only come from the node that is not an error block. As a result, conditions that seemed non-affine before are now in fact affine. llvm-svn: 312410
* Fix Memory Access of failing tests.Michael Kruse2017-09-012-0/+103
| | | | | | | | | | | Mark scalar dependences for different statements belonging to same BB as 'Inter'. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D37147 llvm-svn: 312324
* [ScopInfo] Use statement lists for entry blocks of region statementsTobias Grosser2017-08-312-0/+75
| | | | | | | | | | | | | | | By using statement lists in the entry blocks of region statements, instruction level analyses also work on region statements. We currently only model the entry block of a region statements, as this is sufficient for most transformations the known-passes currently execute. Modeling instructions in the presence of control flow (e.g. infinite loops) is left out to not increase code complexity too much. It can be added when good use cases are found. This change set is reapplied, after a memory corruption issue had been fixed. llvm-svn: 312210
* Revert "[ScopInfo] Use statement lists for entry blocks of region statements"Tobias Grosser2017-08-312-75/+0
| | | | | | This reverts commit r312128. It aused some memory issues. llvm-svn: 312209
* [ScopInfo] Use statement lists for entry blocks of region statementsTobias Grosser2017-08-302-0/+75
| | | | | | | | | | | | | By using statement lists in the entry blocks of region statements, instruction level analyses also work on region statements. We currently only model the entry block of a region statements, as this is sufficient for most transformations the known-passes currently execute. Modeling instructions in the presence of control flow (e.g. infinite loops) is left out to not increase code complexity too much. It can be added when good use cases are found. llvm-svn: 312128
* [ScopBuilder] Introduce metadata for splitting scop statement.Michael Kruse2017-08-306-6/+345
| | | | | | | | | | | | This patch allows annotating of metadata in ir instruction (with "polly_split_after"), which specifies where to split a particular scop statement. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D36402 llvm-svn: 312107
* [ScopInfo] Add option to treat all function parameters as dereferencible.Siddharth Bhat2017-08-211-0/+98
| | | | | | | | | | | | | | | | | | | Dragonegg generates most function parameters as pointers to the actual parameters. However, it does not mark these parameters with the dereferencable attribute. Polly is conservative when it comes to invariant load hoisting, thus we add runtime checks to invariant load hoisted pointers when we do not know that pointers are dereferencable. This is correct behaviour, but is a performance penalty. Add a flag that allows all pointer parameters to be dereferencable. That way, polly can speculatively load-hoist paramters to functions without runtime checks. Differential Revision: https://reviews.llvm.org/D36461 llvm-svn: 311329
* [SCEVValidator] Loop exit values of loops before the SCoP are synthesizable.Michael Kruse2017-07-261-0/+61
| | | | | | | | | | | | | | | | | | | | | | | In the following loop: int i; for (i = 0; i < func(); i+=1) ; SCoP: for (int j = 0; j<n; j+=1) S(i, j) The value i is synthesizable in the SCoP that includes only the j-loop. This is because i is fixed within the SCoP, it is irrelevant whether it originates from another loop. This fixes a strange case where a PHI was synthesiable in a SCoP, but not its incoming value, triggering an assertion. This should fix MultiSource/Applications/sgefa/sgefa of the perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable buildbot. llvm-svn: 309109
* Untangle ScopInfo lit-testcases from specifics of the legacy-PMPhilip Pfaffe2017-07-217-22/+19
| | | | | | | | | | | | | | | | | | | Summary: For the ScopInfo lit testsuite, this patch removes some dependences on output behaviour of the legacy PM. In most cases, these tests checked the tool output for labels created by the pass printer in the legacy PM. This doesn't work for the new PM anymore. Untangling the testcases is the first step to porting the testsuite for the new PM infrastructure. Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser Subscribers: llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D35727 llvm-svn: 308754
* [IslNodeBuilder] Relax complexity check in invariant loads and run it earlyTobias Grosser2017-07-201-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | When performing invariant load hoisting we check that invariant load expressions are not too complex. Up to this commit, we performed this check by counting the sum of dimensions in the access range as a very simple heuristic. This heuristic is a little too conservative, as it prevents hoisting for any scops with a very large number of parameters. Hence, we update the heuristic to only count existentially quantified dimensions and set dimensions. We expect this to still detect the problematic expressions in h264 because of which this check was originally introduced. For some unknown reason, this complexity check was originally committed in IslNodeBuilder. It really belongs in ScopInfo, as there is no point in optimizing a program which we could have known earlier cannot be code generated. The benefit of running the check early is that we can avoid to even hoist checks that are expensive to code generate as invariant loads. This can be seen in the changed tests, where we now indeed detect the scop, but just not invariant load hoist the complicated access. We also improve the formatting of the code, document it, and use isl++ to simplify expressions. llvm-svn: 308659
OpenPOWER on IntegriCloud