LDC2(1)

โœจ NAME โœจ

Bestie, this is LDC2 โ€” the LLVM D Compiler. Iconic. ๐Ÿ‘‘


๐Ÿ’ซ DESCRIPTION ๐Ÿ’ซ

๐ŸŒŸ OVERVIEW ๐ŸŒŸ

LDC - the LLVM D compiler. No cap, that's the whole vibe.

๐Ÿš€ USAGE ๐Ÿš€

ldc2 [options] files --run

So you run ldc2 with some [options] and some files, and if you tack on --run, it runs the resulting program, passing the remaining arguments to it. Slay. ๐Ÿ’…

๐ŸŽ€ OPTIONS ๐ŸŽ€

General options:

  • -D โ€” Generate documentation. Cute, right? ๐Ÿ“
  • --Dd=<directory> โ€” Write documentation file to <directory>.
  • --Df=<filename> โ€” Write documentation file to <filename>.
  • -H โ€” Generate 'header' file.
  • --HC โ€” Write C++ 'header' equivalent to stdout.
    • Use -HC=verbose to add comments for ignored declarations (e.g. extern(D)).
  • --HCd=<directory> โ€” Write C++ 'header' file to <directory>.
  • --HCf=<filename> โ€” Write C++ 'header' file to <filename> instead of stdout.
  • --Hd=<directory> โ€” Write 'header' file to <directory>.
  • --Hf=<filename> โ€” Write 'header' file to <filename>.
  • --Hkeep-all-bodies โ€” Keep all function bodies in .di files.
  • -I <directory> โ€” Look for imports also in <directory>.
  • -J <directory> โ€” Look for string imports also in <directory>.

Setting the optimization level:

  • -O โ€” Equivalent to -O3.
  • --O0 โ€” No optimizations (default).
  • --O1 โ€” Simple optimizations.
  • --O2 โ€” Good optimizations.
  • --O3 โ€” Aggressive optimizations.
  • --O4 โ€” Equivalent to -O3.
  • --O5 โ€” Equivalent to -O3.
  • --Os โ€” Like -O2 with extra optimizations for size.
  • --Oz โ€” Like -Os but reduces code size further.
  • -P <cppflag> โ€” Pass <cppflag> to C preprocessor.
  • -X โ€” Generate JSON file.
  • --Xf=<filename> โ€” Write JSON file to <filename>.
  • --allinst โ€” Generate code for all template instantiations.
  • --betterC โ€” Omit generating some runtime information and helper functions.
  • --boundscheck=<value> โ€” Array bounds check.
    • =off โ€” Disabled.
    • =safeonly โ€” Enabled for @safe functions only.
    • =on โ€” Enabled for all functions.
  • -c โ€” Compile only, do not link.
  • --cache=<cache dir> โ€” Enable compilation cache, using <cache dir> to store cache files.
  • --cache-prune โ€” Enable cache pruning.
  • --cache-prune-expiration=<dur> โ€” Sets the pruning expiration time of cache files to <dur> seconds (default: 1 week). Implies -cache-prune.
  • --cache-prune-interval=<dur> โ€” Sets the cache pruning interval to <dur> seconds (default: 20 min). Set to 0 to force pruning. Implies -cache-prune.
  • --cache-prune-maxbytes=<size> โ€” Sets the maximum cache size to <size> bytes. Implies -cache-prune.
  • --cache-prune-maxpercentage=<perc> โ€” Sets the cache size limit to <perc> percent of the available space (default: 75%). Implies -cache-prune.
  • --cache-retrieval=<value> โ€” Set the cache retrieval mechanism (default: copy).
    • =copy โ€” Make a copy of the cache file.
    • =hardlink โ€” Create a hard link to the cache file (recommended).
    • =link โ€” Equal to 'hardlink' on Windows, but 'symlink' on Unix and OS X.
    • =symlink โ€” Create a symbolic link to the cache file.
  • --checkaction=<value> โ€” Action to take when an assert/boundscheck/final-switch fails.
    • =D โ€” Usual D behavior of throwing an AssertError.
    • =C โ€” Call the C runtime library assert failure function.
    • =halt โ€” Halt the program execution (very lightweight).
    • =context โ€” Use D assert with context information (when available).
  • --conf=<filename> โ€” Use configuration file <filename>.
  • --cov โ€” Compile-in code coverage analysis and .lst file generation.
    • Use -cov=<n> for n% minimum required coverage.
    • Use -cov=ctfe to include code executed during CTFE.
  • --cov-increment=<value> โ€” Set the type of coverage line count increment instruction.
    • =default โ€” Use the default (atomic).
    • =atomic โ€” Atomic increment.
    • =non-atomic โ€” Non-atomic increment (not thread safe).
    • =boolean โ€” Don't read, just set counter to 1.
  • --cs-profile-generate โ€” Perform context sensitive PGO instrumentation.
  • --cs-profile-path=<string> โ€” Context sensitive profile file path.
  • --d-debug[=<level/idents>] โ€” Compile in debug code >= <level> or identified by <idents>.
  • --d-version=<level/idents> โ€” Compile in version code >= <level> or identified by <idents>.

