CLANG-REPL(1)
π clang-repl π
okay so bestie, welcome to the manual page for clang-repl 16 β it's a User Command, it's iconic, and it's about to make your whole terminal pop off. π
πΈ NAME πΈ
clang-repl β manual page for clang-repl 16 β¨
π DESCRIPTION π
okay so here's the whole vibe of how you actually call this thing:
USAGE: clang-repl [options] [code to run]
that's it. that's the shape of it. options go in, code goes in, magic happens. πͺ
and then there's OPTIONS: β and bestie, there are a LOT of them. buckle up. π
π OPTIONS π
π¨ Color Options π¨
--colorβ use colors in your output, obviously π (default isautodetect, so it figures it out on its own, slay)
π§ General options π§
ngl this list is long, but every single one of these is a real flag and we're going through ALL of them. no skipping. periodt. π
--Xcc=<string>β an argument you hand straight over to theCompilerInvocation--aarch64-neon-syntax=<value>β pick which style of NEON code the AArch64 backend emits:=genericβ emit generic NEON assembly=appleβ emit Apple-style NEON assembly π
--aarch64-use-aaβ turn on using AA during codegen--abort-on-max-devirt-iterations-reachedβ bail out (abort!) once the max iterations for the devirtualization CGSCC repeat pass is hit--allow-ginsert-as-artifactβ letG_INSERTcount as an artifact. it's literally a hack around AMDGPU test infinite loops π«--amdgpu-bypass-slow-divβ skip the 64-bit divide for dynamic 32-bit values--amdgpu-disable-loop-alignmentβ do NOT align and prefetch loops--amdgpu-dpp-combineβ enable the DPP combiner--amdgpu-dump-hsa-metadataβ dump AMDGPU HSA Metadata--amdgpu-enable-merge-m0β merge and hoist M0 initializations--amdgpu-enable-power-schedβ enable scheduling to minimize mAI power bursts--amdgpu-promote-alloca-to-vector-limit=<uint>β the maximum byte size you'll consider for promoting alloca to vector--amdgpu-sdwa-peepholeβ enable the SDWA peepholer--amdgpu-use-aa-in-codegenβ turn on using AA during codegen--amdgpu-verify-hsa-metadataβ verify AMDGPU HSA Metadata--amdgpu-vgpr-index-modeβ use GPR indexing mode instead of movrel for vector indexing--arm-add-build-attributesβ no description on this one bestie, it just exists and 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 the internal instruction representation into the assembly file--atomic-counter-update-promotedβ do counter updates using atomic fetch add, but for promoted counters only--atomic-first-counterβ use atomic fetch add for the first counter in a function (usually that's the entry counter)--bounds-checking-single-trapβ use one trap block per function--cfg-hide-cold-paths=<number>β hide blocks whose relative frequency sits below the value you give--cfg-hide-deoptimize-pathsβ no description, it's mysterious like that π--cfg-hide-unreachable-pathsβ also no description, also mysterious π--cost-kind=<value>β the target cost kind:=throughputβ reciprocal throughput=latencyβ instruction latency=code-sizeβ code size=size-latencyβ code size AND latency
--cs-profile-generateβ perform context sensitive PGO instrumentation--cs-profile-path=<string>β context sensitive profile file path--debug-info-correlateβ use debug info to correlate profiles--debugify-func-limit=<ulong>β set the max number of processed functions per pass--debugify-level=<value>β what kind of debug info to add:=locationsβ locations only=location+variablesβ locations and variables
--debugify-quietβ suppress the verbose debugify output (shhh π€«)--disable-i2p-p2i-optβ disables theinttoptr/ptrtointroundtrip optimization--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--dot-cfg-mssa=<file name for generated dot file>β file name for the generated dot file--dwarf-version=<int>β the Dwarf version--dwarf64β generate debugging info in the 64-bit DWARF format--emit-dwarf-unwind=<value>β whether to emit DWARF EH frame entries:=alwaysβ always emit EH frame entries=no-compact-unwindβ only emit EH frame entries when compact unwind isn't available=defaultβ use the target platform default
--emscripten-cxx-exceptions-allowed=<string>β the list of function names where Emscripten-style exception handling is enabled (peep the emscriptenEMSCRIPTEN_CATCHING_ALLOWEDoptions)--enable-cse-in-irtranslatorβ should CSE be enabled in the irtranslator?--enable-cse-in-legalizerβ should CSE be enabled in the Legalizer?--enable-emscripten-cxx-exceptionsβ WebAssembly Emscripten-style exception handling--enable-emscripten-sjljβ WebAssembly Emscripten-stylesetjmp/longjmphandling--enable-gvn-hoistβ enable the GVN hoisting pass (default = off)--enable-gvn-memdepβ no description, it's keeping its secrets π--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--enable-split-backedge-in-load-preβ no description, just vibes β¨--execute-concurrency=<uint>β how many threads get used to process all files in parallel. set it to0for hardware concurrency. heads up: this flag only applies to all-TUs π--executor=<string>β the name of the executor to use--experimental-debug-variable-locationsβ use the experimental new value-tracking variable locations π§ͺ--fatal-warningsβ treat warnings as errors (no more ignoring them bestie π)--filter=<string>β only process files that match this filter. this flag only applies to all-TUs--fs-profile-debug-bw-threshold=<uint>β only show the debug message if the source branch weight is greater than this value--fs-profile-debug-prob-diff-threshold=<uint>β only show the debug message if the branch probility is greater than this value (in percentage)--generate-merged-base-profilesβ when generating nested context-sensitive profiles, always generate an extra base profile for the function with all its context profiles merged into it--gpsize=<uint>β Global Pointer Addressing Size. the default size is8--hash-based-counter-splitβ rename the counter variable of a comdat function based on the cfg hash--hot-cold-splitβ enable the hot-cold splitting pass π₯π§--import-all-indexβ import all external functions in index--incremental-linker-compatibleβ when used withfiletype=obj, emit an object file that 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 while looking for another guard--instcombine-max-iterations=<uint>β cap the maximum number of instruction combining iterations--instcombine-max-num-phis=<uint>β maximum number phis to handle inintptr/ptrintfolding--instcombine-max-sink-users=<uint>β maximum number of undroppable users for instruction sinking--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>β the maximal lookup depth when you're trying to check whether negation sinking is viable--instrprof-atomic-counter-update-allβ make ALL profile counter updates atomic (for testing only, bestie, don't ship this π¨)--internalize-public-api-file=<filename>β a file containing a 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--lto-aix-system-assembler=<path>β path to a system assembler, picked up on AIX only--lto-embed-bitcode=<value>β embed LLVM bitcode in object files produced by LTO:=noneβ do not embed=optimizedβ embed after all optimization passes=post-merge-pre-optβ embed post merge, but before optimizations
--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--matrix-default-layout=<value>β sets the default matrix layout:=column-majorβ use column-major layout=row-majorβ use row-major layout
--matrix-print-after-transpose-optβ no description, it's just there looking cute π--max-counter-promotions=<int>β max number of allowed counter promotions
okay bestie that's the end of part 1 β but we are SO not done, there's more coming, don't go anywhere πΈπ
okay so the option buffet continues, bestie, and it is giving a lot, but we're gonna get through every single one together, no skips πβ¨
--max-counter-promotions-per-loop=<uint>β max number of counter promotions per loop, so we don't crank register pressure too hard. chill vibes only.--mc-relax-allβ when you're usingfiletype=obj, relax all fixups in the emitted object file. slay.--mcabacβ tbd. literally tbd, the manual said it, not me π.--merror-missing-parenthesisβ error out if a predicate register is missing its parenthesis. strict mode.--merror-noncontigious-registerβ error for register names that aren't contigious. (yes, that spelling, bestie, we keep it exactly.)--mhvxβ enable Hexagon Vector eXtensions. hexagon girlies rise.--mhvx=<value>β enable Hexagon Vector eXtensions, but pick your vibe:=v60β Build for HVX v60=v62β Build for HVX v62=v65β Build for HVX v65=v66β Build for HVX v66=v67β Build for HVX v67=v68β Build for HVX v68=v69β Build for HVX v69=v71β Build for HVX v71=v73β Build for HVX v73
--mips-compact-branches=<value>β MIPS specific: compact branch policy. pick your policy:=neverβ Do not use compact branches if possible.=optimalβ Use compact branches where appropriate (default).=alwaysβ Always use compact branches if possible.
--mips16-constant-islandsβ enable mips16 constant islands. island era.--mips16-hard-floatβ enable mips16 hard float. float like a butterfly.--mir-strip-debugify-onlyβ shouldmir-strip-debugonly strip debug info from debugified modules by default. niche but valid.--misexpect-tolerance=<uint>β prevents emitting diagnostics when profile counts are within N% of the threshold. tolerance is self-care.--mno-compoundβ disable looking for compound instructions for Hexagon. no compound for you.--mno-fixupβ disable fixing up resolved relocations for Hexagon. leave it unresolved.--mno-ldc1-sdc1β expand double precision loads and stores to their single precision counterparts. split it.--mno-pairingβ disable looking for duplex instructions for Hexagon. no pairing today.--mwarn-missing-parenthesisβ warn for missing parenthesis around predicate registers. gentle reminder.--mwarn-noncontigious-registerβ warn for register names that arent contigious. (again, spelling kept, iykyk.)--mwarn-sign-mismatchβ warn for mismatching a signed and unsigned value. signed vs unsigned drama.--no-deprecated-warnβ suppress all deprecated warnings. peace and quiet.--no-discriminatorsβ disable generation of discriminator information. no discriminators, we're inclusive.--no-type-checkβ suppress type errors (Wasm). wasm said relax.--no-warnβ suppress all warnings. no warnings, periodt.--nvptx-sched4regβ NVPTX specific: schedule for register pressue. (yes, pressue, we keep it.)--opaque-pointersβ use opaque pointers. mysterious pointer energy.--poison-checking-function-localβ check that returns are non-poison (for testing). poison check, bestie.--print-pipeline-passesβ print a-passescompatible string describing the pipeline (best-effort only). pipeline reveal.--r600-ir-structurizeβ use StructurizeCFG IR pass. structure it.--rdf-dumpβ no description given, mysterious.--rdf-limit=<uint>β no description given, mysterious.--runtime-counter-relocationβ enable relocating counters at runtime. move them counters.--safepoint-ir-verifier-print-onlyβ no description given, mysterious.--sample-profile-check-record-coverage=<N>β emit a warning if less than N% of records in the input profile are matched to the IR. coverage check.--sample-profile-check-sample-coverage=<N>β emit a warning if less than N% of samples in the input profile are matched to the IR. sample check.--sample-profile-max-propagate-iterations=<uint>β maximum number of iterations to go through when propagating sample block/edge weights through the CFG. propagate responsibly.--sanitizer-early-opt-epβ insert sanitizers on OptimizerEarlyEP. sanitize early.--skip-ret-exit-blockβ suppress counter promotion if exit blocks contain ret. skip it.--speculative-counter-promotion-max-exiting=<uint>β the max number of exiting blocks of a loop to allow speculative counter promotion. speculative but bounded.--speculative-counter-promotion-to-loopβ when the 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. big brain logic.--summary-file=<string>β the summary file to use for function importing. summary slay.--sve-tail-folding=<string>β control the use of vectorisation using tail-folding for SVE. tail-folding era:disabledβ No loop types will vectorize using tail-foldingdefaultβ Uses the default tail-folding settings for the target CPUallβ All legal loop types will vectorize using tail-foldingsimpleβ Use tail-folding for simple loops (not reductions or recurrences)reductionsβ Use tail-folding for loops containing reductionsrecurrencesβ Use tail-folding for loops containing fixed order recurrences
--tail-predication=<value>β MVE tail-predication pass options. pick your predication:=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
--thinlto-assume-mergedβ assume the input has already undergone ThinLTO function importing and the other pre-optimization pipeline changes. assume merged.--threads=<int>β no description given, mysterious.--type-based-intrinsic-costβ calculate intrinsics cost based only on argument types. type-based math.--verify-region-infoβ verify region info (time consuming). time consuming, bestie, beware.--vp-counters-per-site=<number>β the average number of profile counters allocated per value profiling site. value profiling counters.--vp-static-allocβ do static counter allocation for value profiler. static alloc.--wasm-enable-ehβ WebAssembly exception handling. wasm eh.--wasm-enable-sjljβ WebAssembly setjmp/longjmp handling. setjmp longjmp.--x86-align-branch=<string>β specify types of branches to align (plus separated list of types). branch alignment: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. NOP alignment realness.--x86-branches-within-32B-boundariesβ align selected instructions to mitigate negative performance impact of Intel's micro code update for errata skx102. May break assumptions about labels corresponding to particular instructions, and should be used with caution. caution, bestie!--x86-pad-max-prefix-size=<uint>β maximum number of prefixes to use for padding. prefix padding.
Generic Options
--helpβ display available options (--help-hiddenfor more). help me help you.--help-listβ display list of available options (--help-list-hiddenfor more). list it.--versionβ display the version of this program. version check.
Polly Options: Configure the polly loop optimizer
--pollyβ enable the polly optimizer (with-O1,-O2or-O3). polly want a cracker? no, polly want optimization.--polly-2nd-level-tilingβ enable a 2nd level loop of loop tiling. double tiling.--polly-ast-print-accessesβ print memory access functions. print it.--polly-context=<isl parameter set>β provide additional constraints on the context parameters. context constraints.--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. precise steps.--polly-delicm-max-ops=<int>β maximum number of isl operations to invest for lifetime analysis; 0=no limit. no limit at 0.--polly-detect-full-functionsβ allow the detection of full functions. full function detection.--polly-dump-afterβ dump module after Polly transformations into a file suffixed with "-after". dump after.--polly-dump-after-file=<string>β dump module after Polly transformations to the given file. dump after file.--polly-dump-beforeβ dump module before Polly transformations into a file suffixed with "-before". dump before.--polly-dump-before-file=<string>β dump module before Polly transformations to the given file. dump before file.--polly-enable-simplifyβ simplify SCoP after optimizations. simplify slay.--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. regex ignore.--polly-isl-arg=<argument>β option passed to ISL. ISL arg.--polly-matmul-optβ perform optimizations of matrix multiplications based on pattern matching. matrix multiplication optimization, periodt.--polly-on-isl-error-abortβ the second an isl error shows up, we abort. no gentle vibes, just π--polly-only-func=<string>β only run on functions that match a regex, bestie. multiple regexes? comma-separate them. scop detection will run on all functions that match ANY of the regexes you handed over. ANY of them β¨--polly-only-region=<identifier>β only run on certain regions. the identifier you pass has to appear in the name of the region's entry block, periodt π--polly-only-scop-detectionβ do the scop detection and literally nothing else. no other optimizations, we're just looking π--polly-optimized-scopsβ Polly dumps the polyhedral description of Scops optimized with the isl scheduling optimizer, and the set of post-scheduling transformations gets applied on the schedule tree. iconic dump behavior π--polly-parallelβ generate thread parallel code (isl codegen only, iykyk) π₯--polly-parallel-forceβ force generation of thread parallel code and ignore any cost model entirely. no cap, it does not care π«Ά--polly-pattern-matching-based-optsβ do optimizations based on pattern matching π§--polly-postoptsβ apply post-rescheduling optimizations such as tiling. heads up: it requires-polly-reschedule, so don't come crying to me if you skipped that π--polly-pragma-based-optsβ apply user-directed transformation from metadata β¨--polly-pragma-ignore-depcheckβ skip the dependency check for pragma-based transformations. bold move, bestie π--polly-process-unprofitableβ process scops that are unlikely to benefit from Polly optimizations. yes, the unprofitable ones. we love an underdog πΈ--polly-register-tilingβ enable register tiling π--polly-reportβ print information about the activities of Polly. she's giving full transparency π--polly-rescheduleβ optimize SCoPs using ISL π--polly-showβ highlight the code regions that will be optimized in a (CFG BBs and LLVM-IR instructions) π--polly-show-onlyβ highlight the code regions that will be optimized in a (CFG only BBs) π--polly-stmt-granularity=<value>β the algorithm to use for splitting basic blocks into multiple statements:=bbβ One statement per basic block=scalar-indepβ Scalar independence heuristic=storeβ Store-level granularity
--polly-tc-optβ perform optimizations of tensor contractions based on pattern matching π¦--polly-tilingβ enable loop tiling β--polly-vectorizer=<value>β select the vectorization strategy:=noneβ No Vectorization=pollyβ Polly internal vectorizer=stripmineβ Strip-mine outer loops for the loop-vectorizer to trigger
and that's a wrap on the Polly parade, bestie π this whole page is serving clang-repl 16, dated October 2023 β go forth and optimize, you absolute main character πβ¨
π¦ where this page comes from
- debian bookworm: clang-tools-16 1:16.0.6-15~deb12u1 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms