@@ -8,7 +8,7 @@ Using -opt-bisect-limit to debug optimization errors
88Introduction
99============
1010
11- The -opt-bisect-limit option provides a way to disable all optimization passes
11+ The `` -opt-bisect-limit `` option provides a way to disable all optimization passes
1212above a specified limit without modifying the way in which the Pass Managers
1313are populated. The intention of this option is to assist in tracking down
1414problems where incorrect transformations during optimization result in incorrect
@@ -19,10 +19,10 @@ skipped while still allowing correct code generation call a function to
1919check the opt-bisect limit before performing optimizations. Passes which
2020either must be run or do not modify the IR do not perform this check and are
2121therefore never skipped. Generally, this means analysis passes, passes
22- that are run at CodeGenOptLevel::None and passes which are required for register
22+ that are run at `` CodeGenOptLevel::None `` and passes which are required for register
2323allocation.
2424
25- The -opt-bisect-limit option can be used with any tool, including front ends
25+ The `` -opt-bisect-limit `` option can be used with any tool, including front ends
2626such as clang, that uses the core LLVM library for optimization and code
2727generation. The exact syntax for invoking the option is discussed below.
2828
@@ -36,7 +36,7 @@ transformations that is difficult to replicate with tools like opt and llc.
3636Getting Started
3737===============
3838
39- The -opt-bisect-limit command line option can be passed directly to tools such
39+ The `` -opt-bisect-limit `` command- line option can be passed directly to tools such
4040as opt, llc and lli. The syntax is as follows:
4141
4242::
@@ -49,17 +49,17 @@ indicating the index value that is associated with that optimization. To skip
4949optimizations, pass the value of the last optimization to be performed as the
5050opt-bisect-limit. All optimizations with a higher index value will be skipped.
5151
52- In order to use the -opt-bisect-limit option with a driver that provides a
52+ In order to use the `` -opt-bisect-limit `` option with a driver that provides a
5353wrapper around the LLVM core library, an additional prefix option may be
5454required, as defined by the driver. For example, to use this option with
55- clang, the " -mllvm" prefix must be used. A typical clang invocation would look
55+ clang, the `` -mllvm `` prefix must be used. A typical clang invocation would look
5656like this:
5757
5858::
5959
6060 clang -O2 -mllvm -opt-bisect-limit=256 my_file.c
6161
62- The -opt-bisect-limit option may also be applied to link-time optimizations by
62+ The `` -opt-bisect-limit `` option may also be applied to link-time optimizations by
6363using a prefix to indicate that this is a plug-in option for the linker. The
6464following syntax will set a bisect limit for LTO transformations:
6565
@@ -72,11 +72,11 @@ following syntax will set a bisect limit for LTO transformations:
7272
7373LTO passes are run by a library instance invoked by the linker. Therefore any
7474passes run in the primary driver compilation phase are not affected by options
75- passed via ' -Wl,-plugin-opt' and LTO passes are not affected by options
76- passed to the driver-invoked LLVM invocation via ' -mllvm' .
75+ passed via `` -Wl,-plugin-opt `` and LTO passes are not affected by options
76+ passed to the driver-invoked LLVM invocation via `` -mllvm `` .
7777
7878Passing ``-opt-bisect-print-ir-path=path/foo.ll `` will dump the IR to
79- ``path/foo.ll `` when -opt-bisect-limit starts skipping passes.
79+ ``path/foo.ll `` when `` -opt-bisect-limit `` starts skipping passes.
8080
8181Bisection Index Values
8282======================
@@ -85,7 +85,7 @@ The granularity of the optimizations associated with a single index value is
8585variable. Depending on how the optimization pass has been instrumented the
8686value may be associated with as much as all transformations that would have
8787been performed by an optimization pass on an IR unit for which it is invoked
88- (for instance, during a single call of runOnFunction for a FunctionPass) or as
88+ (for instance, during a single call of `` runOnFunction `` for a `` FunctionPass `` ) or as
8989little as a single transformation. The index values may also be nested so that
9090if an invocation of the pass is not skipped individual transformations within
9191that invocation may still be skipped.
@@ -99,7 +99,7 @@ is not a problem.
9999When an opt-bisect index value refers to an entire invocation of the run
100100function for a pass, the pass will query whether or not it should be skipped
101101each time it is invoked and each invocation will be assigned a unique value.
102- For example, if a FunctionPass is used with a module containing three functions
102+ For example, if a `` FunctionPass `` is used with a module containing three functions
103103a different index value will be assigned to the pass for each of the functions
104104as the pass is run. The pass may be run on two functions but skipped for the
105105third.
@@ -144,13 +144,13 @@ Example Usage
144144 Pass Skipping Implementation
145145============================
146146
147- The -opt-bisect-limit implementation depends on individual passes opting in to
148- the opt-bisect process. The OptBisect object that manages the process is
147+ The `` -opt-bisect-limit `` implementation depends on individual passes opting in to
148+ the opt-bisect process. The `` OptBisect `` object that manages the process is
149149entirely passive and has no knowledge of how any pass is implemented. When a
150- pass is run if the pass may be skipped, it should call the OptBisect object to
150+ pass is run if the pass may be skipped, it should call the `` OptBisect `` object to
151151see if it should be skipped.
152152
153- The OptBisect object is intended to be accessed through LLVMContext and each
153+ The `` OptBisect `` object is intended to be accessed through `` LLVMContext `` and each
154154Pass base class contains a helper function that abstracts the details in order
155155to make this check uniform across all passes. These helper functions are:
156156
@@ -160,7 +160,7 @@ to make this check uniform across all passes. These helper functions are:
160160 bool FunctionPass::skipFunction(const Function &F);
161161 bool LoopPass::skipLoop(const Loop *L);
162162
163- A MachineFunctionPass should use FunctionPass::skipFunction() as such:
163+ A `` MachineFunctionPass `` should use `` FunctionPass::skipFunction() `` as such:
164164
165165.. code-block :: c++
166166
@@ -170,11 +170,11 @@ A MachineFunctionPass should use FunctionPass::skipFunction() as such:
170170 // Otherwise, run the pass normally.
171171 }
172172
173- In addition to checking with the OptBisect class to see if the pass should be
174- skipped, the skipFunction(), skipLoop() and skipBasicBlock() helper functions
175- also look for the presence of the " optnone" function attribute. The calling
173+ In addition to checking with the `` OptBisect `` class to see if the pass should be
174+ skipped, the `` skipFunction() ``, `` skipLoop() `` and `` skipBasicBlock() `` helper functions
175+ also look for the presence of the `` optnone `` function attribute. The calling
176176pass will be unable to determine whether it is being skipped because the
177- " optnone" attribute is present or because the opt-bisect-limit has been
177+ `` optnone `` attribute is present or because the `` opt-bisect-limit `` has been
178178reached. This is desirable because the behavior should be the same in either
179179case.
180180
0 commit comments