[PATCH] [OPENMP] Initial codegen for 'parallel for' directive.

John McCall rjmccall at gmail.com
Mon Mar 30 22:06:35 PDT 2015


================
Comment at: lib/CodeGen/CGOpenMPRuntime.h:51
@@ +50,3 @@
+  /// \brief Iterator range for  codegen kinds for combined directives.
+  class CombinedCodeGenKind {
+    combined_iterator begin_iterator, end_iterator;
----------------
This isn't really a Kind, and the name makes it really confusing.  It's not a "range" either in the usual C++ sense of a pair of iterators.  It's really a generator, although that name is also misleading in the broader context of IRGen.

I think this is probably just not the right abstraction.  Would it make more sense for the emission of the combining directives to take a lambda (probably as an llvm::FunctionRef) that fills in the outlined function body?  "parallel" would just pass a lambda that just emits the captured statement, while "parallel for" would pass a lambda that builds a "for" around the captured statement.  As it is, there is a lot of hard-to-follow recursion here.

http://reviews.llvm.org/D8631

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list