summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/CodeGeneration.cpp
AgeCommit message (Collapse)Author
2014-08-16Revert "[Refactor] Cleanup runtime code generation"Tobias Grosser
This reverts commit 215466 (and 215528, a trivial formatting fix). The intention of these commits is a good one, but unfortunately they broke our LNT buildbot: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-codegen-isl Several of the cleanup changes that have been combined in this 'fixup' are trivial and could probably be committed as obvious changes without risking to break the build. The remaining changes are little and it should be easy to figure out what went wrong. llvm-svn: 215817
2014-08-12[Refactor] Cleanup runtime code generationJohannes Doerfert
+ Use regexp in two test case. + Refactor the runtime condition build function llvm-svn: 215466
2014-08-08[Fix] Broken build after r215121Johannes Doerfert
llvm-svn: 215183
2014-07-29[Refactor] Use non-const MemoryAccess base addressesJohannes Doerfert
llvm-svn: 214168
2014-07-28Replace the dependences parallelism check by the IslAst oneJohannes Doerfert
llvm-svn: 214061
2014-07-19Update for RegionInfo changes.Matt Arsenault
Mostly related to missing includes and renaming of the pass to RegionInfoPass. llvm-svn: 213457
2014-07-09clang-format polly to avoid buildbot noiseTobias Grosser
llvm-svn: 212609
2014-06-28[C++11] Use more range based forsTobias Grosser
llvm-svn: 211981
2014-06-19Update for ScopStmt iterator name change in LLVM r210927Tobias Grosser
Contributed-by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 211280
2014-05-07Remove unnecessary explicit typing in std::make_pairTobias Grosser
Contributed-by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 208181
2014-05-07Add the missing 'LoopToScev' parameterTobias Grosser
Contributed-by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 208180
2014-04-22[Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth
definition below all of the header #include lines, Polly edition. If you want to know more details about this, you can see the recent commits to Debug.h in LLVM. This is just the Polly segment of a cleanup I'm doing globally for this macro. llvm-svn: 206852
2014-04-16[C++11] Use nullptrTobias Grosser
llvm-svn: 206361
2014-04-15Fix for vector codegen in OpenMP subfunctionsTobias Grosser
Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de> llvm-svn: 206332
2014-04-14Codegeneration: Free memory correctly when using -polly-vectorizer=pollyTobias Grosser
This fixes PR19421. Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> llvm-svn: 206156
2014-03-04Introduce PollyIRBuilderTobias Grosser
PollyIRBuilder is currently just a typedef to IRBuilder<>. Consequently, this change should not affect behavior. In subsequent patches we will extend its functionality to emit loop.parallel metadata. llvm-svn: 202853
2014-02-25Update for llvm api change.Rafael Espindola
llvm-svn: 202183
2014-02-22GMP is only required for CLooGSebastian Pop
llvm-svn: 201925
2014-01-19CodeGeneration: Replace reference to isl_int with explicit mpz call.Tobias Grosser
This removes the last isl_int dependency in the default build. There are still some in OpenScop and Scoplib. For those isl-0.12.2 still needs to be used. llvm-svn: 199585
2014-01-13Adapt to DomTree changes in r199104Tobias Grosser
llvm-svn: 199157
2013-10-15clang-format: No empty line after 'public:'Tobias Grosser
llvm-svn: 192710
2013-09-02[CodeGen] Fixup assert fails caused by incorrect LoopInfo updateTobias Grosser
Contributed-by: Star Tan <tanmx_star@yeah.net> llvm-svn: 189764
2013-07-29CodeGeneration: Fix double free in vector forTobias Grosser
We now use __isl_take to annotate the uses of the isl_set where we got the memory management wrong. Thanks to Rafael! His pipefail work hardened our test environment and exposed this bug nicely. llvm-svn: 187338
2013-06-23Integrate latest clang-format changesTobias Grosser
llvm-svn: 184655
2013-05-16Update LoopInfo correctlyTobias Grosser
When the Polly code generation was written we did not correctly update the LoopInfo data, but still claimed that the loop information is correct. This does not only lead to missed optimizations, but it can also cause miscompilations in case passes such as LoopSimplify are run after Polly. Reported-by: Sergei Larin <slarin@codeaurora.org> llvm-svn: 181987
2013-05-16LoopGenerators: Construct loops such that they are already loop rotatedTobias Grosser
BeforeBB | v GuardBB / \ __ PreHeaderBB \ / \ / | latch HeaderBB | \ / \ / < \ / \ / ExitBB This does not only remove the need for an explicit loop rotate pass, but it also gives us the possibility to skip the construction of the guard condition in case the loop is known to be executed at least once. We do not yet exploit this, but by implementing this analysis in the isl code generator we should be able to remove more guards than the generic loop rotate pass can. Another point is that loop rotation can introduce additional PHI nodes, which may hide that a loop can be executed in parallel. This change avoids this complication and will make it easier to move the openmp code generation into a separate pass. llvm-svn: 181986
2013-05-07Move polly options into separate option categoryTobias Grosser
Use the new cl::OptionCategory support to move the Polly options into a separate option category. The aim is to hide most options and show by default only the options a user needs to influence '-O3 -polly'. The available options probably need some care, but here is the current status: Polly Options: Configure the polly loop optimizer -enable-polly-openmp - Generate OpenMP parallel code -polly - Enable the polly optimizer (only at -O3) -polly-no-tiling - Disable tiling in the scheduler -polly-only-func=<function-name> - Only run on a single function -polly-report - Print information about the activities of Polly -polly-vectorizer - Select the vectorization strategy =none - No Vectorization =polly - Polly internal vectorizer =unroll-only - Only grouped unroll the vectorize candidate loops =bb - The Basic Block vectorizer driven by Polly llvm-svn: 181295
2013-05-07Reformat with clang-formatTobias Grosser
clang-format become way more stable. This time we mainly reformat function signatures. llvm-svn: 181294
2013-04-16Support SCoPs with multiple entry edges.Tobias Grosser
Regions that have multiple entry edges are very common. A simple if condition yields e.g. such a region: if / \ then else \ / for_region This for_region contains two entry edges 'then' -> 'for_region' and 'else' -> 'for_region'. Previously we scheduled the RegionSimplify pass to translate such regions into simple regions. With this patch, we now support them natively when the region is in -loop-simplify form, which means the entry block should not be a loop header. Contributed by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179586
2013-04-10Update formatting to latest version of clang-formatTobias Grosser
llvm-svn: 179160
2013-04-10Support SCoPs with multiple exit edgesTobias Grosser
Regions that have multiple exit edges are very common. A simple if condition yields e.g. such a region: if / \ then else \ / after Region: if -> after This regions contains the bbs 'if', 'then', 'else', but not 'after'. It has two exit edges 'then' -> 'after' and 'else' -> 'after'. Previously we scheduled the RegionSimplify pass to translate such regions into simple regions. With this patch, we now support them natively. Contributed-by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179159
2013-03-23clang-format: Many more filesTobias Grosser
After this commit, polly is clang-format clean. This can be tested with 'ninja polly-check-format'. Updates to clang-format may change this, but the differences will hopefully be both small and general improvements to the formatting. We currently have some not very nice formatting for a couple of items, DEBUG() stmts for example. I believe the benefit of being clang-format clean outweights the not perfect layout of this code. llvm-svn: 177796
2013-03-20Remove dependence on canonical induction variableTobias Grosser
When using the scev based code generation, we now do not rely on the presence of a canonical induction variable any more. This commit prepares the path to (conditionally) disable the induction variable canonicalization pass. llvm-svn: 177548
2013-03-18use the canonical IV only when it existsSebastian Pop
llvm-svn: 177306
2013-02-22CodeGen: clang-formatTobias Grosser
llvm-svn: 175872
2013-02-15add LoopToScev mapsSebastian Pop
llvm-svn: 175295
2013-02-05CodeGen: clang-format goodnessTobias Grosser
The changed files are not yet clang-format clean, but we are getting close. llvm-svn: 174403
2013-01-02Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth
reflect the migration in r171366. llvm-svn: 171370
2012-12-29Formatting: Break lines after binary operators such as '&&'Tobias Grosser
assert(Condition && "Text"); -> assert(Condition && "Text); This aligns Polly with the style used in LLVM. llvm-svn: 171242
2012-12-29Fix obvious formatting problems.Tobias Grosser
We fix the following formatting problems found by clang-format: - 80 cols violations - Obvious problems with missing or too many spaces - multiple new lines in a row clang-format suggests many more changes, most of them falling in the following two categories: 1) clang-format does not at all format a piece of code nicely 2) The style that clang-format suggests does not match the style used in Polly/LLVM I consider differences caused by reason 1) bugs, which should be fixed by improving clang-format. Differences due to 2) need to be investigated closer to understand the cause of the difference and the solution that should be taken. llvm-svn: 171241
2012-12-18return -1 when polly::getNumberOfIterations returns -1Sebastian Pop
llvm-svn: 170422
2012-12-18isl: vector code generation based on ISL astSebastian Pop
Original patch by Tobias Grosser, slightly modified by Sebastian Pop. llvm-svn: 170420
2012-12-18change interface for isStrideSebastian Pop
isStride now takes a partial schedule as input. Patch from Tobias Grosser <tobias@grosser.es>. llvm-svn: 170419
2012-11-30Remove unneeded preservation and restore of ValueMap and ClastVars in GPGPU codeTobias Grosser
generation. We don't use the exact same way to build loop body for GPGPU codegen as openmp codegen and other transformations do currently, in which cases 'createLoop' function is called recursively. GPGPU codegen may fail due to improper restore of ValueMap and ClastVars . Contributed by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 168966
2012-11-30Add an additional input argument according to chanages of function ↵Tobias Grosser
polly::createLoop. Contributed-by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 168964
2012-11-26remove unused flagSebastian Pop
llvm-svn: 168620
2012-11-19Make polly -Wdocumentation cleanTobias Grosser
llvm-svn: 168311
2012-11-01Revert multiple adress space changes in PollyTobias Grosser
llvm-svn: 167234
2012-11-01Codegen: Selectively copy in array addresses for OpenMP codeTobias Grosser
The detection of values that need to be copied in to the generated OpenMP subfunction also detects the array base addresses needed in the SCoP. Hence, it is not necessary to unconditionally copy all the base addresses to the generated function. Test cases are modified to reflect this change. Arrays which are global variables do not occur in the struct passed to the subfunction anymore. A test case for base address copy-in is added in copy_in_array.{c,ll}. Committed with slight modifications Contributed by: Armin Groesslinger <armin.groesslinger@uni-passau.de> llvm-svn: 167215
2012-11-01CodeGen: Add scop-parameters to the OpenMP contextTobias Grosser
In addition to the arrays and clast variables a SCoP statement may also refer to values defined before the SCoP or to function arguments. Detect these values and add them to the set of values passed to the function generated for OpenMP parallel execution of a clast. Committed with additional test cases and some refactoring. Contributed by: Armin Groesslinger <armin.groesslinger@uni-passau.de> llvm-svn: 167214