aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm-project@meinersbur.de>2020-11-09 14:13:17 -0600
committerMichael Kruse <llvm-project@meinersbur.de>2020-11-09 15:03:32 -0600
commitf44ee0f5e7d1fe5197aaee360a701df917cc31c7 (patch)
tree6c900c2643883e2dfbb3cfe8bee1e3d16d447443 /clang/lib/Frontend/CompilerInvocation.cpp
parent9d02e0e38df50c1d15156580e5372876f7423179 (diff)
downloadllvm-f44ee0f5e7d1fe5197aaee360a701df917cc31c7.zip
llvm-f44ee0f5e7d1fe5197aaee360a701df917cc31c7.tar.gz
llvm-f44ee0f5e7d1fe5197aaee360a701df917cc31c7.tar.bz2
[OpenMPIRBuilder] Implement CreateCanonicalLoop.
CreateCanonicalLoop generates a standardized control flow structure for OpenMP canonical for loops. The structure can be consumed by loop-associated directives such as worksharing-loop, distribute, simd etc. as well as loop transformations such as tile and unroll. This is a first design without considering all complexities yet. The control-flow emits more basic block than strictly necessary, but these will be optimized by CFGSimplify anyway, provide a nice separation of concerns and might later be useful with more complex scenarios. I successfully implemented a basic tile construct using this API, which is not part of this patch. The fundamental building block is the CreateCanonicalLoop that only takes the loop trip count and operates on the logical iteration spaces only. An overloaded CreateCanonicalLoop for using LB, UB, Increment is provided as well, but at least for C++, Clang will need to implement a loop counter to logical induction variable mapping anyway, since iterator overload resolution cannot be done in LLVMFrontend. As there currently is no user for CreateCanonicalLoop, it is only called from unittests. Similarly, CanonicalLoopInfo::eraseFromParent() is used in my file implementation and might be generally useful for implementing loop-associated constructs, but is not used in this patch itself. The following non-exhaustive list describes not yet covered items: * collapse clause (including non-rectangular and non-perfectly nested); idea is to provide a OpenMPIRBuilder::collapseLoopNest method consuming multiple nested loops and returning a new CanonicalLoopInfo that can be used for loop-associated directives. * simarly: ordered clause for DOACROSS loops * branch weights * Cancellation point (?) * AllocaIP * break statement (if needed at all) * Exceptions (if not completely handled in the front-end) * Using it in Clang; this requires implementing at least one loop-associated construct. * ... Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D90830
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions