Remove FAQ about increasing inlining threshold for Clang.

- Changing the inlining threshold for Clang as described has a minimal
  effect on user performance.
- The problem that originally prompted the belief that it did was
  due to an erroneous CXX flag configuration (in user code).

Change-Id: I03017241c0f87b8dcefb8c984ec3b192afd97fc2
This commit is contained in:
Alex Stewart
2015-09-16 20:01:11 +01:00
parent f4b768b69a
commit 0c4647b8f1
-38
View File
@@ -33,44 +33,6 @@ Building
NDK. It has worse performance than the full fledged glog library NDK. It has worse performance than the full fledged glog library
and is much harder to control and use. and is much harder to control and use.
#. Increase the inlining threshold in Clang for Eigen.
By default, the inlining threshold (evaluated on a heuristic used by LLVM to
guess how expensive a function will be to inline) can hobble Eigen, resulting in
poor performance.
Ceres itself will always be compiled with an increased inline threshold
(currently 600) when compiled with Clang. To experiment with this in your
own code, you can use the following:
.. code-block:: cmake
# If using CMake >= 2.8.12:
# We recommend you use target_compile_options() to add the inlining flags
# to specific targets for fine grained control:
#
# Use a larger inlining threshold for Clang, since it can hobble Eigen,
# resulting in reduced performance. The -Qunused-arguments is needed because
# CMake passes the inline threshold to the linker and clang complains about
# it (and dies, if compiling with -Werror).
target_compile_options(<YOUR_TARGET_NAME> PUBLIC
$<$<CXX_COMPILER_ID:Clang>:-Qunused-arguments -mllvm -inline-threshold=600>)
.. code-block:: cmake
# If using CMake < 2.8.12:
# On CMake < 2.8.12 target_compile_options() is not available, so you
# cannot add the flags only on a per-target level and must instead set them
# for all targets declared after the flags are updated:
#
# Use a larger inlining threshold for Clang, since it can hobble Eigen,
# resulting in reduced performance. The -Qunused-arguments is needed because
# CMake passes the inline threshold to the linker and clang complains about
# it (and dies, if compiling with -Werror).
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Qunused-arguments -mllvm -inline-threshold=600")
endif()
Modeling Modeling
======== ========