summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGLoopInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".Mark Heffernan2015-08-101-12/+26
| | | | | | | | | | | | | | | | | | | | | | This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs the optimizer to unroll a loop fully if the trip count is known at compile time, and unroll partially if the trip count is not known at compile time. This differs from "llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not known at compile time With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than "llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all". The motivating example for this change was some internal code with a loop marked with "#pragma unroll" which only sometimes had a compile-time trip count depending on template magic. When the trip count was a compile-time constant, everything works as expected and the loop is fully unrolled. However, when the trip count was not a compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!). Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable from a performance perspective. llvm-svn: 244467
* Use CGLoopInfo to emit metadata for loop hint pragmas.Tyler Nowicki2015-07-271-16/+113
| | | | | | | | When ‘#pragma clang loop vectorize(assume_safety)’ was specified on a loop other loop hints were lost. The problem is that CGLoopInfo attaches metadata differently than EmitCondBrHints in CGStmt. For do-loops CGLoopInfo attaches metadata to the br in the body block and for while and for loops, the inc block. EmitCondBrHints on the other hand always attaches data to the br in the cond block. When specifying assume_safety CGLoopInfo emits an empty llvm.loop metadata shadowing the metadata in the cond block. Loop transformations like rotate and unswitch would then eliminate the cond block and its non-empty metadata. This patch unifies both approaches for adding metadata and modifies the existing safety tests to include non-assume_safety loop hints. llvm-svn: 243315
* Make the variable names match the name of the metadata they control.Tyler Nowicki2015-07-141-21/+20
| | | | | | Rename Vectorizer to Vectorize and VectorizeUnroll to InterleaveCount. llvm-svn: 242241
* [IRGen] Fix the MSVC2013 buildDavid Majnemer2015-06-121-1/+2
| | | | llvm-svn: 239576
* Add assume_safety option for pragma loop vectorize and interleave.Tyler Nowicki2015-06-111-1/+29
| | | | | | | | Specifying #pragma clang loop vectorize(assume_safety) on a loop adds the mem.parallel_loop_access metadata to each load/store operation in the loop. This metadata tells loop access analysis (LAA) to skip memory dependency checking. llvm-svn: 239572
* Eliminate unnecessary namespace to prevent conflicts.Tyler Nowicki2015-06-081-2/+1
| | | | llvm-svn: 239365
* CodeGen: Update LoopAttributes for LLVM API changeDuncan P. N. Exon Smith2015-01-191-3/+2
| | | | | | `MDNode::getTemporary()` returns a `unique_ptr<>` as of r226504. llvm-svn: 226505
* IR: Update clang for Metadata/Value split in r223802Duncan P. N. Exon Smith2014-12-091-14/+13
| | | | | | Match LLVM API changes from r223802. llvm-svn: 223803
* Rename metadata llvm.loop.vectorize.unroll to llvm.loop.vectorize.interleave.Mark Heffernan2014-07-211-1/+1
| | | | llvm-svn: 213587
* Rename loop unrolling and loop vectorizer metadata to have a common prefix.Eli Bendersky2014-06-251-3/+3
| | | | | | | | | | | | | | | | | | | [Clang part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. llvm-svn: 211712
* This patch adds a helper class (CGLoopInfo) for marking memory instructions ↵Alexander Musman2014-05-221-0/+112
with llvm.mem.parallel_loop_access metadata. It also adds a simple initial version of codegen for pragma omp simd (it will change in the future to support all the clauses). Differential revision: http://reviews.llvm.org/D3644 llvm-svn: 209411
OpenPOWER on IntegriCloud