Allow deprecated language features and symbols:

  • -d โ€” Silently allow deprecated features and symbols.
  • --dw โ€” Issue a message when deprecated features or symbols are used (default).
  • --de โ€” Issue an error when deprecated features or symbols are used (halt compilation).
  • --deps[=<filename>] โ€” Write module dependencies to <filename> (only imports). '-deps' alone prints module dependencies (imports/file/version/debug/lib).
  • --enable-asserts=<value> โ€” (*) Enable assertions.
  • --enable-color=<value> โ€” (*) Force colored console output.
  • --enable-contracts=<value> โ€” (*) Enable function pre- and post-conditions.
  • --disable-d-passes โ€” Disable all D-specific passes.
  • --disable-gc2stack โ€” Disable promotion of GC allocations to stack memory.
  • --enable-inlining=<value> โ€” (*) Enable function inlining (default in -O2 and higher).
  • --enable-invariants=<value> โ€” (*) Enable invariants.
  • --disable-loop-unrolling โ€” Disable loop unrolling in all relevant passes.
  • --disable-loop-vectorization โ€” Disable the loop vectorization pass.
  • --enable-preconditions=<value> โ€” (*) Enable function preconditions.
  • --disable-red-zone โ€” Do not emit code that uses the red zone.
  • --disable-simplify-drtcalls โ€” Disable simplification of druntime calls.
  • --disable-simplify-libcalls โ€” Disable simplification of well-known C runtime calls.
  • --dllimport=<value> โ€” Windows only: which extern(D) global variables to dllimport implicitly if not defined in a root module.
    • =none โ€” None (default with -link-defaultlib-shared=false).
    • =externalOnly โ€” Only symbols from modules imported from an -extI import root.
    • =defaultLibsOnly โ€” Only druntime/Phobos symbols and symbols from modules imported from an -extI import root (default with -link-defaultlib-shared and -fvisibility=hidden).
    • =all โ€” All (default with -link-defaultlib-shared and -fvisibility=public).
  • --dwarf-version=<int> โ€” Dwarf version.
  • --edition=<NNNN[filename]> โ€” Set language edition to edition year NNNN, optionally only applying to filename.
  • --enable-postconditions=<value> โ€” (*) Enable function postconditions.
  • --enable-switch-errors=<value> โ€” (*) Enable runtime errors for unhandled switch cases.
  • --extI=<directory> โ€” Look also in <directory> for imports that are external to the currently compiling binary. This affects the -dllimport behavior for data symbols from these binary-external modules.
  • --extern-std=<value> โ€” C++ standard for name mangling compatibility.
    • =c++98 โ€” Sets __traits(getTargetInfo, "cppStd") to 199711.
    • =c++11 โ€” Sets __traits(getTargetInfo, "cppStd") to 201103 (default).
    • =c++14 โ€” Sets __traits(getTargetInfo, "cppStd") to 201402.
    • =c++17 โ€” Sets __traits(getTargetInfo, "cppStd") to 201703.
    • =c++20 โ€” Sets __traits(getTargetInfo, "cppStd") to 202002.
    • =c++23 โ€” Sets __traits(getTargetInfo, "cppStd") to 202302.
  • --fcf-protection โ€” Instrument control-flow architecture protection.
  • --fcf-protection=<value> โ€” Instrument control-flow architecture protection.
    • Values: =none, =branch, =return, =full.
  • --fdebug-prefix-map=<<old>=<new>> โ€” Prefix map for filenames in DWARF debuginfo.
  • --fdmd-trace-functions โ€” DMD-style runtime performance profiling of generated code.
  • --ffast-math โ€” Set @fastmath for all functions.
  • --ffat-lto-objects โ€” Include both IR and object code in object file output; only effective when compiling with -flto.
  • --finstrument-functions โ€” Instrument function entry and exit with GCC-compatible profiling calls.
  • --float-abi=<value> โ€” ABI/operations to use for floating-point types:
    • =default โ€” Target default floating-point ABI.
    • =soft โ€” Software floating-point ABI and operations.
    • =softfp โ€” Soft-float ABI, but hardware floating-point instructions.
    • =hard โ€” Hardware floating-point ABI and instructions.
  • --flto=<value> โ€” Set LTO mode, requires linker support.
    • =full โ€” Merges all input into a single module.
    • =thin โ€” Parallel importing and codegen (faster than 'full').
  • --flto-binary=<file> โ€” tell the linker which LTO plugin library to load, bestie. So <file> is something like LLVMgold.so on Unixes or libLTO.dylib on Darwin ๐Ÿงš
  • --fno-delete-null-pointer-checks โ€” okay so this makes dereferencing a null pointer count as defined behavior while optimizing (instead of undefined behavior, thank u very much). Why does that matter? Because otherwise the optimizer is out here going "well if that pointer got dereferenced it couldn't have been null," and then it optimizes away branches based on that assumption. This flag says not today ๐Ÿ’…
  • --fno-discard-value-names โ€” keeps value names in LLVM IR instead of yeeting them into the void.
  • --fno-exceptions โ€” turns off generation of exception stack unwinding code, on the assumption that no Exceptions will be thrown. So likeโ€ฆ don't throw ๐Ÿ™ˆ
  • --fno-moduleinfo โ€” stops ModuleInfos from being generated.
  • --fno-plt โ€” don't make function calls through the PLT.
  • --fno-rtti โ€” stops TypeInfos from being generated.
  • --fp-contract=<value> โ€” lets the compiler get aggressive about forming fused FP ops ๐Ÿ”ฅ
    • =fast โ€” fuse FP ops whenever it's profitable
    • =on โ€” only fuse the 'blessed' FP ops.
    • =off โ€” only fuse FP ops when the result won't be affected.
  • --fprofile-generate[=<filename>] โ€” generates instrumented code that collects a runtime profile into default.profraw (which gets overriden by =<filename> or by the LLVM_PROFILE_FILE env var) ๐Ÿ“Š
  • --fprofile-instr-generate[=<filename>] โ€” same vibe: generates instrumented code to collect a runtime profile into default.profraw, overriden by =<filename> or the LLVM_PROFILE_FILE env var.
  • --fprofile-instr-use=<filename> โ€” uses instrumentation data for profile-guided optimization.
  • --fprofile-sample-use=<filename> โ€” uses instrumentation data for sample-based profile guided optimizations.
  • --fprofile-use=<filename> โ€” uses instrumentation data for profile-guided optimization.
  • --frame-pointer=<value> โ€” picks your frame pointer elimination optimization, choose your fighter:
    • =all โ€” disable frame pointer elimination
    • =non-leaf โ€” disable frame pointer elimination for non-leaf frames
    • =reserved โ€” enable frame pointer elimination, but reserve the frame pointer register
    • =none โ€” enable frame pointer elimination
  • --fsanitize=<checks> โ€” turns on runtime checks for various forms of undefined or suspicious behavior โœจ
  • --fsanitize-address-use-after-return=<value> โ€” picks how AddressSanitizer detects stack use-after-return (UAR): never | runtime (default) | always
    • =never โ€” completely disables detection of UAR errors (and reduces code size).
    • =runtime โ€” adds the code for detection, but it can be disabled via the runtime environment (ASAN_OPTIONS=detect_stack_use_after_return=0). Requires druntime support.
    • =always โ€” enables detection of UAR errors in all cases. (reduces code size, but not as much as never). Requires druntime support.
  • --fsanitize-blacklist=<file> โ€” adds <file> to the blacklist files for the sanitizers.
  • --fsanitize-coverage=<type> โ€” says what type of coverage instrumentation you want for -fsanitize.
  • --fsanitize-memory-track-origins=<int> โ€” enables origins tracking in MemorySanitizer (0=disabled, default).
  • --fsanitize-recover=<name> โ€” enables recovery for the specified sanitizers ('all' = enable for all supported sanitizers).
  • --fsave-optimization-record[=<filename>] โ€” generates a YAML optimization record file of all the optimizations LLVM performed ๐Ÿ“
  • --fsplit-stack โ€” uses a segmented stack (see Clang documentation).
  • --fthread-model=<value> โ€” the thread model:
    • =global-dynamic โ€” Global dynamic TLS model (default)
    • =local-dynamic โ€” Local dynamic TLS model
    • =initial-exec โ€” Initial exec TLS model
    • =local-exec โ€” Local exec TLS model
  • --ftime-trace โ€” turns on the time profiler. It generates a JSON file based on the output filename (also see --ftime-trace-file). โฑ๏ธ
  • --ftime-trace-file=<filename> โ€” says where the time trace file should go.
  • --ftime-trace-granularity=<uint> โ€” the minimum time granularity (in microseconds) traced by the time profiler.
  • --fvisibility=<value> โ€” the default visibility of symbols:
    • =default โ€” hidden for Windows targets without -shared, otherwise public
    • =hidden โ€” only export symbols marked with 'export'
    • =public โ€” export all symbols
  • --fwarn-stack-size=<threshold> โ€” warns you when the stack size is bigger than the given number.
  • --fxray-instruction-threshold=<value> โ€” sets the minimum function size to instrument with XRay.
  • --fxray-instrument โ€” generates XRay instrumentation sleds on function entry and exit ๐Ÿ›ท
  • --gdwarf โ€” emits DWARF debuginfo (instead of CodeView) for MSVC targets.

