[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 09:14:47 PST 2019


ABataev added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:1643
   HelpText<"Emit OpenMP code only for SIMD-based constructs.">;
+def fopenmp_new_codegen : Flag<["-"], "fopenmp-new-codegen">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>,
+  HelpText<"Use the experimental OpenMP-IR-Builder codegen path.">;
----------------
Maybe just `-fopenmp-experimental`?


================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:25
+/// Each OpenMP directive has a corresponding public generator method.
+struct OpenMPIRBuilder {
+
----------------
class?


================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:29
+  /// not have an effect on \p M (see initialize).
+  OpenMPIRBuilder(Module &M) : M(M), Builder(M.getContext()) {}
+
----------------
Do we need a new `Builder` here or we can reuse the one from clang CodeGenFunction?


================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:52
+  ///                        should be checked and acted upon.
+  void createOMPBarrier(const LocationDescription &Loc, omp::Directive DK,
+                        bool CheckCancelFlag = true);
----------------
Do you really need to spell it as `createOMPBarrier`? Maybe, just `createBarrier` since it is already a member of OMPBuilder.


================
Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:62
+  /// Return the (LLVM-IR) string describing the source location \p LocStr.
+  Constant *getOrCreateSrcLocStr(std::string LocStr);
+
----------------
StringRef?


================
Comment at: llvm/lib/IR/OpenMPIRBuilder.cpp:178
+
+    auto FnDecl = getOrCreateRuntimeFunction(OMPRTL___kmpc_global_thread_num);
+    Instruction *Call =
----------------
`Function *` instead of `auto`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69785/new/

https://reviews.llvm.org/D69785





More information about the cfe-commits mailing list