[Openmp-commits] [PATCH] D134547: [libomptarget] Minor cleanup of time tracing

Mark Dewing via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 23 09:18:13 PDT 2022


markdewing created this revision.
Herald added a project: All.
markdewing requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

Commit 04ae35e592c1e7e99bb3894420b6ff2117ace78a <https://reviews.llvm.org/rG04ae35e592c1e7e99bb3894420b6ff2117ace78a> always enabled time
tracing.  This performs additional code cleanup

Remove the #else clause (which had been part of the include guard as a
result of the previous commit).

Also move the include header to the top of the file.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134547

Files:
  openmp/libomptarget/src/private.h


Index: openmp/libomptarget/src/private.h
===================================================================
--- openmp/libomptarget/src/private.h
+++ openmp/libomptarget/src/private.h
@@ -18,6 +18,8 @@
 #include <SourceInfo.h>
 #include <omptarget.h>
 
+#include "llvm/Support/TimeProfiler.h"
+
 #include <cstdint>
 
 extern int targetDataBegin(ident_t *Loc, DeviceTy &Device, int32_t ArgNum,
@@ -189,7 +191,6 @@
   }
 }
 
-#include "llvm/Support/TimeProfiler.h"
 #define TIMESCOPE() llvm::TimeTraceScope TimeScope(__FUNCTION__)
 #define TIMESCOPE_WITH_IDENT(IDENT)                                            \
   SourceInfo SI(IDENT);                                                        \
@@ -197,9 +198,5 @@
 #define TIMESCOPE_WITH_NAME_AND_IDENT(NAME, IDENT)                             \
   SourceInfo SI(IDENT);                                                        \
   llvm::TimeTraceScope TimeScope(NAME, SI.getProfileLocation())
-#else
-#define TIMESCOPE()
-#define TIMESCOPE_WITH_IDENT(IDENT)
-#define TIMESCOPE_WITH_NAME_AND_IDENT(NAME, IDENT)
 
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134547.462514.patch
Type: text/x-patch
Size: 1070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220923/cb9451e7/attachment.bin>


More information about the Openmp-commits mailing list