๐Ÿ› Generating debug information ๐Ÿ›

  • -g โ€” adds symbolic debug info
  • --gc โ€” adds symbolic debug info, and optimizes for non-D debuggers
  • --gline-tables-only โ€” adds line tables only

  • --hash-threshold=<uint> โ€” hashes symbol names longer than this threshold (experimental, bestie ๐Ÿ‘€).
  • -i[=<pattern>] โ€” includes imported modules in the compilation.
  • --identifiers=<value> โ€” picks the non-ASCII tables used for D identifiers:
    • =c99 โ€” C99
    • =c11 โ€” C11
    • =UAX31 โ€” UAX31
    • =all โ€” All, the least restrictive set, which comes with all the others (default)
  • --identifiers-importc=<value> โ€” picks the non-ASCII tables used for ImportC identifiers:
    • =c99 โ€” C99
    • =c11 โ€” C11 (default)
    • =UAX31 โ€” UAX31
    • =all โ€” All, the least restrictive set, which comes with all the others
  • --ignore โ€” ignores unsupported pragmas (this one's the default, so it's just quietly doing its thing ๐ŸŒธ).
  • --lib โ€” creates a static library.
  • --linkonce-templates โ€” uses discardable linkonce_odr linkage for template symbols, and lazily & recursively defines all referenced instantiated symbols in each object file.
  • --linkonce-templates-aggressive โ€” the experimental, more aggressive variant of the above ๐Ÿ‘€
  • --lowmem โ€” enables the garbage collector for the LDC front-end. This brings the compiler's memory requirements down but makes compile times go up ๐Ÿ“ˆ
  • --lto-aix-system-assembler=<path> โ€” the path to a system assembler, and it's only picked up on AIX.
  • --lto-pass-remarks-filter=<regex> โ€” only records 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> โ€” the output filename for pass remarks.
  • --m32 โ€” 32 bit target
  • --m64 โ€” 64 bit target
  • --mabi=<string> โ€” the name of the ABI to be targeted from the backend.
  • --main โ€” adds a default main() if there isn't one already (e.g. for unittesting, cute โœจ).
  • --makedeps[=<filename>] โ€” writes module dependencies in Makefile compatible format to <filename>/stdout (only imports).
  • --march=<string> โ€” the architecture to generate code for (see --version).
  • --mattr=<a1,+a2,-a3,...> โ€” target specific attributes (-mattr=help for details).
  • --mcpu=<cpu-name> โ€” targets a specific cpu type (-mcpu=help for details).
  • --mdcompute-file-prefix=<prefix> โ€” a prefix to prepend to the generated kernel files.
  • --mdcompute-targets=<targets> โ€” generates code for the specified DCompute target list. Use 'ocl-xy0' for OpenCL x.y, and 'cuda-xy0' for CUDA CC x.y.
  • --mixin=<filename> โ€” expands and saves mixins to <filename>.
  • --mtriple=<string> โ€” overrides the target triple.
  • --mv=<<package.module>=<filespec>> โ€” uses <filespec> as the source file for <package.module>.
  • --noasm โ€” disallows use of the inline assembler.
  • --nogc โ€” doesn't allow code that generates implicit garbage collector calls.
  • --o- โ€” does not write an object file.
  • --od=<directory> โ€” writes object files to <directory>.
  • --of=<filename> โ€” uses <filename> as the output file name.
  • --op โ€” preserves the source path for output files.
  • --oq โ€” writes object files with fully qualified names.
  • --output-bc โ€” write LLVM bitcode
  • --output-ll โ€” write LLVM IR
  • --output-mlir โ€” write MLIR
  • --output-o โ€” write native object
  • --output-s โ€” write native assembly
  • --plugin=<dynamic_library.so,lib2.so> โ€” passes plugins to load.
  • --preview=<name> โ€” enables an upcoming language change identified by <name>, and honestly just use ? to get the list ๐Ÿ”ฎ
  • --release โ€” compiles a release version, defaulting to disabled asserts/contracts/invariants, and bounds checks in @safe functions only.
  • --relocation-model=<value> โ€” chooses the relocation model:
    • =static โ€” Non-relocatable code
    • =pic โ€” Fully relocatable, position independent code
    • =dynamic-no-pic โ€” Relocatable external references, non-relocatable code
    • =ropi โ€” Code and read-only data relocatable, accessed PC-relative
    • =rwpi โ€” Read-write data relocatable, accessed relative to static base
    • =ropi-rwpi โ€” Combination of ropi and rwpi
  • --revert=<name> โ€” undoes a language change, and <name> tells it which one you mean. don't know the names? pass ? and it'll list them for you. ๐Ÿ’…
  • --run <string>... โ€” runs the program you just built, passing whatever else you tacked on along to it. so the leftover args become the program's args, no cap.
  • --shared โ€” creates a shared library (i.e. a DLL). ๐ŸŽ€
  • --singleobj โ€” creates only a single output object file. that's the whole vibe, one object, periodt.
  • --template-depth=<uint> โ€” sets the maximum number of nested template instantiations. keep it cute, don't recurse forever.
  • --threads=<int> โ€” literally no description in the original. it's just standing there. mysterious main character energy ๐Ÿ™ˆ
  • --transition=<name> โ€” helps you out with a language change identified by <name>. again, pass ? for the list. it's like --revert's more supportive cousin.
  • --unittest โ€” compiles in unit tests. ๐Ÿงช
  • --use-undef โ€” uses undef when generating programs.
  • -v โ€” verbose. tell me everything bestie ๐Ÿ—ฃ๏ธ
  • --v-cg โ€” verbose codegen.
  • --vcolumns โ€” prints character (column) numbers in diagnostics.
  • --verror-style=<value> โ€” sets the style for the file/line number annotations on compiler messages. pick your fighter:
    • =digitalmars โ€” 'file(line[,column]): message' โ€” this is the default.
    • =gnu โ€” 'file:line[:column]: message', conforming to the GNU standard used by gcc and clang.
    • =sarif โ€” generates JSON output conforming to the SARIF (Static Analysis Results Interchange Format) standard, useful for integration with tools like GitHub and other SARIF readers.
  • --verror-supplements=<uint> โ€” limits the number of supplemental messages for each error (0 means unlimited โ€” go feral).
  • --verrors=<uint> โ€” limits the number of error/deprecation messages (0 means unlimited).
  • --verrors-context โ€” shows error messages with the context of the erroring source line (including caret). the caret is lowkey iconic.
  • --verrors-spec โ€” shows errors from speculative compiles such as __traits(compiles,...).
  • --vgc โ€” lists all gc allocations, including hidden ones. ๐Ÿ‘€ nothing escapes.
  • --vtemplates โ€” lists statistics on template instantiations. want more? use -vtemplates=list-instances to additionally show all instantiation contexts for each template.
  • --vv โ€” prints the front-end/glue code debug log.

