build: switch release build to -O3 74/32174/1
authorDamjan Marion <damarion@cisco.com>
Fri, 30 Apr 2021 09:11:08 +0000 (11:11 +0200)
committerDamjan Marion <damarion@cisco.com>
Fri, 30 Apr 2021 09:15:47 +0000 (11:15 +0200)
Type: make
Change-Id: Ia39c2f847e7b4907fdd3fcac75897b8b4c545a65
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/CMakeLists.txt
src/vlib/node.h
src/vnet/interface.h
src/vppinfra/cpu.h

index eb59878..7dfd76a 100644 (file)
@@ -76,7 +76,7 @@ endif()
 # release
 list(APPEND BUILD_TYPES "release")
 string(CONCAT CMAKE_C_FLAGS_RELEASE
-  "-O2 "
+  "-O3 "
   "-fstack-protector "
   "-D_FORTIFY_SOURCE=2 "
   "-fno-common "
index 7194ae8..fd792dc 100644 (file)
@@ -216,7 +216,7 @@ static __clib_unused vlib_node_registration_t __clib_unused_##x
     r->next_registration = node.node_fn_registrations;                        \
     node.node_fn_registrations = r;                                           \
   }                                                                           \
-  uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (node##_fn)
+  uword CLIB_MARCH_SFX (node##_fn)
 
 unformat_function_t unformat_vlib_node_variant;
 
index 9d2f2a1..70f51cd 100644 (file)
@@ -330,7 +330,7 @@ static __clib_unused vnet_device_class_t __clib_unused_##x
     r->next_registration = devclass.tx_fn_registrations;                      \
     devclass.tx_fn_registrations = r;                                         \
   }                                                                           \
-  uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (devclass##_tx_fn)
+  uword CLIB_MARCH_SFX (devclass##_tx_fn)
 
 /**
  * Link Type: A description of the protocol of packets on the link.
index 8d2465b..40857fb 100644 (file)
@@ -45,12 +45,6 @@ typedef enum
     CLIB_MARCH_TYPE_N_VARIANTS
 } clib_march_variant_type_t;
 
-#if __GNUC__ > 4  && !__clang__ && CLIB_DEBUG == 0
-#define CLIB_CPU_OPTIMIZED __attribute__ ((optimize ("O3")))
-#else
-#define CLIB_CPU_OPTIMIZED
-#endif
-
 #ifdef CLIB_MARCH_VARIANT
 #define __CLIB_MULTIARCH_FN(a,b) a##_##b
 #define _CLIB_MULTIARCH_FN(a,b) __CLIB_MULTIARCH_FN(a,b)
@@ -403,19 +397,18 @@ CLIB_MARCH_SFX(fn ## _march_constructor) (void)                           \
 }                                                                      \
 
 #ifndef CLIB_MARCH_VARIANT
-#define CLIB_MARCH_FN(fn, rtype, _args...)                             \
-  static rtype CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (fn ## _ma)(_args);   \
-  rtype (*fn ## _selected) (_args) = & CLIB_MARCH_SFX (fn ## _ma);     \
-  int fn ## _selected_priority = 0;                                    \
-  static inline rtype CLIB_CPU_OPTIMIZED                               \
-  CLIB_MARCH_SFX (fn ## _ma)(_args)
+#define CLIB_MARCH_FN(fn, rtype, _args...)                                    \
+  static rtype CLIB_MARCH_SFX (fn##_ma) (_args);                              \
+  rtype (*fn##_selected) (_args) = &CLIB_MARCH_SFX (fn##_ma);                 \
+  int fn##_selected_priority = 0;                                             \
+  static inline rtype CLIB_MARCH_SFX (fn##_ma) (_args)
 #else
-#define CLIB_MARCH_FN(fn, rtype, _args...)                             \
-  static rtype CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (fn ## _ma)(_args);   \
-  extern rtype (*fn ## _selected) (_args);                             \
-  extern int fn ## _selected_priority;                                 \
-  CLIB_MARCH_FN_CONSTRUCTOR (fn)                                       \
-  static rtype CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (fn ## _ma)(_args)
+#define CLIB_MARCH_FN(fn, rtype, _args...)                                    \
+  static rtype CLIB_MARCH_SFX (fn##_ma) (_args);                              \
+  extern rtype (*fn##_selected) (_args);                                      \
+  extern int fn##_selected_priority;                                          \
+  CLIB_MARCH_FN_CONSTRUCTOR (fn)                                              \
+  static rtype CLIB_MARCH_SFX (fn##_ma) (_args)
 #endif
 
 #define CLIB_MARCH_FN_SELECT(fn) (* fn ## _selected)