File tree 1 file changed +22
-1
lines changed
1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 2
2
Optimizations
3
3
========================================
4
4
5
- ========================================
5
+
6
+ .. contents :: 目錄
6
7
7
8
8
9
PGO (Profile-Guided Optimizations)
@@ -14,7 +15,27 @@ PGO (Profile-Guided Optimizations)
14
15
- ``-fprofile-generate ``
15
16
- ``-fprofile-use ``
16
17
18
+
19
+
17
20
IPO (Interprocedural Optimization)
18
21
========================================
19
22
20
23
* `Wikipedia - Interprocedural optimization <https://en.wikipedia.org/wiki/Interprocedural_optimization >`_
24
+
25
+
26
+
27
+ Misc
28
+ ========================================
29
+
30
+ * ``-O3 `` 就正常 general 的優化盡量開
31
+ * ``-Ofast `` 除了 ``-O3 `` 的參數外,還會加一些更 aggressive 的參數(通常跟數學運算有關
32
+ * ``-march=native `` 是以目前在編譯的 CPU 為目標對象做優化,可能會利用到一些特定 CPU 才有的指令(例如 SSE、AVX)
33
+ * ``-flto `` 是開 link time 的優化
34
+
35
+
36
+
37
+ 參考
38
+ ========================================
39
+
40
+ * `Gentoo Wiki - GCC Optimization <https://wiki.gentoo.org/wiki/GCC_optimization >`_
41
+ * `Stack Overflow - Clang optimization levels <http://stackoverflow.com/questions/15548023/clang-optimization-levels >`_
You can’t perform that action at this time.
0 commit comments