LLVM-MC(1)

πŸ“¦ version 11.1.0, in ubuntu jammy

🌸 NAME 🌸

llvm-mc β€” manual page for llvm-mc 11


✨ DESCRIPTION ✨

OVERVIEW: llvm machine code playground β€” no cap, this is where you come to play with machine code like it's a bestie's group chat. πŸ’…

USAGE:

llvm-mc [options] <input file>

πŸŽ€ OPTIONS πŸŽ€

okay so here's the whole menu, bestie. we're going through every single one because that's just how we do it. ✨

🌈 Color Options 🌈

  • --color β€” Use colors in output (default=autodetect) β€” yes, it's giving rainbow realness 🌈

🌟 General options 🌟

  • -I=<directory> β€” Directory of include files β€” where the include files live, fr fr
  • --aarch64-neon-syntax=<value> β€” Choose style of NEON code to emit from AArch64 backend:
    • =generic β€” Emit generic NEON assembly
    • =apple β€” Emit Apple-style NEON assembly
  • --amdgpu-bypass-slow-div β€” Skip 64-bit divide for dynamic 32-bit values
  • --amdgpu-disable-loop-alignment β€” Do not align and prefetch loops
  • --amdgpu-disable-power-sched β€” Disable scheduling to minimize mAI power bursts
  • --amdgpu-dpp-combine β€” Enable DPP combiner
  • --amdgpu-dump-hsa-metadata β€” Dump AMDGPU HSA Metadata
  • --amdgpu-enable-global-sgpr-addr β€” Enable use of SGPR regs for GLOBAL LOAD/STORE instructions
  • --amdgpu-enable-merge-m0 β€” Merge and hoist M0 initializations
  • --amdgpu-promote-alloca-to-vector-limit=<uint> β€” Maximum byte size to consider promote alloca to vector
  • --amdgpu-reserve-vgpr-for-sgpr-spill β€” Allocates one VGPR for future SGPR Spill
  • --amdgpu-sdwa-peephole β€” Enable SDWA peepholer
  • --amdgpu-verify-hsa-metadata β€” Verify AMDGPU HSA Metadata
  • --amdgpu-vgpr-index-mode β€” Use GPR indexing mode instead of movrel for vector indexing
  • --arch=<string> β€” Target arch to assemble for, see -version for available targets
  • --arm-add-build-attributes β€” (no description, just vibes) 🫢
  • --arm-implicit-it=<value> β€” 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-show-inst β€” Emit internal instruction representation to assembly file

