Use SPIRV_PERF=1 when performance tuning.
authorDavid Neto <dneto@google.com>
Thu, 15 Oct 2015 20:43:14 +0000 (16:43 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
It tells the compiler to keep frame pointers, so you have good
call stacks in your profiles.

CMakeLists.txt

index a81e0c0..1f8ef6d 100644 (file)
@@ -52,6 +52,12 @@ endif()
 
 if(UNIX)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-exceptions -fno-rtti")
+
+  # For good call stacks in profiles, keep the frame pointers.
+  if(NOT SPIRV_PERF STREQUAL "")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
+  endif()
+
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
     set(SPIRV_USE_SANITIZER "" CACHE STRING