[PATCH] D25360: [XRay] [NFC] [compiler-rt] Move machine-dependent code into machine-dependent files.

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 18:11:47 PDT 2016


dberris requested changes to this revision.
dberris added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/xray/xray_arm.cc:23
+uint64_t cycleFrequency() {
+  static const uint64_t NanosecondsPerSecond = 1000ULL * 1000 * 1000;
+  // There is no instruction like RDTSCP in user mode on ARM. ARM's CP15 does
----------------
Probably want `constexpr` here.


================
Comment at: lib/xray/xray_inmemory_log.cc:141
+
+[[clang::xray_never_instrument]] // hot path
 void __xray_InMemoryRawLog(int32_t FuncId, XRayEntryType Type) {
----------------
We cannot actually assume that the compiler used to build compiler-rt actually supports this attribute. Let's defer this for later, when we have a check in CMake to figure out whether the compiler we're using supports XRay explicitly, then make this conditional on a macro.


================
Comment at: lib/xray/xray_x86_64.h:6
+
+uint64_t readTSC(uint8_t &CPU) {
+  unsigned LongCPU;
----------------
Consider adding an attribute that forces this to be always inline, if not have a `//TODO:` or `//FIXME:` that indicates so.


https://reviews.llvm.org/D25360





More information about the llvm-commits mailing list