🎬 Action to perform:

  • --as-lex β€” Lex tokens from a .s file
  • --assemble β€” Assemble a .s file (default)
  • --disassemble β€” Disassemble strings of hex bytes
  • --mdis β€” Marked up disassembly of strings of hex bytes
  • --atomic-counter-update-promoted β€” Do counter update using atomic fetch add for promoted counters only
  • --atomic-first-counter β€” Use atomic fetch add for first counter in a function (usually the entry counter)
  • --bounds-checking-single-trap β€” Use one trap block per function
  • --cfg-hide-deoptimize-paths β€” (no description, just vibes) ✨
  • --cfg-hide-unreachable-paths β€” (no description, just vibes) ✨
  • --compress-debug-sections=<value> β€” Choose DWARF debug sections compression:
    • =none β€” No compression
    • =zlib β€” Use zlib compression
    • =zlib-gnu β€” Use zlib-gnu compression (deprecated) β€” bestie, deprecated means don't @ me πŸ’€
  • --cost-kind=<value> β€” Target cost kind
    • =throughput β€” Reciprocal throughput
    • =latency β€” Instruction latency
    • =code-size β€” Code size
  • --cvp-dont-add-nowrap-flags β€” (no description, just vibes) πŸ¦‹
  • --debugify-level=<value> β€” Kind of debug info to add
    • =locations β€” Locations only
    • =location+variables β€” Locations and Variables
  • --debugify-quiet β€” Suppress verbose debugify output
  • --defsym=<string> β€” Defines a symbol to be an integer constant
  • --disable-promote-alloca-to-lds β€” Disable promote alloca to LDS
  • --disable-promote-alloca-to-vector β€” Disable promote alloca to vector
  • --do-counter-promotion β€” Do counter register promotion
  • --dwarf-version=<int> β€” Dwarf version
  • --dwarf64 β€” Generate debugging info in the 64-bit DWARF format
  • --emscripten-cxx-exceptions-allowed=<string> β€” The list of function names in which Emscripten-style exception handling is enabled (see emscripten EMSCRIPTEN_CATCHING_ALLOWED options)
  • --enable-cse-in-irtranslator β€” Should enable CSE in irtranslator
  • --enable-cse-in-legalizer β€” Should enable CSE in Legalizer
  • --enable-emscripten-cxx-exceptions β€” WebAssembly Emscripten-style exception handling
  • --enable-emscripten-sjlj β€” WebAssembly Emscripten-style setjmp/longjmp handling
  • --enable-gvn-hoist β€” Enable the GVN hoisting pass (default = off)
  • --enable-gvn-memdep β€” (no description, just vibes) 🌸
  • --enable-gvn-sink β€” Enable the GVN sinking pass (default = off)
  • --enable-load-in-loop-pre β€” (no description, just vibes) 🌸
  • --enable-load-pre β€” (no description, just vibes) 🌸
  • --enable-loop-simplifycfg-term-folding β€” (no description, just vibes) 🌸
  • --enable-name-compression β€” Enable name/filename string compression
  • --fatal-warnings β€” Treat warnings as errors β€” no more "it's just a warning" energy, periodt
  • --fdebug-compilation-dir=<string> β€” Specifies the debug info's compilation dir
  • --fdebug-prefix-map=<= separated key-value pairs> β€” Map file source paths in debug info
  • --filetype=<value> β€” Choose an output file type:
    • =asm β€” Emit an assembly ('.s') file
    • =null β€” Don't emit anything (for timing purposes)
    • =obj β€” Emit a native object ('.o') file
  • -g β€” Generate dwarf debugging info for assembly source files
  • --gpsize=<uint> β€” Global Pointer Addressing Size. The default size is 8.
  • --hash-based-counter-split β€” Rename counter variable of a comdat function based on cfg hash
  • --hot-cold-split β€” Enable hot-cold splitting pass
  • --import-all-index β€” Import all external functions in index.
  • --incremental-linker-compatible β€” When used with filetype=obj, emit an object file which can be used with an incremental linker
  • --instcombine-code-sinking β€” Enable code sinking
  • --instcombine-guard-widening-window=<uint> β€” How wide an instruction window to bypass looking for another guard
  • --instcombine-max-iterations=<uint> β€” Limit the maximum number of instruction combining iterations
  • --instcombine-max-num-phis=<uint> β€” Maximum number phis to handle in intptr/ptrint folding
  • --instcombine-maxarray-size=<uint> β€” Maximum array size considered when doing a combine
  • --instcombine-negator-enabled β€” Should we attempt to sink negations?
  • --instcombine-negator-max-depth=<uint> β€” What is the maximal lookup depth when trying to check for viability of negation sinking.
  • --instrprof-atomic-counter-update-all β€” Make all profile counter updates atomic (for testing only)
  • --internalize-public-api-file=<filename> β€” A file containing list of symbol names to preserve
  • --internalize-public-api-list=<list> β€” A list of symbol names to preserve
  • --iterative-counter-promotion β€” Allow counter promotion across the whole loop nest.
  • --large-code-model β€” Create cfi directives that assume the code might be more than 2gb away
  • --lto-embed-bitcode β€” Embed LLVM bitcode in object files produced by LTO
  • --lto-pass-remarks-filter=<regex> β€” Only record optimization remarks from passes whose names match the given regular expression
  • --lto-pass-remarks-format=<format> β€” The format used for serializing remarks (default: YAML)
  • --lto-pass-remarks-output=<filename> β€” Output filename for pass remarks
  • --main-file-name=<string> β€” Specifies the name we should consider the input file
  • --masm-integers β€” Enable binary and hex masm integers (0b110 and 0ABCh)
  • --matrix-default-layout=<value> β€” Sets the default matrix layout
    • =column-major β€” Use column-major layout
    • =row-major β€” Use row-major layout
  • --mattr=<a1,+a2,-a3,...> β€” Target specific attributes (-mattr=help for details)
  • --max-counter-promotions=<int> β€” Max number of allowed counter promotions
  • --max-counter-promotions-per-loop=<uint> β€” Max number counter promotions per loop to avoid increasing register pressure too much
  • --mc-relax-all β€” When used with filetype=obj, relax all fixups in the emitted object file
  • --mcpu=<cpu-name> β€” Target a specific cpu type (-mcpu=help for details)
  • --memop-size-large=<uint> β€” Set large value thresthold in memory intrinsic size profiling. Value of 0 disables the large value profiling.
  • --memop-size-range=<string> β€” Set the range of size in memory intrinsic calls to be profiled precisely, in a format of <start_val>:<end_val>
  • --merror-missing-parenthesis β€” Error for missing parenthesis around predicate registers
  • --merror-noncontigious-register β€” Error for register names that aren't contigious
  • --mhvx β€” turn ON the Hexagon Vector eXtensions πŸ¦‹
  • --mhvx=<value> β€” same thing but you get to pick which Hexagon Vector eXtensions, bestie:
    • =v60 β€” build it for HVX v60
    • =v62 β€” build it for HVX v62
    • =v65 β€” build it for HVX v65
    • =v66 β€” build it for HVX v66
    • =v67 β€” build it for HVX v67
  • --mips-compact-branches=<value> β€” MIPS Specific: the compact branch policy, iykyk πŸ’…
    • =never β€” don't use compact branches if you can possibly help it
    • =optimal β€” use compact branches where it's appropriate (this is the default, so vibe with it) ✨
    • =always β€” always use compact branches if possible, no thoughts head empty
  • --mips16-constant-islands β€” enable mips16 constant islands 🏝️
  • --mips16-hard-float β€” enable mips16 hard float
  • --mir-strip-debugify-only β€” should mir-strip-debug only strip debug info from debugified modules by default
  • --mno-compound β€” stop looking for compound instructions for Hexagon
  • --mno-fixup β€” stop fixing up resolved relocations for Hexagon
  • --mno-ldc1-sdc1 β€” expand double precision loads and stores into their single precision counterparts
  • --mno-pairing β€” stop looking for duplex instructions for Hexagon
  • --mwarn-missing-parenthesis β€” warn when a predicate register is missing its parenthesis
  • --mwarn-noncontigious-register β€” warn about register names that arent contigious (yes the spelling is exactly like that, do not come for me 😭)
  • --mwarn-sign-mismatch β€” warn when you mismatch a signed and an unsigned value
  • -n β€” don't assume the assembly file starts in the text section
  • --no-deprecated-warn β€” suppress ALL deprecated warnings 🚫
  • --no-discriminators β€” disable generation of discriminator information
  • --no-exec-stack β€” this file doesn't need an exec stack
  • --no-warn β€” suppress ALL warnings 🚫
  • --nvptx-sched4reg β€” NVPTX Specific: schedule for register pressue (typo preserved, it's iconic πŸ’€)
  • -o=<filename> β€” output filename
  • --output-asm-variant=<uint> β€” which syntax variant to use when printing the output
  • --poison-checking-function-local β€” check that returns are non-poison (for testing πŸ§ͺ)
  • --position-independent β€” position independent
  • --preserve-comments β€” keep the comments in the outputted assembly 🫢
  • --print-imm-hex β€” prefer hex format for immediate values
  • --r600-ir-structurize β€” use the StructurizeCFG IR pass
  • --rdf-dump β€” that's it, that's the whole description πŸ™ˆ (the original literally leaves this one blank)
  • --rdf-limit=<uint> β€” also blank in the original, mysterious main character energy πŸ‘‘
  • --relax-relocations β€” emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL
  • --runtime-counter-relocation β€” enable relocating counters at runtime
  • --safepoint-ir-verifier-print-only β€” blank again, we love a cryptic queen ✨
  • --sample-profile-check-record-coverage=<N> β€” emit a warning if less than N% of the records in the input profile got matched to the IR
  • --sample-profile-check-sample-coverage=<N> β€” emit a warning if less than N% of the samples in the input profile got matched to the IR
  • --sample-profile-max-propagate-iterations=<uint> β€” the maximum number of iterations to go through when propagating sample block/edge weights through the CFG
  • --save-temp-labels β€” don't discard temporary labels
  • --show-encoding β€” show instruction encodings πŸ‘€
  • --show-inst β€” show the internal instruction representation
  • --show-inst-operands β€” show instruction operands as parsed
  • --speculative-counter-promotion-max-exiting=<uint> β€” the max number of exiting blocks of a loop to allow speculative counter promotion
  • --speculative-counter-promotion-to-loop β€” when this option is false, if the target block is in a loop, the promotion will be disallowed unless the promoted counter update can be further/iteratively promoted into an acyclic region
  • --split-dwarf-file=<filename> β€” DWO output filename
  • --summary-file=<string> β€” the summary file to use for function importing
  • --tail-predication=<value> β€” MVE tail-predication options 🌈
    • =disabled β€” don't tail-predicate loops
    • =enabled-no-reductions β€” enable tail-predication, but not for reduction loops
    • =enabled β€” enable tail-predication, including reduction loops
    • =force-enabled-no-reductions β€” enable tail-predication, but not for reduction loops, and force this which might be unsafe 😬
    • =force-enabled β€” enable tail-predication, including reduction loops, and force this which might be unsafe 😬
  • --threads=<int> β€” blank in the original, it's giving mystery πŸ’…
  • --triple=<string> β€” the target triple to assemble for, see -version for available targets
  • --verify-region-info β€” verify region info (this one is time consuming, so be warned πŸ•°οΈ)
  • --vp-counters-per-site=<number> β€” the average number of profile counters allocated per value profiling site
  • --vp-static-alloc β€” do static counter allocation for the value profiler
  • --x86-align-branch=<string> β€” specify types of branches to align (plus separated list of types):
    • jcc β€” indicates conditional jumps
    • fused β€” indicates fused conditional jumps
    • jmp β€” indicates direct unconditional jumps
    • call β€” indicates direct and indirect calls
    • ret β€” indicates rets
    • indirect β€” indicates indirect unconditional jumps
  • --x86-align-branch-boundary=<uint> β€” control how the assembler should align branches with NOP. If the boundary's size is not 0, it should be a power of 2 and no less than 32. Branches will be aligned to prevent from being across or against the boundary of specified size. The default value 0 does not align branches.
  • --x86-branches-within-32B-boundaries β€” align selected instructions to mitigate the negative performance impact of Intel's micro code update for errata skx102
⚠️ This one may break assumptions about labels corresponding to particular instructions, and should be used with caution. Like, caution caution, bestie.
  • --x86-pad-max-prefix-size=<uint> β€” maximum number of prefixes to use for padding

Generic Options 🌸

  • --help β€” display available options (--help-hidden for more)
  • --help-list β€” display a 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 the module after Polly transformations into a file suffixed with "-after"
  • --polly-dump-after-file=<string> β€” dump the module after Polly transformations to the given file
  • --polly-dump-before β€” dump the module before Polly transformations into a file suffixed with "-before"
  • --polly-dump-before-file=<string> β€” dump the module before Polly transformations to the given file
  • --polly-enable-simplify β€” simplify SCoP after optimizations
  • --polly-ignore-func=<string> β€” ignore functions that match a regex. Multiple regexes can be comma separated. Scop detection will ignore all functions that match ANY of the regexes provided.
  • --polly-isl-arg=<argument> β€” option passed to ISL
  • --polly-on-isl-error-abort β€” abort if an isl error is encountered πŸ’€
  • --polly-only-func=<string> β€” only run on functions that match a regex. Multiple regexes can be comma separated. Scop detection will run on all functions that match ANY of the regexes provided.
  • --polly-only-region=<identifier> β€” only run on certain regions (The provided identifier must appear in the name of the region's entry block
  • --polly-only-scop-detection β€” only run scop detection, but no other optimizations
  • --polly-optimized-scops β€” Polly - dump the polyhedral description of Scops optimized with the isl scheduling optimizer and the set of post-scheduling transformations is applied on the schedule tree
  • --polly-parallel β€” generate thread parallel code (isl codegen only)
  • --polly-parallel-force β€” force generation of thread parallel code ignoring any cost model
  • --polly-pattern-matching-based-opts β€” perform optimizations based on pattern matching
  • --polly-process-unprofitable β€” let it cook even on the scops that probably won't get anything out of Polly's optimizations. lowkey generous of you tbh πŸ’–
  • --polly-register-tiling β€” turn on register tiling. yes bestie, we're tiling registers now ✨
  • --polly-report β€” spills all the tea about what Polly is actually doing. prints info about Polly's activities, no cap πŸ‘‘
  • --polly-show β€” highlights the code regions that are gonna get optimized β€” and it's showing you both the CFG BBs and the LLVM-IR instructions. the full cinematic universe 🎬
  • --polly-show-only β€” same energy, but it highlights the regions that will be optimized in the CFG only BBs. stripped-down version, still slaying πŸ’…
  • --polly-stmt-granularity=<value> β€” picks which algorithm gets used to split basic blocks into multiple statements. choose your fighter:
    • =bb β€” one statement per basic block. simple, clean, iconic.
    • =scalar-indep β€” the scalar independence heuristic 🌸
    • =store β€” store-level granularity. granular, as the name suggests πŸ“
  • --polly-target=<value> β€” which hardware we're targeting, bestie. gotta know your audience:
    • =cpu β€” generate CPU code πŸ’»
  • --polly-tiling β€” enable loop tiling. loops but make them cute little tiles πŸŽ€
  • --polly-vectorizer=<value> β€” pick your vectorization strategy, it's giving choose-your-own-adventure:
    • =none β€” no vectorization. we're doing NOTHING today and that's valid πŸ’€
    • =polly β€” Polly's own internal vectorizer, homegrown and proud 🫢
    • =stripmine β€” strip-mine the outer loops so the loop-vectorizer will trigger. setting the stage for the main character to walk in ⭐

and that's a wrap on this whole page, fr fr 🌈 that was llvm-mc from LLVM 11, dated January 2022, and you just read the whole LLVM-MC(1) manual like a champ. go forth and assemble something iconic, bestie πŸ’œβœ¨

πŸ“¦ where this page comes from