summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/CodeGeneration.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Use nullptrTobias Grosser2014-04-161-3/+3
| | | | llvm-svn: 206361
* Fix for vector codegen in OpenMP subfunctionsTobias Grosser2014-04-151-0/+7
| | | | | Contributed-by: Johannes Doerfert <doerfert@cs.uni-saarland.de> llvm-svn: 206332
* Codegeneration: Free memory correctly when using -polly-vectorizer=pollyTobias Grosser2014-04-141-0/+1
| | | | | | | This fixes PR19421. Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> llvm-svn: 206156
* Introduce PollyIRBuilderTobias Grosser2014-03-041-7/+7
| | | | | | | | 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
* Update for llvm api change.Rafael Espindola2014-02-251-3/+4
| | | | llvm-svn: 202183
* GMP is only required for CLooGSebastian Pop2014-02-221-0/+21
| | | | llvm-svn: 201925
* CodeGeneration: Replace reference to isl_int with explicit mpz call.Tobias Grosser2014-01-191-1/+1
| | | | | | | 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
* Adapt to DomTree changes in r199104Tobias Grosser2014-01-131-5/+5
| | | | llvm-svn: 199157
* clang-format: No empty line after 'public:'Tobias Grosser2013-10-151-1/+0
| | | | llvm-svn: 192710
* [CodeGen] Fixup assert fails caused by incorrect LoopInfo updateTobias Grosser2013-09-021-3/+1
| | | | | Contributed-by: Star Tan <tanmx_star@yeah.net> llvm-svn: 189764
* CodeGeneration: Fix double free in vector forTobias Grosser2013-07-291-6/+9
| | | | | | | | | | 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
* Integrate latest clang-format changesTobias Grosser2013-06-231-1/+2
| | | | llvm-svn: 184655
* Update LoopInfo correctlyTobias Grosser2013-05-161-2/+7
| | | | | | | | | | 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
* LoopGenerators: Construct loops such that they are already loop rotatedTobias Grosser2013-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move polly options into separate option categoryTobias Grosser2013-05-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reformat with clang-formatTobias Grosser2013-05-071-26/+31
| | | | | | | clang-format become way more stable. This time we mainly reformat function signatures. llvm-svn: 181294
* Support SCoPs with multiple entry edges.Tobias Grosser2013-04-161-9/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Update formatting to latest version of clang-formatTobias Grosser2013-04-101-11/+13
| | | | llvm-svn: 179160
* Support SCoPs with multiple exit edgesTobias Grosser2013-04-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | 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
* clang-format: Many more filesTobias Grosser2013-03-231-11/+7
| | | | | | | | | | | | | 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
* Remove dependence on canonical induction variableTobias Grosser2013-03-201-0/+1
| | | | | | | | 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
* use the canonical IV only when it existsSebastian Pop2013-03-181-8/+10
| | | | llvm-svn: 177306
* CodeGen: clang-formatTobias Grosser2013-02-221-12/+12
| | | | llvm-svn: 175872
* add LoopToScev mapsSebastian Pop2013-02-151-8/+31
| | | | llvm-svn: 175295
* CodeGen: clang-format goodnessTobias Grosser2013-02-051-113/+106
| | | | | | The changed files are not yet clang-format clean, but we are getting close. llvm-svn: 174403
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-2/+2
| | | | | | reflect the migration in r171366. llvm-svn: 171370
* Formatting: Break lines after binary operators such as '&&'Tobias Grosser2012-12-291-7/+7
| | | | | | | | | | | | | | assert(Condition && "Text"); -> assert(Condition && "Text); This aligns Polly with the style used in LLVM. llvm-svn: 171242
* Fix obvious formatting problems.Tobias Grosser2012-12-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | 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
* return -1 when polly::getNumberOfIterations returns -1Sebastian Pop2012-12-181-1/+4
| | | | llvm-svn: 170422
* isl: vector code generation based on ISL astSebastian Pop2012-12-181-39/+3
| | | | | | Original patch by Tobias Grosser, slightly modified by Sebastian Pop. llvm-svn: 170420
* change interface for isStrideSebastian Pop2012-12-181-1/+16
| | | | | | | | isStride now takes a partial schedule as input. Patch from Tobias Grosser <tobias@grosser.es>. llvm-svn: 170419
* Remove unneeded preservation and restore of ValueMap and ClastVars in GPGPU codeTobias Grosser2012-11-301-8/+1
| | | | | | | | | | | | | 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
* Add an additional input argument according to chanages of function ↵Tobias Grosser2012-11-301-1/+2
| | | | | | | polly::createLoop. Contributed-by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 168964
* remove unused flagSebastian Pop2012-11-261-7/+0
| | | | llvm-svn: 168620
* Make polly -Wdocumentation cleanTobias Grosser2012-11-191-1/+1
| | | | llvm-svn: 168311
* Revert multiple adress space changes in PollyTobias Grosser2012-11-011-2/+1
| | | | llvm-svn: 167234
* Codegen: Selectively copy in array addresses for OpenMP codeTobias Grosser2012-11-011-10/+0
| | | | | | | | | | | | | | | | | 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
* CodeGen: Add scop-parameters to the OpenMP contextTobias Grosser2012-11-011-3/+52
| | | | | | | | | | | | | 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
* Codegen: Copy and restore the ValueMap and ClastVars explicitlyTobias Grosser2012-11-011-33/+24
| | | | | | | | | | | | When generating OpenMP or GPGPU code the original ValueMap and ClastVars must be kept. We already recovered the original ClastVars by reverting the changes, but we did not keep the content of the ValueMap. This patch keeps now an explicit copy of both maps and restores them after generating OpenMP or GPGPU code. This is an adapted version of a patch contributed by: Armin Groesslinger <armin.groesslinger@uni-passau.de> llvm-svn: 167213
* Try to revive the Polly builders after this LLVM API change.Chandler Carruth2012-10-251-1/+2
| | | | llvm-svn: 166666
* isl-codegen: Support '<' and '>'Tobias Grosser2012-10-161-1/+2
| | | | | | | | Previously isl always generated '<=' or '>='. However, in many cases '<' or '>' leads to simpler code. This commit updates isl and adds the relevant code generation support to Polly. llvm-svn: 166020
* Move TargetData to DataLayout to fix build breakage caused by LLVM r16540Micah Villmow2012-10-081-3/+3
| | | | llvm-svn: 165408
* Rename TargetData -> DataLayoutTobias Grosser2012-10-081-1/+1
| | | | | | Contributed by: Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> llvm-svn: 165387
* Add preliminary implementation for GPGPU code generation.Tobias Grosser2012-08-031-0/+204
| | | | | | | | | | | | | | | | | | | | | | Translate the selected parallel loop body into a ptx string and run it with the cuda driver API. We limit this preliminary implementation to target the following special test cases: - Support only 2-dimensional parallel loops with or without only one innermost non-parallel loop. - Support write memory access to only one array in a SCoP. The patch was committed with smaller changes to the build system: There is now a flag to enable gpu code generation explictly. This was required as we need the llvm.codegen() patch applied on the llvm sources, to compile this feature correctly. Also, enabling gpu code generation does not require cuda. This requirement was removed to allow 'make polly-test' runs, even without an installed cuda runtime. Contributed by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 161239
* Revert "Add preliminary implementation for GPGPU code generation."Tobias Grosser2012-07-131-196/+0
| | | | | | | | | | | | I did not take into account, that this patch fails to compile without the llvm.codegen patch applied. This breaks buildbots. I revert this until we found a solution to commit this without buildbots complaining. This reverts commit cb43ab80e94434e780a66be3b9a6ad466822fe33. llvm-svn: 160165
* Add preliminary implementation for GPGPU code generation.Tobias Grosser2012-07-131-0/+196
| | | | | | | | | | | | | Translate the selected parallel loop body into a ptx string and run it with cuda driver API. We limit this preliminary implementation to target the following special test cases: - Support only 2-dimensional parallel loops with or without only one innermost non-parallel loop. - Support write memory access to only one array in a SCoP. Contributed by: Yabin Hu <yabin.hwu@gmail.com> llvm-svn: 160164
* Move executeScopConditionally() into its own fileTobias Grosser2012-05-291-137/+11
| | | | | | We will reuse this function for the isl code generator. llvm-svn: 157605
* Move CLooG.h into include/polly/CodeGen/Tobias Grosser2012-05-291-1/+1
| | | | llvm-svn: 157604
* Move isParallelFor into CodeGenerationTobias Grosser2012-05-221-1/+21
| | | | | | This removes another include of CLooG header files. llvm-svn: 157242
* add some more missing ifdef CLOOG_FOUNDSebastian Pop2012-05-071-2/+5
| | | | llvm-svn: 156306
OpenPOWER on IntegriCloud