summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/ManagedMemoryRewrite.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [GPGPU] Fix #includes.Michael Kruse2019-11-141-0/+1
| | | | | | Adapt for 05da2fe52162 "Sink all InitializePasses.h includes" which forgot the GPGPU files (presumably because POLLY_ENABLE_GPGPU_CODEGEN is OFF by default).
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-281-21/+4
| | | | | | | | | | | | This removes unused includes (and forward declarations) as suggested by include-what-you-use. If a transitive include of a removed include is required to compile a file, I added the required header (or forward declaration if suggested by include-what-you-use). This should reduce compilation time and reduce the number of iterative recompilations when a header was changed. llvm-svn: 357209
* [opaque pointer types] Update calls to CreateCall to pass the functionJames Y Knight2019-02-081-2/+3
| | | | | | type in lldb and polly. llvm-svn: 353549
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [polly] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-151-14/+15
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44978 llvm-svn: 332352
* Adjust to clang-format changesTobias Grosser2018-03-201-1/+0
| | | | llvm-svn: 328005
* [ManagedMemoryRewrite] Use `unit64_t` to store size, not `int`.Siddharth Bhat2017-08-221-1/+2
| | | | llvm-svn: 311440
* [ManagedMemoryRewrite] Get size in bytes rather than in bits and dividing by 8.Siddharth Bhat2017-08-221-1/+1
| | | | llvm-svn: 311439
* [ManagedMemoryRewrite] slightly tweak debug output style. [NFC]Siddharth Bhat2017-08-211-10/+10
| | | | llvm-svn: 311361
* [ManagedMemoryRewrite] Print reasons for skipping global array to dbgs(). [NFC]Siddharth Bhat2017-08-211-2/+12
| | | | llvm-svn: 311360
* [ManagedMemoryRewrite] hide debug output behing DEBUG(...). [NFC]Siddharth Bhat2017-08-211-1/+1
| | | | llvm-svn: 311331
* [ManagedMemoryRewrite] Make pass more robust and fix memory issueTobias Grosser2017-08-191-2/+4
| | | | | | | | Instead of using Twines and temporary expressions, we do string manipulation through a std::string. This resolves a memory corruption issue, which likely was caused by twines loosing their underlying string too soon. llvm-svn: 311264
* [ManagedMemoryRewrite] Iterate over operands of the expanded instruction, ↵Siddharth Bhat2017-08-191-6/+11
| | | | | | | | | | | | | not the constantexpr itself. - We should iterate over `I`, which is `Cur` expanded out to an instruction, and not `Cur` itself. - This is a bugfix. Differential Revision: https://reviews.llvm.org/D36923 llvm-svn: 311261
* [ManagedMemoryRewrite] Rewrite malloc, free correctly inside `Constant`s.Siddharth Bhat2017-08-171-2/+33
| | | | | | | | | | | | | | | | | Reuse the machinery built for replacing global arrays to replace malloc/free as well. Example replacement that was missed earlier: ``` call void \ bitcast (void (i8*)* @free to void (%custom_type*)*) (%custom_type* %13) ``` - Since the `bitcast` is a `ConstantExpr`, `replaceAllUsesWith` would miss this. We don't miss this anymore. Differential Revision: https://reviews.llvm.org/D36825 llvm-svn: 311121
* [ManagedMemoryRewrite] Learn how to rewrite global arrays, allocas.Siddharth Bhat2017-08-171-16/+263
| | | | | | | | | | | | | | | - If we have global arrays, we would like to rewrite them to global pointers which are allocated using `cudaMallocManaged`. - If we have allocas in a function, we would like to rewrite them to heap-allocations with `cudaMallocManaged` and `cudaFree`. - With these rewrite mechanisms, we can offload _any_ function to the GPU with no code rewrite whatsover. Differential Revision: https://reviews.llvm.org/D36516 llvm-svn: 311080
* [ManagedMemoryRewrite] [Polly] Erase original malloc and free. [NFC]Siddharth Bhat2017-08-091-0/+2
| | | | | | | We do not need to keep `malloc` and `free` around since they are replaced by `polly_{malloc,free}Managed.` llvm-svn: 310504
* [ManagedMemoryRewrite] Introduce a new pass to rewrite modules to use ↵Siddharth Bhat2017-08-091-0/+144
managed memory. This pass is useful to automatically convert a codebase that uses malloc/free to use their managed memory counterparts. Currently, rewrite malloc and free to the `polly_{malloc,free}Managed` variants. A future patch will teach ManagedMemoryRewrite to rewrite global arrays as pointers to globally allocated managed memory. Differential Revision: https://reviews.llvm.org/D36513 llvm-svn: 310471
OpenPOWER on IntegriCloud