summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/CodeGeneration.cpp
AgeCommit message (Collapse)Author
2012-11-01Codegen: Copy and restore the ValueMap and ClastVars explicitlyTobias Grosser
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
2012-10-25Try to revive the Polly builders after this LLVM API change.Chandler Carruth
llvm-svn: 166666
2012-10-16isl-codegen: Support '<' and '>'Tobias Grosser
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
2012-10-08Move TargetData to DataLayout to fix build breakage caused by LLVM r16540Micah Villmow
llvm-svn: 165408
2012-10-08Rename TargetData -> DataLayoutTobias Grosser
Contributed by: Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com> llvm-svn: 165387
2012-08-03Add preliminary implementation for GPGPU code generation.Tobias Grosser
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
2012-07-13Revert "Add preliminary implementation for GPGPU code generation."Tobias Grosser
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
2012-07-13Add preliminary implementation for GPGPU code generation.Tobias Grosser
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
2012-05-29Move executeScopConditionally() into its own fileTobias Grosser
We will reuse this function for the isl code generator. llvm-svn: 157605
2012-05-29Move CLooG.h into include/polly/CodeGen/Tobias Grosser
llvm-svn: 157604
2012-05-22Move isParallelFor into CodeGenerationTobias Grosser
This removes another include of CLooG header files. llvm-svn: 157242
2012-05-07add some more missing ifdef CLOOG_FOUNDSebastian Pop
llvm-svn: 156306
2012-05-06Allow polly ask bb-vectorizer to vectorize the loop body.Hongbin Zheng
llvm-svn: 156254
2012-04-25Refactor: Move the code generation related header files to ↵Hongbin Zheng
include/polly/CodeGen. llvm-svn: 155547
2012-04-25Refactor: Move the declaration of the BlockGenerator/VectorBlockGeneratorHongbin Zheng
to standalone header and source files. llvm-svn: 155546
2012-04-23Refactor: Pass the argument 'IRBuilder' and 'AfterBlock' of function ↵Hongbin Zheng
'createLoop' by reference, so that we do not need to type an extra '&' operator when calling the function. llvm-svn: 155349
2012-04-12CodeGen: Generate scalar code if vector instructions cannot be generatedTobias Grosser
This fixes two crashes that appeared in case of: - A load of a non vectorizable type (e.g. float**) - An instruction that is not vectorizable (e.g. call) llvm-svn: 154586
2012-04-07CodeGen: Allow Polly to do 'grouped unrolling', but no vector generation.Tobias Grosser
Grouped unrolling means that we unroll a loop such that the different instances of a certain statement are scheduled right after each other, but we do not generate any vector code. The idea here is that we can schedule the bb vectorizer right afterwards and use it heuristics to decide when vectorization should be performed. llvm-svn: 154251
2012-04-03CodeGen: Remove unused declarationTobias Grosser
llvm-svn: 153954
2012-04-03CodeGen: Recreate old ivs with the original typeTobias Grosser
To avoid overflows we still use a larger type (i64) while calculating the value of the old ivs. However, we truncate the result to the type of the old iv when providing it to the new code. A corresponding test case is added to the polly test suite. Also, a failing test case is fixed. This fixes PR12311. Contributed by: Tsingray Liu <tsingrayliu@gmail.com> llvm-svn: 153952
2012-04-02CodeGen: Some style improvementsTobias Grosser
llvm-svn: 153871
2012-04-01CodeGen: Remove unused variableTobias Grosser
llvm-svn: 153840
2012-04-01CodeGen: Allow function parameters to be rewritten in getNewValue()Tobias Grosser
When deriving new values for the statements of a SCoP, we assumed that parameter values are constant within the SCoP and consquently do not need to be rewritten. For OpenMP code generation this assumption is wrong, as such values are not available in the OpenMP subfunction and consequently also may need to be rewritten. Committed with some changes. Contributed-By: Johannes Doerfert <s9jodoer@stud.uni-saarland.de> llvm-svn: 153838
2012-03-30Move the CodeGeneration.cpp to the CodeGen folder and update the build system.Hongbin Zheng
Patched by Tsingray. llvm-svn: 153736