This patch adds a helper class (CGLoopInfo) for marking memory instructions 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).
Details
- Reviewers
rengolin rjmccall gribozavr • cbergstrom ABataev TylerNowicki hfinkel rsmith doug.gregor - Commits
- rG515ad8c49058: This patch adds a helper class (CGLoopInfo) for marking memory instructions…
rC209411: This patch adds a helper class (CGLoopInfo) for marking memory instructions…
rL209411: This patch adds a helper class (CGLoopInfo) for marking memory instructions…
Diff Detail
Event Timeline
With these changes, LGTM.
lib/CodeGen/CGBuilder.h | ||
---|---|---|
50 | This is now a lot of parameters to be duplicated in both sizes of the NDEBUG conditional. You can, for example, define a boolean that depends on NDEBUG and use that instead. | |
lib/CodeGen/CGLoopInfo.cpp | ||
89 | This assert is not self explanatory. Please write: assert(!Active.empty() && "No active loops to pop"); (or something like that). | |
115 | This is not quite complete. It misses memory intrinsics, for example. The check in LLVM's lib/Analysis/LoopInfo.cpp requires metadata on all instructions for which mayReadOrWriteMemory() returns true. I think this can be: if (L.getAttributes().IsParallel && I->mayReadOrWriteMemory()) I->setMetadata("llvm.mem.parallel_loop_access", L.getLoopID()); | |
lib/CodeGen/CodeGenFunction.cpp | ||
1668 | Same comment here (don't duplicate all of this, just use a boolean or some other mechanism). |
This is now a lot of parameters to be duplicated in both sizes of the NDEBUG conditional. You can, for example, define a boolean that depends on NDEBUG and use that instead.