You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/src/devdocs/llvm.md
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -82,9 +82,39 @@ Here are example settings using `bash` syntax:
82
82
*`export JULIA_LLVM_ARGS=-debug-only=loop-vectorize` dumps LLVM `DEBUG(...)` diagnostics for
83
83
loop vectorizer. If you get warnings about "Unknown command line argument", rebuild LLVM with
84
84
`LLVM_ASSERTIONS = 1`.
85
-
*`export JULIA_LLVM_ARGS=-help` shows a list of available options.
85
+
*`export JULIA_LLVM_ARGS=-help` shows a list of available options.`export JULIA_LLVM_ARGS=-help-hidden` shows even more.
86
86
*`export JULIA_LLVM_ARGS="-fatal-warnings -print-options"` is an example how to use multiple options.
87
87
88
+
### Useful `JULIA_LLVM_ARGS` parameters
89
+
*`-print-after=PASS`: prints the IR after any execution of `PASS`, useful for checking changes done by a pass.
90
+
*`-print-before=PASS`: prints the IR before any execution of `PASS`, useful for checking the input to a pass.
91
+
*`-print-changed`: prints the IR whenever a pass changes the IR, useful for narrowing down which passes are causing problems.
92
+
*`-print-(before|after)=MARKER-PASS`: the Julia pipeline ships with a number of marker passes in the pipeline, which can be used to identify where problems or optimizations are occurring. A marker pass is defined as a pass which appears once in the pipeline and performs no transformations on the IR, and is only useful for targeting print-before/print-after. Currently, the following marker passes exist in the pipeline:
93
+
* BeforeOptimization
94
+
* BeforeEarlySimplification
95
+
* AfterEarlySimplification
96
+
* BeforeEarlyOptimization
97
+
* AfterEarlyOptimization
98
+
* BeforeLoopOptimization
99
+
* BeforeLICM
100
+
* AfterLICM
101
+
* BeforeLoopSimplification
102
+
* AfterLoopSimplification
103
+
* AfterLoopOptimization
104
+
* BeforeScalarOptimization
105
+
* AfterScalarOptimization
106
+
* BeforeVectorization
107
+
* AfterVectorization
108
+
* BeforeIntrinsicLowering
109
+
* AfterIntrinsicLowering
110
+
* BeforeCleanup
111
+
* AfterCleanup
112
+
* AfterOptimization
113
+
*`-time-passes`: prints the time spent in each pass, useful for identifying which passes are taking a long time.
114
+
*`-print-module-scope`: used in conjunction with `-print-(before|after)`, gets the entire module rather than the IR unit received by the pass
115
+
*`-debug`: prints out a lot of debugging information throughout LLVM
116
+
*`-debug-only=NAME`, prints out debugging statements from files with `DEBUG_TYPE` defined to `NAME`, useful for getting additional context about a problem
117
+
88
118
## Debugging LLVM transformations in isolation
89
119
90
120
On occasion, it can be useful to debug LLVM's transformations in isolation from
0 commit comments