[PATCH] Add VTune as an optional external dependency and add task tracking.

Shankar Kalpathi Easwaran shankarke at gmail.com
Fri Apr 5 15:31:55 PDT 2013


  I believe ScopedTask is being used to measure hotspots within those areas of code ?

  a) Why are ScopedTask present only in few places, arent they supposed to be placed everywhere in lld code ?


================
Comment at: cmake/modules/FindVTune.cmake:7-12
@@ +6,8 @@
+
+set(dirs
+  "$ENV{VTUNE_AMPLIFIER_XE_2013_DIR}/"
+  "C:/Program Files (x86)/Intel/VTune Amplifier XE 2013/"
+  "$ENV{VTUNE_AMPLIFIER_XE_2011_DIR}/"
+  "C:/Program Files (x86)/Intel/VTune Amplifier XE 2011/"
+  )
+
----------------
Should this be under MSVC, because the paths are ms-windows paths ?

================
Comment at: include/lld/Core/Instrumentation.h:38-61
@@ +37,26 @@
+
+class StringHandle {
+  __itt_string_handle *_handle;
+
+public:
+  StringHandle(const char *name) : _handle(__itt_string_handle_createA(name)) {}
+
+  operator __itt_string_handle *() const { return _handle; }
+};
+
+class ScopedTask {
+  __itt_domain *_domain;
+
+public:
+  ScopedTask(const Domain &d, const StringHandle &s) : _domain(d) {
+    __itt_task_begin(d, __itt_null, __itt_null, s);
+  }
+
+  void end() {
+    if (_domain)
+      __itt_task_end(_domain);
+    _domain = nullptr;
+  }
+
+  ~ScopedTask() { end(); }
+};
----------------
Can you document these classes and their purposes ?

================
Comment at: lib/Passes/LayoutPass.cpp:16-17
@@ -15,2 +15,4 @@
 
+#include "lld/Core/Instrumentation.h"
+
 #include "llvm/Support/Debug.h"
----------------
not in sorted order, should be before line 13.

================
Comment at: lib/Passes/LayoutPass.cpp:11
@@ -10,3 +10,3 @@
 
 #define DEBUG_TYPE "LayoutPass"
 
----------------
Where is this used ?

================
Comment at: include/lld/Core/Instrumentation.h:15-16
@@ +14,4 @@
+
+#ifndef LLD_CORE_TASK_TRACKING_H
+#define LLD_CORE_TASK_TRACKING_H
+
----------------
Should this be named LLD_CORE_INSTRUMENTATION_H ?


http://llvm-reviews.chandlerc.com/D634



More information about the llvm-commits mailing list