LLVM-MC(1)
πΈ 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-versionfor 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 emscriptenEMSCRIPTEN_CATCHING_ALLOWEDoptions)--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 withfiletype=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 (0b110and0ABCh)--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=helpfor 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 withfiletype=obj, relax all fixups in the emitted object file--mcpu=<cpu-name>β Target a specific cpu type (-mcpu=helpfor 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β shouldmir-strip-debugonly 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β emitR_X86_64_GOTPCRELXinstead ofR_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-versionfor 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 jumpsfusedβ indicates fused conditional jumpsjmpβ indicates direct unconditional jumpscallβ indicates direct and indirect callsretβ indicates retsindirectβ 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-hiddenfor more)--help-listβ display a list of available options (--help-list-hiddenfor 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-1schedules 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
- ubuntu jammy: llvm-11 1:11.1.0-6 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms