[PATCH] D20976: [esan] Initialize runtime during early interceptors

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 11:57:56 PDT 2016


aizatsky added inline comments.

================
Comment at: lib/esan/esan_interceptors.cpp:56
@@ -52,1 +55,3 @@
   do {                                                                         \
+    if (UNLIKELY(EsanDuringInit))                                              \
+      return REAL(func)(__VA_ARGS__);                                          \
----------------
If performance is a concern, I suggest trying to make this look like:

  if (UNLIKELY(flag1)) {
    // 2 branches here
  }

instead of two consequent ones. I am not sure how two UNLIKELY work though.

But this will have only one memory read on the fast path.


http://reviews.llvm.org/D20976





More information about the llvm-commits mailing list