Warnings: โš ๏ธ

  • -w โ€” enables warnings as errors, meaning compilation will halt. it's giving stern.
  • --wi โ€” enables warnings as messages, so compilation will continue. soft launch energy.

Generic Options: ๐Ÿ› ๏ธ

  • --help โ€” displays available options (--help-hidden for more).
  • --help-list โ€” displays a list of available options (--help-list-hidden for more).
  • --version โ€” displays the version of this program.

Linking options: ๐Ÿ”—

  • -L <linkerflag> โ€” passes <linkerflag> to the linker.
  • --Xcc=<ccflag> โ€” passes <ccflag> to GCC/Clang for linking/preprocessing.
  • --defaultlib=<lib1,lib2,...> โ€” the default libraries to link with (overrides previous). note: it overrides, it doesn't append, bestie.
  • --disable-linker-strip-dead โ€” do not try to remove unused symbols during linking.
  • --gcc=<gcc|clang|...> โ€” the C compiler to use for linking (and external assembling). defaults to the CC environment variable if it's set, otherwise to cc.
  • --link-defaultlib-debug โ€” links with debug versions of the default libraries.
  • --link-defaultlib-shared โ€” links with shared versions of the default libraries. defaults to true when generating a shared library (-shared).
  • --linker=<lld-link|lld|gold|bfd|...> โ€” sets the linker to use. when explicitly set to '' (nothing), it prevents LDC from passing -fuse-ld to cc.
  • --mscrtlib=<libcmt[d]|msvcrt[d]> โ€” the MS C runtime library to link with.
  • --platformlib=<lib1,lib2,...> โ€” platform libraries to link with (overrides previous).
  • --static โ€” creates a statically linked binary, including all system dependencies. absolute unit of a binary

