summaryrefslogtreecommitdiffstats
path: root/polly/test
Commit message (Collapse)AuthorAgeFilesLines
* Generalize the pass registration mechanism used by Polly to any third-party toolserge_sans_paille2020-01-023-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | There's quite a lot of references to Polly in the LLVM CMake codebase. However the registration pattern used by Polly could be useful to other external projects: thanks to that mechanism it would be possible to develop LLVM extension without touching the LLVM code base. This patch has two effects: 1. Remove all code specific to Polly in the llvm/clang codebase, replaicing it with a generic mechanism 2. Provide a generic mechanism to register compiler extensions. A compiler extension is similar to a pass plugin, with the notable difference that the compiler extension can be configured to be built dynamically (like plugins) or statically (like regular passes). As a result, people willing to add extra passes to clang/opt can do it using a separate code repo, but still have their pass be linked in clang/opt as built-in passes. Differential Revision: https://reviews.llvm.org/D61446
* Migrate function attribute "no-frame-pointer-elim"="false" to ↵Fangrui Song2019-12-2440-58/+58
| | | | "frame-pointer"="none" as cleanups after D56351
* Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" ↵Fangrui Song2019-12-2423-29/+29
| | | | as cleanups after D56351
* [GPGPU] Fix regression test after 395124.Michael Kruse2019-11-131-1/+1
| | | | | Commit 395124 "NVPTX: Don't insert an extra empty line at the end of the last section" changed the length of the kernel payload. Update the regression test to the new binary size.
* [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
* Revert "Update polly test for SCEV change."Tim Northover2019-09-301-1/+1
| | | | | | The motivating SCEV change was reverted as incorrect. llvm-svn: 373185
* [CodeGen] Handle outlining of CopyStmts.Michael Kruse2019-09-171-0/+72
| | | | | | | | | | | | | | | | Since the removal of extensions nodes from schedule trees in r362257 it is possible to emit parallel code for SCoPs containing matrix-multiplications. However, the code looking for references used in outlined statement was not prepared to handle CopyStmts introduced by the matrix-matrix multiplication detection. In this case, CopyStmts do not introduce references in addition to the ones captured by MemoryAccesses, i.e. we change the assertion to accept CopyStmts and add a regression test for this case. This fixes llvm.org/PR43164 llvm-svn: 372188
* [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-ACC] Fix test after IR-printer change.Michael Kruse2019-08-131-1/+1
| | | | | | | After r367755, even unnamed parameters are printed in IR dumps. Change the test to expect te additional %0 in the line. llvm-svn: 368763
* 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
* [test] Add wrap flags after D61934.Michael Kruse2019-06-172-3/+3
| | | | | | | | | | | | https://reviews.llvm.org/D61934, committed as r362687, r363540, r363364 and r363147, made some emitted instruction nus/nsw. Add these falgs to Polly's regression tests. This should fix Polly :: Isl/CodeGen/partial_write_in_region_with_loop.ll Polly :: Isl/CodeGen/scev_expansion_in_nonaffine.ll llvm-svn: 363599
* [ScheduleOptimizer] Hoist extension nodes after schedule optimization.Michael Kruse2019-05-312-54/+181
| | | | | | | | | | | | | | | | | | | | | | Extension nodes make schedule trees are less flexible: Many operations, such as rescheduling, do not work on such schedule trees with extension. As such, some functionality such as determining parallel loops in isl's AST are disabled. Currently, only the pattern-matching generalized matrix-matrix multiplication optimization adds extension nodes (to add copy-in statements). This patch removes all extension nodes as the last step of the schedule optimization by hoisting the extension node's added domain up to the root domain node. All following passes can assume that schedule trees work without restrictions, including the parallelism test. Mark the outermost loop of the optimized matrix-matrix multiplication as parallel such that -polly-parallel is able to parallelize that loop. Differential Revision: https://reviews.llvm.org/D58202 llvm-svn: 362257
* [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
* [CodeGen] Fix order of PHINode and MA Write generation.Michael Kruse2019-05-203-0/+148
| | | | | | | | | | | | | | | | At the end of a region statement, the PHINode must be generated while the current IRBuilder's block is the region's exit node. For obvious reasons: The PHINode references the region's exiting block. A partial write would insert new control flow, i.e. insert new basic blocks between the exiting blocks and the current block. We fix this by generating the PHI nodes (region exit values) before generating any MemoryAccess's stores. This should fix the AOSP buildbot. Reported-by: Eli Friedman <efriedma@quicinc.com> llvm-svn: 361204
* [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-103-2/+91
| | | | | | | | | | 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
* [CodeGen] LLVM OpenMP Backend.Michael Kruse2019-03-194-15/+152
| | | | | | | | | | | | | | | | | | | | | The ParallelLoopGenerator class is changed such that GNU OpenMP specific code was removed, allowing to use it as super class in a template-pattern. Therefore, the code has been reorganized and one may not use the ParallelLoopGenerator directly anymore, instead specific implementations have to be provided. These implementations contain the library-specific code. As such, the "GOMP" (code completely taken from the existing backend) and "KMP" variant were created. For "check-polly" all tests that involved "GOMP": equivalents were added that test the new functionalities, like static scheduling and different chunk sizes. "docs/UsingPollyWithClang.rst" shows how the alternative backend may be used. Patch by Michael Halkenhäuser <michaelhalk@web.de> Differential Revision: https://reviews.llvm.org/D59100 llvm-svn: 356434
* Remove irrelevant references to legacy git repositories fromJames Y Knight2019-01-1517-20/+20
| | | | | | | | | 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
* [IslAst] Fix InParallelFor nesting.Michael Kruse2018-09-272-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IslAst could mark two nested outer loops as "OutermostParallel". It caused that the code generator tried to OpenMP-parallelize both loops, which it is not prepared loop. It was because the recursive AST build algorithm managed a flag "InParallelFor" to ensure that no nested loop is also marked as "OutermostParallel". Unfortunatetly the same flag was used by nodes marked as SIMD, and reset to false after the SIMD node. Since loops can be marked as SIMD inside "OutermostParallel" loops, the recursive algorithm again tried to mark loops as "OutermostParellel" although still nested inside another "OutermostParallel" loop. The fix exposed another bug: The function "astScheduleDimIsParallel" was only called when a loop was potentially "OutermostParallel" or "InnermostParallel", but as a side-effect also determines the minimum dependence distance. Hence, changing when we need to know whether a loop is "OutermostParallel" also changed which loop was annotated with "#pragma minimal dependence distance". Moreover, some complex condition linked with "InParallelFor" determined whether a loop should be an "InnermostParallel" loop. It missed some situations where it would not use mark as such although being inside an SIMD mark node, and therefore not be annotated using "#pragma simd". The changes in particular: 1. Split the "InParallelFor" flag into an "InParallelFor" and an "InSIMD" flag. 2. Unconditionally call "astScheduleDimIsParallel" for its side-effects and store the result in "InParallel" for later use. 3. Simplify the condition when a loop is "InnermostParallel". Fixes llvm.org/PR33153 and llvm.org/PR38073. llvm-svn: 343212
* [PerfMonitor] Fix rdtscp callsitesTobias Grosser2018-09-113-35/+38
| | | | | | | | | | | | | Summary: Update all rdtscp callsites in PerfMonitor so that they conform with the signature changes introduced in r341698. Reviewers: grosser, bollu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51928 llvm-svn: 341946
* [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] Remove non-JSPON comments in JSCOP file. NFC.Michael Kruse2018-07-281-17/+0
| | | | llvm-svn: 338185
* Fix for r336080: Missing colon in REQUIRES linePhilip Pfaffe2018-07-021-1/+1
| | | | llvm-svn: 336083
* [polly-acc] change cl_get_* return types to 32/64bitPhilip Pfaffe2018-07-021-0/+90
| | | | | | | | | | | | | | | | | | | Summary: This patch changes the return types for ocl_get_* functions during SPIR code generation. Because these functions return size_t types, the return type needs to be changed to the actual size of size_t on the device. Based on work by Michal Babej and Pekka Jääskeläinen Patch by: Alain Denzler Reviewers: grosser, philip.pfaffe, bollu Reviewed By: grosser, philip.pfaffe Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D48774 llvm-svn: 336080
* [ScopHelper] Provide support for recognising collective invariant loadsPhilip Pfaffe2018-06-291-0/+56
| | | | | | | | | | | | | | Summary: This patch aims to provide support for detecting load patterns which are collectively invariant but right now `isHoistableLoad()` is checking each load instruction individually which cannot detect the load pattern as a whole. Patch by: Sahil Girish Yerawar Reviewers: bollu, philip.pfaffe, Meinersbur Reviewed By: philip.pfaffe, Meinersbur Differential Revision: https://reviews.llvm.org/D48026 llvm-svn: 335949
* test: use regex matchers to make test-case robust against register renumberingsTobias Grosser2018-06-281-2/+2
| | | | | Suggested-by: Michael Kruse llvm-svn: 335813
* [SCEV] Re-apply r335197 (with Polly fixes).Tim Shen2018-06-211-11/+15
| | | | | | | | | | | | | | | | | Summary: This initiates a discussion on changing Polly accordingly while re-applying r335197 (D48338). I have never worked on Polly. The proposed change to param_div_div_div_2.ll is not educated, but just patterns that match the output. All LLVM files are already reviewed in D48338. Reviewers: jdoerfert, bollu, efriedma Subscribers: jlebar, sanjoy, hiraditya, llvm-commits, bixia Differential Revision: https://reviews.llvm.org/D48453 llvm-svn: 335292
* 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
* [Polly] Fix a testcase after LLVM commit r334318Krzysztof Parzyszek2018-06-081-3/+3
| | | | | | | ScalarEvolution has become slightly more intelligent, so obfuscate the exit condition in the testcase some more to keep it working. llvm-svn: 334327
* [Acc] Followup for r333105: Fix one additional testcasePhilip Pfaffe2018-05-241-1/+2
| | | | llvm-svn: 333168
* [Acc] Enable legacy stmt granularity in remaining failing testcasesPhilip Pfaffe2018-05-233-2/+3
| | | | | | | The default statement granularity changed in a recent change by Micheal. To avoid forwad-porting the testcases, enable the legacy behaviour again in these tests. llvm-svn: 333105
* [Acc] Update testcases for minor changes in the PPCG mapper andPhilip Pfaffe2018-05-235-6/+6
| | | | | | | | | | | statement naming - A recent ppcg/isl update caused the grid/block size upper bounds to deviate by one from the oracle. This is not an effect that's visible at runtime. - Statement naming changed in polly. Update the testcases. llvm-svn: 333090
* [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
* [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-1015-20/+20
| | | | | | 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
* Pass compiler arguments in the create_ll.sh scriptPhilip Pfaffe2018-05-021-2/+5
| | | | | | | | | | | | | | | | | Summary: Occasionally you need an include or similar things to be configured when making a new testcase. Allow passing these to the script and down to the compiler calls. Reviewers: grosser, Meinersbur, bollu Reviewed By: Meinersbur Subscribers: bollu, llvm-commits, pollydev Differential Revision: https://reviews.llvm.org/D46359 llvm-svn: 331364
* [CodeGen] Print executed statement instances at runtime.Michael Kruse2018-04-251-0/+38
| | | | | | | | | | | | | Add the options -polly-codegen-trace-stmts and -polly-codegen-trace-scalars. When enabled, adds a call to the beginning of every generated statement that prints the executed statement instance. With -polly-codegen-trace-scalars, it also prints the value of all scalars that are used in the statement, and PHIs defined in the beginning of the statement. Differential Revision: https://reviews.llvm.org/D45743 llvm-svn: 330864
* [ScopDetect] Reject loop with multiple exit blocks.Michael Kruse2018-04-2512-1/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ScopDetect / ScopInfo] Get statistics for scops without any loop correctlyTobias Grosser2018-04-181-2/+24
| | | | | | Make sure we also counts scops not containing any loops. llvm-svn: 330285
* [NewPM] Update pass registration for the LLVM plugin interfacePhilip Pfaffe2018-04-172-0/+15
| | | | | | | | | | | | | | | | Summary: As of rL329273, LLVM has a mechanism to load new-pm plugins in opt. Use this API in Polly. Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser, Meinersbur Subscribers: lksbhm, bollu, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D45484 llvm-svn: 330181
* [CodeGen] Allow undefined loads in statement instances outside context.Michael Kruse2018-04-103-0/+205
| | | | | | | | | | | | | | | | | | | | A check in assert-builds was meant to verify that a load provides a value in all statement instances (i.e. its domain). The domain is commonly gist'ed within the parameter context to contain fewer constraints. However, statement instances outside the context are no valid executions, hence the value provided can be undefined. Refine the check for valid loads to only needed to be defined within the SCoP context. In addition, the JSONImporter had to be changed to allow importing access relations that are broader than the current access relation, but still defined over all statement instances. This should fix the compiler crash in test-suite's oggenc of the -polly-process-unprofitable buildbot. llvm-svn: 329655
* [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-096-117/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud