llvm-project/clang/lib/Parse
Mark Heffernan 397a98d86d Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".
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
2015-08-10 17:29:39 +00:00
..
CMakeLists.txt [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
Makefile
ParseAST.cpp Restore PrettyStackTrace state on crash. 2015-08-07 17:48:57 +00:00
ParseCXXInlineMethods.cpp Rework parsing of pure-specifiers. Perform the grammar matching and 2015-06-30 01:28:56 +00:00
ParseDecl.cpp [MS Compat] Allow _Atomic(Type) and 'struct _Atomic' to coexist 2015-07-22 23:46:18 +00:00
ParseDeclCXX.cpp Outline function Parser::ParseCXXClassMemberDeclarationWithPragmas(), NFC. 2015-07-31 08:42:25 +00:00
ParseExpr.cpp [OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd alignment. 2015-07-02 03:40:19 +00:00
ParseExprCXX.cpp C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
ParseInit.cpp Silence a -Wunused-variable warning; NFC. 2015-07-07 13:21:26 +00:00
ParseObjc.cpp [libclang] Implement proper code-completion in an ObjC type parameter position. 2015-07-07 06:20:36 +00:00
ParseOpenMP.cpp This patch commits OpenMP 4 target device clauses 2015-08-07 16:16:36 +00:00
ParsePragma.cpp Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll". 2015-08-10 17:29:39 +00:00
ParseStmt.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ParseStmtAsm.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ParseTemplate.cpp Parsing, semantic analysis, and AST for Objective-C type parameters. 2015-07-07 03:57:15 +00:00
ParseTentative.cpp Implement the Objective-C __kindof type qualifier. 2015-07-07 03:58:42 +00:00
Parser.cpp Fix sanitizer fallout from r243642 2015-07-30 15:53:58 +00:00
RAIIObjectsForParser.h Add a new error for unexpected semi-colon before closing delimiter. 2015-05-12 21:36:35 +00:00