Polly Options: Configure the polly loop optimizer ๐Ÿฆœ

  • --polly โ€” enables the polly optimizer (works with -O1, -O2 or -O3).
  • --polly-2nd-level-tiling โ€” enables a 2nd level loop of loop tiling. loops on loops, we love to see it.
  • --polly-ast-print-accesses โ€” prints memory access functions.
  • --polly-context=<isl parameter set> โ€” provides 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> โ€” the maximum number of isl operations to invest for lifetime analysis; 0 = no limit.
  • --polly-detect-full-functions โ€” allows the detection of full functions.
  • --polly-enable-simplify โ€” simplifies SCoP after optimizations.
  • --polly-ignore-func=<string> โ€” ignores 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-matmul-opt โ€” performs optimizations of matrix multiplications based on pattern matching.
  • --polly-on-isl-error-abort โ€” abort if an isl error is encountered. no chill mode.
  • --polly-only-func=<string> โ€” only runs 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 runs on certain regions (the provided identifier must appear in the name of the region's entry block).
  • --polly-only-scop-detection โ€” only runs scop detection, but no other optimizations.
  • --polly-optimized-scops โ€” Polly โ€” dumps 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 โ€” generates thread parallel code (isl codegen only).
  • --polly-parallel-force โ€” forces generation of thread parallel code, ignoring any cost model.
  • --polly-pattern-matching-based-opts โ€” performs optimizations based on pattern matching.
  • --polly-postopts โ€” applies post-rescheduling optimizations such as tiling (requires -polly-reschedule).
  • --polly-pragma-based-opts โ€” applies user-directed transformation from metadata.
  • --polly-pragma-ignore-depcheck โ€” skips the dependency check for pragma-based transformations.
  • --polly-process-unprofitable โ€” processes scops that are unlikely to benefit from Polly optimizations.
  • --polly-register-tiling โ€” enables register tiling.
  • --polly-report โ€” prints information about the activities of Polly. gossip, but for the optimizer.
  • --polly-reschedule โ€” optimizes SCoPs using ISL.
  • --polly-show โ€” highlights the code regions that will be optimized in a (CFG BBs and LLVM-IR instructions).
  • --polly-show-only โ€” highlights 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 โ€” performs optimizations of tensor contractions based on pattern matching.
  • --polly-tiling โ€” enables loop tiling.
  • --polly-vectorizer=<value> โ€” selects the vectorization strategy:
    • =none โ€” no Vectorization.
    • =stripmine โ€” strip-mine outer loops for the loop-vectorizer to trigger.

okay a couple of housekeeping notes before we move on ๐Ÿ‘‡

-d-debug can also be specified without options, in which case it enables all debug checks (i.e. asserts, boundschecks, contracts and invariants) as well as acting as -d-debug=1.

Boolean options can take an optional value, e.g., -link-defaultlib-shared=<true,false>. Boolean options marked with (*) also have a -disable-FOO variant with inverted meaning.


so, the whole thing is:

based on DMD v2.112.1 and LLVM 19.1.7 built with LDC - the LLVM D compiler (1.42.0) Default target: x86_64-pc-linux-gnu Host CPU: skylake https://dlang.org - https://wiki.dlang.org/LDC

Registered Targets: ๐ŸŽฏ

  • aarch64 โ€” AArch64 (little endian)
  • aarch64_32 โ€” AArch64 (little endian ILP32)
  • aarch64_be โ€” AArch64 (big endian)
  • amdgcn โ€” AMD GCN GPUs
  • arm โ€” ARM
  • arm64 โ€” ARM64 (little endian)
  • arm64_32 โ€” ARM64 (little endian ILP32)
  • armeb โ€” ARM (big endian)
  • avr โ€” Atmel AVR Microcontroller
  • bpf โ€” BPF (host endian)
  • bpfeb โ€” BPF (big endian)
  • bpfel โ€” BPF (little endian)
  • hexagon โ€” Hexagon
  • lanai โ€” Lanai

โ€ฆand the list keeps going, bestie, because there are so many more targets ๐Ÿ’… buckle up:

  • loongarch32 โ€” 32-bit LoongArch
  • loongarch64 โ€” 64-bit LoongArch
  • m68k โ€” Motorola 68000 family
  • mips โ€” MIPS (32-bit big endian)
  • mips64 โ€” MIPS (64-bit big endian)
  • mips64el โ€” MIPS (64-bit little endian)
  • mipsel โ€” MIPS (32-bit little endian)
  • msp430 โ€” MSP430 โ€” [experimental] so don't come for me if it's weird
  • nvptx โ€” NVIDIA PTX 32-bit
  • nvptx64 โ€” NVIDIA PTX 64-bit
  • ppc32 โ€” PowerPC 32
  • ppc32le โ€” PowerPC 32 LE
  • ppc64 โ€” PowerPC 64
  • ppc64le โ€” PowerPC 64 LE
  • r600 โ€” AMD GPUs HD2XXX-HD6XXX
  • riscv32 โ€” 32-bit RISC-V
  • riscv64 โ€” 64-bit RISC-V
  • sparc โ€” Sparc
  • sparcel โ€” Sparc LE
  • sparcv9 โ€” Sparc V9
  • systemz โ€” SystemZ
  • thumb โ€” Thumb
  • thumbeb โ€” Thumb (big endian)
  • ve โ€” VE
  • wasm32 โ€” WebAssembly 32-bit
  • wasm64 โ€” WebAssembly 64-bit
  • x86 โ€” 32-bit X86: Pentium-Pro and above
  • x86-64 โ€” 64-bit X86: EM64T and AMD64
  • xcore โ€” XCore
  • xtensa โ€” Xtensa 32

okay that's it, that's the page, we made it to the end together ๐Ÿซถ no cap, there is literally nothing else hiding down here. this edition is LDC 1.42.0, dated June 2026 โ€” go compile something iconic with it, you absolute legend ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from