$ lldb mybuilder/bin/clang
Current executable set to 'mybuilder/bin/clang' (x86_64).
(lldb) break main
Breakpoint 1: where = clang`main + 48 at driver.cpp:293, address = 0x000000001000109e0
$ ./opt -help
OVERVIEW: llvm .bc -> .bc modular optimizer and analysis printer
USAGE: opt [options] <input bitcode file>
OPTIONS:
General options:
-O0 - Optimization level 0. Similar to clang -O0
-O1 - Optimization level 1. Similar to clang -O1
-O2 - Optimization level 2. Similar to clang -O2
-O3 - Optimization level 3. Similar to clang -O3
-Os - Like -O2 with extra optimizations for size. Similar to clang -Os
-Oz - Like -Os but reduces code size further. Similar to clang -Oz
-S - Write output as LLVM assembly
-aarch64-neon-syntax - Choose style of NEON code to emit from AArch64 backend:
=generic - Emit generic NEON assembly
=apple - Emit Apple-style NEON assembly
-addrsig - Emit an address-significance table
-amdgpu-dump-hsa-metadata - Dump AMDGPU HSA Metadata
-amdgpu-enable-merge-m0 - Merge and hoist M0 initializations
-amdgpu-sdwa-peephole - Enable SDWA peepholer
-amdgpu-spill-sgpr-to-smem - Use scalar stores to spill SGPRs if supported by subtarget
-amdgpu-verify-hsa-metadata - Verify AMDGPU HSA Metadata
-amdgpu-vgpr-index-mode - Use GPR indexing mode instead of movrel for vector indexing
-analyze - Only perform analysis, no optimization
-arm-add-build-attributes -
-arm-implicit-it - Allow conditional instructions outdside of an IT block
=always - Accept in both ISAs, emit implicit ITs in Thumb
=never - Warn in ARM, reject in Thumb
=arm - Accept in ARM, reject in Thumb
=thumb - Warn in ARM, emit implicit ITs in Thumb
-asm-instrumentation - Instrumentation of inline assembly and assembly source files
=none - no instrumentation at all
=address - instrument instructions with memory arguments
-asm-show-inst - Emit internal instruction representation to assembly file
-atomic-counter-update-promoted - Do counter update using atomic fetch add for promoted counters only
Optimizations available:
-aa - Function Alias Analysis Results
-aa-eval - Exhaustive Alias Analysis Precision Evaluator
-aarch64-a57-fp-load-balancing - AArch64 A57 FP Load-Balancing
-aarch64-ccmp - AArch64 CCMP Pass
-aarch64-collect-loh - AArch64 Collect Linker Optimization Hint (LOH)
-aarch64-condopt - AArch64 CondOpt Pass
-aarch64-copyelim - AArch64 redundant copy elimination pass
-aarch64-dead-defs - AArch64 Dead register definitions
-aarch64-expand-pseudo - AArch64 pseudo instruction expansion pass
...
...
Generic Options:
-help - Display available options (-help-hidden for more)
-help-list - Display list of available options (-help-list-hidden for more)
-version - Display the version of this program
Polly Options:
Configure the polly loop optimizer
-polly - Enable the polly optimizer (only at -O3)
-polly-2nd-level-tiling - Enable a 2nd level loop of loop tiling
-polly-ast-print-accesses - Print memory access functions
-polly-context=<isl parameter set> - Provide additional constraints on the context parameters
-polly-dce-precise-steps=<int> - The number of precise steps between two approximating iterations. (A value of -1 schedules another approximation stage before the actual dead code elimination.
-polly-delicm-max-ops=<int> - Maximum number of isl operations to invest for lifetime analysis; 0=no limit
-polly-detect-full-functions - Allow the detection of full functions
-polly-dump-after - Dump module after Polly transformations into a file suffixed with "-after"
-polly-dump-after-file=<string> - Dump module after Polly transformations to the given file
-polly-dump-before - Dump module before Polly transformations into a file suffixed with "-before"
-polly-dump-before-file=<string> - Dump module before Polly transformations to the given file
-polly-enable-simplify - Simplify SCoP after optimizations
...
...
Analysis Passes
-aa-eval: Exhaustive Alias Analysis Precision Evaluator
-basicaa: Basic Alias Analysis (stateless AA impl)
-basiccg: Basic CallGraph Construction
-count-aa: Count Alias Analysis Query Responses
-da: Dependence Analysis
-debug-aa: AA use debugger
-domfrontier: Dominance Frontier Construction
-domtree: Dominator Tree Construction
-dot-callgraph: Print Call Graph to “dot” file
-dot-cfg: Print CFG of function to “dot” file
-dot-cfg-only: Print CFG of function to “dot” file (with no function bodies)
-dot-dom: Print dominance tree of function to “dot” file
-dot-dom-only: Print dominance tree of function to “dot” file (with no function bodies)
-dot-postdom: Print postdominance tree of function to “dot” file
-dot-postdom-only: Print postdominance tree of function to “dot” file (with no function bodies)
-globalsmodref-aa: Simple mod/ref analysis for globals
-instcount: Counts the various types of Instructions
-intervals: Interval Partition Construction
-iv-users: Induction Variable Users
-lazy-value-info: Lazy Value Information Analysis
-libcall-aa: LibCall Alias Analysis
-lint: Statically lint-checks LLVM IR
-loops: Natural Loop Information
-memdep: Memory Dependence Analysis
-module-debuginfo: Decodes module-level debug info
-postdomfrontier: Post-Dominance Frontier Construction
-postdomtree: Post-Dominator Tree Construction
-print-alias-sets: Alias Set Printer
-print-callgraph: Print a call graph
-print-callgraph-sccs: Print SCCs of the Call Graph
-print-cfg-sccs: Print SCCs of each function CFG
-print-dom-info: Dominator Info Printer
-print-externalfnconstants: Print external fn callsites passed constants
-print-function: Print function to stderr
-print-module: Print module to stderr
-print-used-types: Find Used Types
-regions: Detect single entry single exit regions
-scalar-evolution: Scalar Evolution Analysis
-scev-aa: ScalarEvolution-based Alias Analysis
-stack-safety: Stack Safety Analysis
-targetdata: Target Data Layout
Transform Passes
-adce: Aggressive Dead Code Elimination
-always-inline: Inliner for always_inline functions
-argpromotion: Promote ‘by reference’ arguments to scalars
-bb-vectorize: Basic-Block Vectorization
-block-placement: Profile Guided Basic Block Placement
-break-crit-edges: Break critical edges in CFG
-codegenprepare: Optimize for code generation
-constmerge: Merge Duplicate Global Constants
-constprop: Simple constant propagation
-dce: Dead Code Elimination
-deadargelim: Dead Argument Elimination
-deadtypeelim: Dead Type Elimination
-die: Dead Instruction Elimination
-dse: Dead Store Elimination
-functionattrs: Deduce function attributes
-globaldce: Dead Global Elimination
-globalopt: Global Variable Optimizer
-gvn: Global Value Numbering
-indvars: Canonicalize Induction Variables
-inline: Function Integration/Inlining
-instcombine: Combine redundant instructions
-aggressive-instcombine: Combine expression patterns
-internalize: Internalize Global Symbols
-ipconstprop: Interprocedural constant propagation
-ipsccp: Interprocedural Sparse Conditional Constant Propagation
-jump-threading: Jump Threading
-lcssa: Loop-Closed SSA Form Pass
-licm: Loop Invariant Code Motion
-loop-deletion: Delete dead loops
-loop-extract: Extract loops into new functions
-loop-extract-single: Extract at most one loop into a new function
-loop-reduce: Loop Strength Reduction
-loop-rotate: Rotate Loops
-loop-simplify: Canonicalize natural loops
-loop-unroll: Unroll loops
-loop-unroll-and-jam: Unroll and Jam loops
-loop-unswitch: Unswitch loops
-loweratomic: Lower atomic intrinsics to non-atomic form
-lowerinvoke: Lower invokes to calls, for unwindless code generators
-lowerswitch: Lower SwitchInsts to branches
-mem2reg: Promote Memory to Register
-memcpyopt: MemCpy Optimization
-mergefunc: Merge Functions
-mergereturn: Unify function exit nodes
-partial-inliner: Partial Inliner
-prune-eh: Remove unused exception handling info
-reassociate: Reassociate expressions
-reg2mem: Demote all values to stack slots
-sroa: Scalar Replacement of Aggregates
-sccp: Sparse Conditional Constant Propagation
-simplifycfg: Simplify the CFG
-sink: Code sinking
-strip: Strip all symbols from a module
-strip-dead-debug-info: Strip debug info for unused symbols
-strip-dead-prototypes: Strip Unused Function Prototypes
-strip-debug-declare: Strip all llvm.dbg.declare intrinsics
-strip-nondebug: Strip all symbols, except dbg symbols, from a module
-tailcallelim: Tail Call Elimination
Utility Passes
-deadarghaX0r: Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)
-extract-blocks: Extract Basic Blocks From Module (for bugpoint use)
-instnamer: Assign names to anonymous instructions
-verify: Module Verifier
-view-cfg: View CFG of function
-view-cfg-only: View CFG of function (with no function bodies)
-view-dom: View dominance tree of function
-view-dom-only: View dominance tree of function (with no function bodies)
-view-postdom: View postdominance tree of function
-view-postdom-only: View postdominance tree of function (with no function bodies)
-transform-warning: Report missed forced transformations