aboutsummaryrefslogtreecommitdiff
path: root/polly
AgeCommit message (Collapse)AuthorFilesLines
2017-08-24ReleaseNotes: minor touch-upsHans Wennborg1-4/+2
llvm-svn: 311725
2017-08-24ReleaseNotes: drop in-progress warningHans Wennborg1-9/+3
llvm-svn: 311724
2017-08-01[release 5.0][Release Notes] Polly-ACC works with JuliaSingapuram Sanjay Srivallabh1-0/+7
Summary: Polly can now offload Julia to GPUs. This was enabled by the pull requests https://github.com/JuliaLang/julia/pull/21736 and https://github.com/JuliaLang/julia/pull/22036. Reviewers: grosser, bollu Subscribers: pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D36050 llvm-svn: 309656
2017-07-27Merging r309300:Hans Wennborg1-1/+1
------------------------------------------------------------------------ r309300 | hans | 2017-07-27 11:14:00 -0700 (Thu, 27 Jul 2017) | 1 line Tiny docs fix ------------------------------------------------------------------------ llvm-svn: 309301
2017-07-27Merging r308505:Hans Wennborg1-2/+2
------------------------------------------------------------------------ r308505 | efriedma | 2017-07-19 11:18:37 -0700 (Wed, 19 Jul 2017) | 5 lines [docs] Minor formatting fixes. Patch by Tarun Rajendran. ------------------------------------------------------------------------ llvm-svn: 309299
2017-07-21Merging r308512:Hans Wennborg1-1/+2
------------------------------------------------------------------------ r308512 | pfaffe | 2017-07-19 12:20:58 -0700 (Wed, 19 Jul 2017) | 4 lines [CMake] Fix r307650: Readd missing dependency. The commit erroneously removed the dependency of the Polly tests on things like opt and FileCheck. Add that dependency back. ------------------------------------------------------------------------ llvm-svn: 308717
2017-07-19[ScopInfo] Use AnyPHINode in tryGetValueStored()Tobias Grosser1-1/+1
This was an oversight in the previous commit. Michael already suggested this beforehand. llvm-svn: 308440
2017-07-19[Test] Do not pipe binary data to FileCheck.Michael Kruse1-1/+1
llvm-svn: 308437
2017-07-19[ScopInfo] Introduce tryGetValueStoredTobias Grosser2-7/+16
Summary: This makes code more readable and allows to reuse this functionality in the future at other places. Suggested-by Michael Kruse in post-commit review of r307660. Reviewers: Meinersbur, bollu, gareevroman, efriedma, huihuiz, sebpop, simbuerg Reviewed By: Meinersbur Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D35585 llvm-svn: 308435
2017-07-19[Polly][docs][Release Notes] Adding Information about Remarks to Release ↵Tobias Grosser2-1/+30
Notes and Documentation Summary: Based off of D35399 Reviewers: pollydev, llvm-commits, bollu, grosser Reviewed By: grosser Tags: #polly Contributed-by: Tarun Ranjendran Differential Revision: https://reviews.llvm.org/D35596 llvm-svn: 308403
2017-07-18[ScopInfo] Introduce list of statements in Scop::StmtMap. NFC.Michael Kruse2-5/+7
Once statements are split, a BasicBlock will comprise of multiple statements. To prepare for this change in future, we introduce a list of statements in the statement map. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35301 llvm-svn: 308318
2017-07-18[CMake] FindJsoncpp.cmake: Use descriptive variable name for libjsoncpp.so path.Michael Kruse1-3/+3
find_library(lib) stores the result in the variable "lib", which is also cached in CMakeCache.txt. This could theoretically conflict if jsoncpp required two libraries, which each would get cached as "lib". Use a more descriptive and disambiguative "jsoncpp_${libname}" for that. llvm-svn: 308289
2017-07-18[CMake] FindJsoncpp.cmake: Use foreach variable.Michael Kruse1-1/+1
Use ${libname} instead of ${lib}. By a coincidence, this worked because ${lib} also the variable used for finding the libjsoncpp.so full path. llvm-svn: 308288
2017-07-18[CMake] FindJsoncpp.cmake: search pkg-config libs in default search paths.Michael Kruse1-1/+0
pkg_search_module(JSONCPP) should set JSONCPP_LIBDIR/JSONCPP_LIBRARY_DIRS to where the libjsoncpp.so can be found. However, on Ubuntu 14.04 LTS (Trusty Tahr) it returns /usr/lib while the libjsoncpp library can be found at /usr/lib/x86_64-linux-gnu/libjsoncpp.so. Thus, while searching for the full path of the jsoncpp library, it is not found. JSONCPP_LIBDIR is correctly set to /usr/lib/x86_64-linux-gnu on e.g., Ubuntu 16.04 LTS (Xenial Xerus ) Fix by removing the NO_DEFAULT_PATH flag, in order to search the system default paths even if the library is not found in JSONCPP_LIBDIR/JSONCPP_LIBRARY_DIRS. This fixes bug llvm.org/PR33798. llvm-svn: 308287
2017-07-18[NFC] [PPCGCodeGeneration] cleanup kills related code.Siddharth Bhat1-24/+29
We extended kills in Polly to handle both `phi` nodes and scalars that are not used within the Scop. Update the comments and choice of variable names to reflect this. llvm-svn: 308279
2017-07-17[Polly] [OptDiag] Updating Polly Diagnostics RemarksEli Friedman9-65/+375
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
2017-07-17[Polly] Avoid use of `getStmtFor(BB)` in PolyhedralInfo. NFCTobias Grosser1-18/+17
Summary: Since there will be no more a 1-1 correspondence between statements and basic block, we would like to get rid of the method `getStmtFor(BB)` and its uses. Here we remove one of its uses in PolyhedralInfo, as suggested by Michael Sir. Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser Subscribers: pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D35300 llvm-svn: 308220
2017-07-17[ScopInfo] Simplify new access functions under domain contextTobias Grosser14-117/+118
Summary: We do not keep domain constraints on access functions when building the scop. Hence, for consistency reasons, it makes also sense to not include them when storing a new access function. This change results in simpler access functions that make output easier to read. This patch also helps to make DeLICMed memory accesses to be understood by our matrix multiplication pattern matching pass. Further changes to the matrix multiplication pattern matching are needed for this to work, so the corresponding test case will be added in a future commit. Reviewers: Meinersbur, bollu, gareevroman, efriedma, huihuiz, sebpop, simbuerg Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D35237 llvm-svn: 308215
2017-07-17 [PPCGCodeGeneration] Generate invariant loads before trying to generate IR.Siddharth Bhat2-0/+72
- We should call `preloadInvariantLoads` to make sure that code is generated for invariant loads in the kernel. Differential Revision: https://reviews.llvm.org/D35410 llvm-svn: 308187
2017-07-16ScopInfo: Remove not-in-DomainMap statements in separate functionTobias Grosser3-18/+45
This separates ScopBuilder internal and ScopBuilder external functionality. llvm-svn: 308152
2017-07-16Fix typo in comment [NFC]Tobias Grosser1-1/+1
llvm-svn: 308149
2017-07-16[Polly] Fix a typo [NFC]Tobias Grosser1-2/+2
Reviewers: grosser, Meinersbur, bollu Tags: #polly Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35459 llvm-svn: 308134
2017-07-15[ScopDetection] If a loop is not part of a scop, none of it backedges can beTobias Grosser6-52/+120
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
2017-07-15[Polly] Translate Scop::DomainMap to islppTobias Grosser2-83/+65
Reviewers: grosser, Meinersbur, bollu Subscribers: pollydev Tags: #polly Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35453 llvm-svn: 308093
2017-07-15[Polly] Use Isl c++ for InvalidDomainMapTobias Grosser3-65/+50
Reviewers: grosser, Meinersbur, bollu Subscribers: maxf, pollydev Tags: #polly Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35308 llvm-svn: 308089
2017-07-14update isl to: isl-0.18-791-ga22eb92Tobias Grosser12-93/+84
This is a regular maintenance update llvm-svn: 308013
2017-07-14[PPCGCodeGeneration] Fix runtime check adjustments since they make ↵Siddharth Bhat5-13/+108
assumptions about BB layout. - There is a conditional branch that is used to switch between the old and new versions of the code. - If we detect that the build was unsuccessful, `PPCGCodeGeneration` will change the runtime check to be always set to false. - To actually *reach* this runtime check instruction, `PPCGCodeGeneration` was using assumptions about the layout of the BBs. - However, invariant load hoisting violates this assumption by inserting an extra basic block in the middle. - Fix the assumption on the layout by having `createScopConditionally` return the conditional branch instruction. - Use this reference to set to always-false. llvm-svn: 308010
2017-07-13[Invariant Loads] Do not consider invariant loads to have dependences.Siddharth Bhat17-56/+197
We need to relax constraints on invariant loads so that they do not create fake RAW dependences. So, we do not consider invariant loads as scalar dependences in a region. During these changes, it turned out that we do not consider `llvm::Value` replacements correctly within `PPCGCodeGeneration` and `ISLNodeBuilder`. The replacements dictated by `ValueMap` were not being followed in all places. This was fixed in this commit. There is no clean way to decouple this change because this bug only seems to arise when the relaxed version of invariant load hoisting was enabled. Differential Revision: https://reviews.llvm.org/D35120 llvm-svn: 307907
2017-07-12[PPCGCodeGen] Differentiate kernels based on their parent ScopSingapuram Sanjay Srivallabh10-15/+167
Summary: Add a sequence number that identifies a ptx_kernel's parent Scop within a function to it's name to differentiate it from other kernels produced from the same function, yet different Scops. Kernels produced from different Scops can end up having the same name. Consider a function with 2 Scops and each Scop being able to produce just one kernel. Both of these kernels have the name "kernel_0". This can lead to the wrong kernel being launched when the runtime picks a kernel from its cache based on the name alone. This patch supplements D33985, by differentiating kernels across Scops as well. Previously (even before D33985) while profiling kernels generated through JIT e.g. Julia, [[ https://groups.google.com/d/msg/polly-dev/J1j587H3-Qw/mR-jfL16BgAJ | kernels associated with different functions, and even different SCoPs within a function, would be grouped together due to the common name ]]. This patch prevents this grouping and the kernels are reported separately. Reviewers: grosser, bollu Reviewed By: grosser Subscribers: mehdi_amini, nemanjai, pollydev, kbarton Tags: #polly Differential Revision: https://reviews.llvm.org/D35176 llvm-svn: 307814
2017-07-12[NFC] [SCEVValidator] Make parameter name of `hasScalarDepsInsideRegion` ↵Siddharth Bhat1-2/+2
consistent. `SCEV` parameter is called as `Expr` in `SCEVValidator.cpp`, as well as in other functions in `SCEVValidator.h`. llvm-svn: 307800
2017-07-12[Polly] [Tests] Update `lit.cfg` uses of `lit.util.capture` to ↵Siddharth Bhat1-2/+4
`subprocess.check_output` - `lit.util.capture` was removed in `r306625`. - Replace `lit.util.capture` to `subprocess.check_output` as LLVM did. - LLVM revision of this change: `https://reviews.llvm.org/D35088`. Differential Revision: https://reviews.llvm.org/D35255 llvm-svn: 307765
2017-07-11[WWW] Add a section to Getting Started about building out-of-treePhilip Pfaffe1-0/+12
llvm-svn: 307704
2017-07-11[Simplify] Also remove redundant writes which originally came from PHI nodesTobias Grosser2-7/+8
llvm-svn: 307660
2017-07-11[Polly][CMake] Skip unit-tests in lit if gtest is not availablePhilip Pfaffe4-5/+10
Summary: There is a bug in the current lit configurations for the unittests. If gtest is not available, the site-config for the unit tests won't be generated. Because lit recurses through the test directory, the lit configuration for the unit tests will be discovered nevertheless, leading to a fatal error in lit. This patch semi-gracefully skips the unittests if gtest is not available. As a result, running lit now prints this: `warning: test suite 'Polly-Unit' contained no test`. If people think that this is too annoying, the alternative would be to pick apart the test directory, so that the lit testsuite discovery will always only find one configuration. In fact, both of these things could be combined. While it's certainly nice that running a single lit command runs all the tests, I suppose people use the `check-polly` make target over lit most of the time, so the difference might not be noticed. Reviewers: Meinersbur, grosser Reviewed By: grosser Subscribers: mgorny, bollu, pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D34053 llvm-svn: 307651
2017-07-11[Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree ↵Philip Pfaffe6-313/+170
builds Summary: As of now, Polly uses llvm-config to set up LLVM dependencies in an out-of-tree build. This is problematic for two reasons: 1) Right now, in-tree and out-of-tree builds in fact do different things. E.g., in an in-tree build, libPolly depends on a handful of LLVM libraries, while in an out-of-tree build it depends on all of them. This means that we often need to treat both paths seperately. 2) I'm specifically unhappy with the way libPolly is linked right now, because it just blindly links against all the LLVM libs. That doesn't make a lot of sense. For instance, one of these libs is LLVMTableGen, which contains a command line definition of a -o option. This means that I can not link an out-of-tree libPolly into a tool which might want to offer a -o option as well. This patch (mostly) drop the use of llvm-config in favor of LLVMs exported cmake package. However, building Polly with unittests requires access to the gtest sources (in the LLVM source tree). If we're building against an LLVM installation, this source tree is unavailable and must specified. I'm using llvm-config to provide a default in this case. Reviewers: Meinersbur, grosser Reviewed By: grosser Subscribers: tstellar, bollu, chapuni, mgorny, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D33299 llvm-svn: 307650
2017-07-11[tests] Add import-jscop-dir to lit.site.cfg.inTobias Grosser1-0/+2
For the previous commit I accidentally added this change to lit.site.cfg, which is autogenerated and was consequently not part of the previous commit. llvm-svn: 307648
2017-07-11[tests] Set -polly-import-jscop-dir=%S alwaysTobias Grosser67-76/+76
This simplifies the test cases. llvm-svn: 307645
2017-07-11[Simplify] Add test case which we currently missTobias Grosser3-0/+356
llvm-svn: 307643
2017-07-11Always export the latest memory access relationsTobias Grosser3-1/+8
This allows us to export the results from transformations such as DeLICM. llvm-svn: 307641
2017-07-10[IslAst] Print memory accesses in AST dumpTobias Grosser3-3/+120
When providing the option "-polly-ast-print-accesses" Polly also prints the memory accesses that are generated: #pragma known-parallel for (int c0 = 0; c0 <= 1023; c0 += 4) #pragma simd for (int c1 = c0; c1 <= c0 + 3; c1 += 1) Stmt_for_body( /* read */ &MemRef_B[0] /* write */ MemRef_A[c1] ); This makes writing and debugging memory layout transformations easier. Based on a patch contributed by Thomas Lang (ETH Zurich) llvm-svn: 307579
2017-07-09Remove freed InvalidDomains from InvalidDomainMap.Tobias Grosser1-0/+1
Summary: Since r306667, propagateInvalidStmtDomains gets a reference to an InvalidDomainMap. As part of the branch leading to return false, the respective domain is freed. It is, however, not removed from the InvalidDomainMap, leaking a pointer to a freed object which results in a use-after-free. Fix this be removing the domain from the map before returning. We tried to derive a test case that reliably failes, but did not succeed in producing one. Hence, for now the failures in our LNT bots must be sufficient to keep this issue tested. Reviewers: grosser, Meinersbur, bollu Subscribers: bollu, nandini12396, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D34971 llvm-svn: 307499
2017-07-07[NFC] [PPCGCodeGeneration] Extend ↵Siddharth Bhat1-6/+11
`invariant-load-hoisting-with-variable-upper-bound` test case. - Check that we have invariant accesses. - Use `-polly-use-llvm-names` for better names in the test. - Rename test function to `f` for brevity. llvm-svn: 307401
2017-07-07[NFC] [PPCGCodeGeneration] Add test for simple invariant load hoisting.Siddharth Bhat1-0/+52
- This already works, but add this to ensure that there is no regressions when I expand the invariant load hoisting ability of `PPCGCodeGeneration`. llvm-svn: 307398
2017-07-07Make create_ll work with latest LLVM [NFC]Tobias Grosser1-7/+4
- Instead of running with -O0, we enable the highest optimization level, but then disable optimizations. This ensures that possibly important metadata is still emitted. - Update the code for attribute removal to work with latest LLVM - Do not cut an arbitrary number of lines from the LL file. It is undocumented why this was needed at the first place, and such a feature is likely to break with trivial IR changes that may come in the future. llvm-svn: 307355
2017-07-06[Polly] [PPCGCodeGeneration] Teach `must_kills` to kill scalars that are ↵Siddharth Bhat3-9/+117
local to the scop. - By definition, we can pass something as a `kill` to PPCG if we know that no data can flow across a kill. - This is useful for more complex examples where we have scalars that are local to a scop. - If the local is only used within a scop, we are free to kill it. Differential Revision: https://reviews.llvm.org/D35045 llvm-svn: 307260
2017-07-05Prefix the name of the calling host function in the name of callee GPU kernelSingapuram Sanjay Srivallabh7-15/+23
Summary: Provide more context to the name of a GPU kernel by prefixing its name with the host function that calls it. E.g. The first kernel called by `gemm` would be `FUNC_gemm_KERNEL_0`. Kernels currently follow the "kernel_#" (# = 0,1,2,3,...) nomenclature. This patch makes it easier to map host caller and device callee, especially when there are many kernels produced by Polly-ACC. Reviewers: grosser, Meinersbur, bollu, philip.pfaffe, kbarton! Reviewed By: grosser Subscribers: nemanjai, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D33985 llvm-svn: 307173
2017-07-05[NFC] Fix breaking build by adding REQUIRES: pollyaccSiddharth Bhat2-0/+4
llvm-svn: 307165
2017-07-05[NFC] [ScopInfo] fix warning about construction orderSiddharth Bhat1-2/+2
llvm-svn: 307164
2017-07-05[PPCGCodeGeneration] Teach Polly to start using live range reordering.Siddharth Bhat5-13/+243
Polly did not use PPCG's live range reordering feature. Teach PPCGCodeGeneration to use this. Documentation on this is sparse, so much of the code is conservative. We currently kill all phi nodes in a Scop by appending them to the must_kill map we pass to PPCG. I do not have a proof of correctness, but it seems to be intuitively correct. We also do not handle `array_order`, which, quoting PPCG, is: PPCG/gpu.h: "Order dependences on non-scalars." It seems to consist of RAW dependences between arrays. We need to pass this information for more complex privatization cases. Differential Revision: https://reviews.llvm.org/D34941 llvm-svn: 307163
2017-07-04Bump isl to isl-0.18-768-g033b61aeTobias Grosser129-1109/+3539
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