| ✅ |
O0001 |
Constant folding |
Folds pure integral expressions at the emitter, wrapped to the bound type (bit-equal to the runtime ALU). |
| ✅ |
O0002 |
Dead-code / dead-store elimination |
Drops unreachable statements (SimplifyCfg, Dce) and, over SSA, removes stores whose value is never really read (DeadStoreElim). |
| ✅ |
O0003 |
Common-subexpression elimination |
Block-local CSE, with inheritance into dominated branches, past merges and through loop preheaders (Gvn). |
| ✅ |
O0004 |
Strength reduction |
x * 2^n, x \ 2^n, x MOD 2^n lower to shift/mask sequences (with PB’s truncation fix-ups); richer multiplier shapes under $OPTIMIZE SPEED; subscript scaling becomes shifts, not the 80186 IMUL r,r,imm. |
| ✅ |
O0005 |
Register residency |
Keeps a FOR counter in SI and a hot integer accumulator in DI across a loop; nested counters, DO loops and dual accumulators included. |
| ✅ |
O0006 |
Procedure inlining |
Inlines a small leaf SUB/FUNCTION body at its call sites; a procedure inlined everywhere is purged from the image. |
| ✅ |
O0007 |
Loop unrolling |
Fully unrolls small constant-trip INTEGER FOR loops under $OPTIMIZE SPEED. |
| ✅ |
O0008 |
Peephole / zero-idiom |
XOR r,r for zero, immediate-folded ALU ops, INC/DEC and OR AX,AX collapses (16- and 32-bit paths). |
| ✅ |
O0009 |
String-temp economy |
Folds literal concatenations into one pooled literal; self-append grows the topmost heap block in place instead of recopying. |
| 🟡 |
O0010 |
Redundant-statement / statement coalescing |
Drops a DEF SEG/LOCATE whose window contains only segment-transparent statements. |
| 🟡 |
O0011 |
Literal overlap pooling |
Proven contained literals share bytes in the common IR, including C/LLVM output; partial overlaps remain open. |
| 🟡 |
O0012 |
Float demotion |
Re-types accidental SINGLE/DOUBLE loop counters back to INTEGER/LONG when every use is value-exact (FloatDemotion). |
| ✅ |
O0013 |
Promotion lowering |
PB computes + - * over integral operands in floating point; those trees run on the plain 16- or 32-bit ALU whenever that is bit-identical. |
| 🟡 |
O0014 |
Tail-call optimization |
A tail self-call jumps to frame entry, a tail CALL B reuses the caller’s frame — recursion in constant stack space. |
| 🟡 |
O0015 |
UDT zero-cost copy/compare |
Word/DWORD-wide block copy & compare; self-copy elided, self-compare folded. |
| 🟡 |
O0016 |
Value-fact analysis (ranges, bits, congruences) |
Three domains per value remove provably-safe $ERROR checks, fold impossible comparisons, drop identity operations and narrow 32-bit work onto the 16-bit ALU. |
| ✅ |
O0017 |
SCCP / branch folding |
Sparse conditional constant propagation over SSA folds constant branches and proves zero-initialized reads (Ssa/Sccp). |
| ✅ |
O0018 |
Interprocedural constant propagation |
A parameter that is the same constant at every call site and never written reads as that literal inside the callee (IpConstantProp). |
| ✅ |
O0019 |
Definite-assignment zero elision |
Drops per-invocation frame zeroing when a straight-line proof shows no local is read before assignment. |
| 🟡 |
O0020 |
Algorithmic idiom replacement |
Removes unobserved computation loops, recognizes constant fill and arithmetic series; preserves source-empty waits. |
| ✅ |
O0021 |
Register parameters |
Fully-owned word, near-pointer and LONG parameters use Watcom’s AX/DX/BX/CX allocation before stack overflow. |
| ✅ |
O0022 |
Dead procedure elimination |
Procedures unreachable from the program entry are not emitted, transitively (GlobalDce). |
| 🟡 |
O0023 |
Dead global / data tree-shaking |
A module global nothing reachable ever reads stops being a data cell: LocalizeGlobals turns a write-first global one procedure uses into a local, which Mem2Reg/Dce then remove. |
| ✅ |
O0024 |
Multi-concat single allocation |
Three or more concatenated strings build with one heap allocation and one copy per operand instead of N−1 allocations. |
| ✅ |
O0025 |
Pure-function compile-time evaluation |
An inferred-pure integer FUNCTION called with constant arguments is interpreted at compile time and replaced by the literal (PureCallEvaluation). |
| ✅ |
O0026 |
Auto-vectorization |
FOR i: c(i) = a(i) OP b(i) over 2-byte arrays becomes 4/8/16/32-wide MMX/SSE2/AVX/AVX-512 with a scalar tail. |
| ✅ |
O0027 |
Copy propagation |
A copy y = x redirects reads of y to x’s cell and drops the copy (Mem2Reg, Gvn, Dce). |
| ✅ |
O0028 |
Loop-invariant code motion |
Hoists a pure loop-invariant subexpression to the FOR/DO preheader under $OPTIMIZE SPEED. |
| ✅ |
O0029 |
SELECT CASE → jump table |
A dense integer SELECT CASE dispatches through a word jump table instead of a compare chain. |
| ✅ |
O0030 |
Induction-variable strength reduction |
An array loop steps a pointer by the element size instead of recomputing base + (i−lbound)*size each iteration. |
| ✅ |
O0031 |
Branch fusion |
A comparison that is a condition drives the branch on its own flags — no −1/0 truth value is materialized. |
| ✅ |
O0032 |
Short-circuit AND/OR/NOT |
An AND/OR tree of comparisons over pure operands becomes a chain of branches instead of bitwise truth-value arithmetic. |
| ✅ |
O0033 |
Constant store as immediate |
x = <constant> writes the immediate straight into the cell instead of staging it through the accumulator (or the FPU). |
| ✅ |
O0034 |
Redundant-load elimination |
MOV [BP-8],AX … MOV AX,[BP-8] drops the reload — the register still holds the value (Asm/Assembler.LoadForward.cs). |
| ✅ |
O0035 |
Jump relaxation & threading |
Forward branches take the 2-byte short form, and a JMP to the next instruction disappears. |
| ✅ |
O0036 |
Constant subscript folding |
a(7) on a static array is a bare displacement — the whole scale-and-add sequence disappears. |
| ⬜ |
O0037 |
Fixed-point FOR counters |
A float counter on a power-of-two-fraction grid runs as a scaled 16-bit integer — CMP instead of FCOM/FSTSW/SAHF. |
| ✅ |
O0038 |
Instruction scheduling |
The final byte stream is reordered inside fixup-free windows to issue loads first and cluster memory/ALU work (output-preserving). |
| ✅ |
O0039 |
Inline-asm scheduling |
A run of ! lines is reordered by a conservative dependency model so independent chains interleave. |
| ✅ |
O0040 |
Identical-code folding |
Byte- and fixup-identical procedure regions fold to one copy under $OPTIMIZE SIZE (Assembler.TailMerge). |
| ✅ |
O0041 |
Branch layout & loop alignment |
Forward-not-taken / backward-taken layout by construction; hot loop tops NOP-pad to 16 bytes under $CPU 80486+. |
| ✅ |
O0042 |
IR: mem2reg |
Promotes stack slots to SSA values with phis at the iterated dominance frontier (Ir/Passes/Mem2Reg.cs). |
| ✅ |
O0043 |
IR: instruction combining |
Constant folding plus the algebraic identities (x+0, x*1, x^x, …) to a fixpoint. |
| ✅ |
O0044 |
IR: SCCP |
Wegman-Zadeck constants + reachability on the IR; unreachable blocks are deleted. |
| ✅ |
O0045 |
IR: correlated value propagation |
Inside the region guarded by x = C, every use of x becomes C. |
| ✅ |
O0046 |
IR: global value numbering |
Congruent pure computations collapse to the dominating leader across blocks. |
| ✅ |
O0047 |
IR: load/store forwarding |
A load returns the value most recently stored to the same address; repeated loads reuse the first. |
| ✅ |
O0048 |
IR: dead-store elimination |
A store overwritten before any possible observation is removed. |
| ✅ |
O0049 |
IR: loop-invariant code motion |
Pure, non-trapping loop-invariant instructions sink into the preheader. |
| ✅ |
O0050 |
IR: dead-code elimination |
Instructions with no users and no side effects disappear, cascading through operands. |
| ✅ |
O0051 |
IR: if-conversion |
A branchless diamond becomes select — two branches and a join removed. |
| ✅ |
O0052 |
IR: CFG simplification |
Trivial phis collapse and single-predecessor blocks splice into their predecessor. |
| ✅ |
O0053 |
IR: function inlining |
Direct calls to non-recursive callees within a size budget are cloned into the caller. |
| ✅ |
O0054 |
IR: global DCE |
Unreferenced functions and globals are removed from the module, to a fixpoint. |
| ✅ |
O0055 |
IR: integer recovery |
The float form of PB’s integral + - * is rewritten back to integer arithmetic for the IR back ends. |
| 🟡 |
O0056 |
Reciprocal-multiply division |
x \ 10 becomes a magic-number multiply plus a shift instead of the runtime divide. |
| 🟡 |
O0057 |
Storage narrowing |
A value whose facts prove it fits a narrower type is stored as one, converting only at the boundaries. |
| ⬜ |
O0058 |
386/486 register allocation |
Several hot LONG/INTEGER locals resident at once in EAX–EDX/ESI/EDI, plus 8-bit sub-register packing. |
| 🟡 |
O0059 |
Scalar replacement of aggregates |
A non-escaping TYPE decomposes into independent field variables that allocate like plain locals. |
| ✅ |
O0060 |
Memory SSA / alias analysis |
Dependency edges for loads and stores, so loads hoist and GVN sees through memory. |
| 🟡 |
O0061 |
Reassociation |
Integer chains reassociate to expose common subexpressions and LEA shapes. |
| 🟡 |
O0062 |
Loop rotation, IV simplification, fusion |
Rotate pre-test loops, simplify derived induction variables, fuse adjacent same-trip loops. |
| ✅ |
O0063 |
Duff’s-device unrolling |
Variable-trip loops unroll by 2/4/8 with a computed-jump entry instead of a scalar prologue. |
| ✅ |
O0064 |
LEA multiply-add fusion |
a + b + const becomes one LEA; scaled 386 forms cover x*3, x*5, x*9 and y*320+x. |
| 🟡 |
O0065 |
Dead frame-store elimination |
Once load forwarding removes a spill cell’s last reader, the store into it is dead. |
| ✅ |
O0066 |
Unrolled-counter propagation |
Each unrolled copy sees its counter as a literal, so subscripts and arithmetic fold. |
| ✅ |
O0067 |
IF-chain → jump table |
A chain of mutually exclusive IF x = k tests dispatches like a dense SELECT CASE. |
| 🟡 |
O0068 |
Array zero-fill elision |
Skip an array’s allocation zero-fill when an initializing loop provably dominates every read. |
| ✅ |
O0069 |
Dead parameters & call-shape cloning |
Drop parameters no callee reads; clone a procedure for a single dominant argument shape. |
| 🟡 |
O0070 |
Leaf-frame elision |
IR-routed procedures with no surviving fixed stack slots can omit the BP frame; 8086 stack-parameter cases still need BP. |
| ⬜ |
O0071 |
Segment-register allocation |
Pin ES to the string/array heap across a statement run instead of reloading per access. |
| ⬜ |
O0072 |
Register reassignment |
Break the AX-centric serialization so independent statement chains interleave across registers. |
| ⬜ |
O0073 |
Wider idiom catalog |
MIN/MAX scans, bubble-sort shapes → ARRAY SORT, series and fill recognitions beyond the first wave. |
| ⬜ |
O0074 |
Wider auto-vectorization |
Reductions, a(i) OP scalar, 4-byte elements and the SSE/AVX widths of the existing recognizer. |
| ⬜ |
O0075 |
Silent fixed-point arithmetic |
Float chains carrying a provable constant scale compute in scaled LONG and convert at the observation boundary. |
| ✅ |
O0076 |
Algebraic identities & annihilators |
x+0, x*1, x AND -1 fold to x; x*0, x AND 0, x MOD 1 fold to zero when the operand is discardable. |
| 🟡 |
O0077 |
Negation idioms |
0-x and x*-1 become NEG, -(-x) disappears — with the -32768 semantics preserved. |
| 🟡 |
O0078 |
General multiply decomposition |
Any small constant multiplier lowers to a shift/add chain chosen by the target cost model. |
| ✅ |
O0079 |
Shared divide |
n \ d and n MOD d come from one IDIV’s AX and DX instead of two divides. |
| 🟡 |
O0080 |
Division special cases |
\ 1, MOD 1, \ -1, and divisors beyond the proven dividend range fold away; MOD 2^n masks for any provably non-negative value. |
| ✅ |
O0081 |
Flag reuse |
CMP x,0 becomes TEST x,x — or disappears entirely when the preceding ALU op already set the flags. |
| ✅ |
O0082 |
Memory operand folding |
MOV AX,[x] / ADD DI,AX becomes ADD DI,[x] as a general lowering rule, not per loop shape. |
| ✅ |
O0083 |
Store-to-load forwarding |
MOV [n],AX / MOV AX,[n] — the reload is dropped, the accumulator already holds the value. |
| ⬜ |
O0084 |
Cross-statement register caching |
A local read repeatedly across consecutive statements is loaded once into a register. |
| ✅ |
O0085 |
Register copy coalescing |
MOV BX,AX disappears when producer and consumer can share one register. |
| ⬜ |
O0086 |
Spill-slot reuse |
Temporaries with disjoint live ranges share one frame cell, shrinking the frame and its zero fill. |
| ⬜ |
O0087 |
Rematerialization |
Recompute a cheap constant or address instead of spilling and reloading it. |
| ✅ |
O0088 |
Branchless truth values |
A genuinely needed −1/0 comes from SBB AX,AX / SETcc instead of a branch pair. |
| 🟡 |
O0089 |
Extension elimination |
A CBW/CWD/zero-extend whose result the known bits already guarantee is dropped. |
| 🟡 |
O0090 |
Demanded bits |
Compute only the bits consumers observe; a truncation pushes into its producer. |
| ⬜ |
O0091 |
Partial-register hazards |
Avoid byte/word write mixes and false dependencies on the targets where they stall. |
| 🟡 |
O0092 |
Encoding selection |
Choose encodings by bytes, micro-ops and decode width — per target, not universally. |
| ✅ |
O0093 |
Jump threading |
A branch whose target is itself a jump goes straight to the final destination. |
| ⬜ |
O0094 |
Branch inversion |
Invert the condition and swap the arms where that removes the arm-closing JMP. |
| ⬜ |
O0095 |
Branch-tail merging |
Identical suffixes of THEN/ELSE/CASE arms are emitted once. |
| ✅ |
O0096 |
Nested condition combining |
IF a THEN IF b THEN becomes one branch chain with no intermediate block. |
| ✅ |
O0097 |
Repeated comparison elimination |
The same unchanged condition is not tested twice along a path. |
| 🟡 |
O0098 |
Balanced decision tree |
A sparse SELECT CASE dispatches in O(log n) compares instead of a linear chain. |
| 🟡 |
O0099 |
Bit-test dispatch |
Membership in a small constant set becomes a mask shift and a bit test. |
| 🟡 |
O0100 |
Perfect-hash dispatch |
A sparse case set maps through a collision-free arithmetic hash plus one verifying compare. |
| 🟡 |
O0101 |
Jump-table sharing & compression |
Nested dispatches share a range check; tables use byte offsets where the span allows. |
| 🟡 |
O0102 |
Return-value forwarding |
The final expression computes straight into the return register, with no result slot. |
| ⬜ |
O0103 |
Shared epilogue |
Several exits route through one teardown — without a jump from the block already adjacent to it. |
| ⬜ |
O0104 |
Block placement |
Infer edge probabilities and lay the common path out as one fall-through run. |
| ⬜ |
O0105 |
Hot/cold splitting |
Error and diagnostic arms move out of the hot instruction stream. |
| ⬜ |
O0106 |
Trace formation |
Tail-duplicate small joins into superblocks so scheduling and CSE reach further. |
| 🟡 |
O0107 |
Branch folding through phi |
Specialize a join where the incoming edges already decide the branch. |
| 🟡 |
O0108 |
Branchless select / min / max / abs |
Short data-dependent branches become mask arithmetic or CMOV. |
| ⬜ |
O0109 |
Macro-fusion placement |
Keep CMP/TEST adjacent to its branch on cores that fuse them — the opposite of what an 8086 wants. |
| ⬜ |
O0110 |
General induction variables |
Any base + i*stride becomes an incrementally stepped value, not only the recognized array shapes. |
| 🟡 |
O0111 |
Redundant IV elimination |
Loop variables that advance in lockstep collapse to one. |
| ⬜ |
O0112 |
Countdown loops |
A fixed-trip loop counts down with DEC/JNZ, dropping the compare entirely. |
| 🟡 |
O0113 |
Loop bounds in registers |
The limit and step are held across the loop instead of reloaded per iteration. |
| ✅ |
O0114 |
Loop unswitching |
An invariant conditional moves out of the loop and each cloned body is specialized. |
| ⬜ |
O0115 |
Loop peeling |
Peel the first iteration to remove its special-case branch from the rest. |
| ✅ |
O0116 |
Loop guard hoisting |
Test the zero-trip case once, then run a bottom-tested loop with no separate back-edge jump. |
| ⬜ |
O0117 |
Bounds-check merging & hoisting |
Several accesses on one index need one check; a loop-invariant check hoists to the preheader. |
| ⬜ |
O0118 |
Loop dead stores |
A store the next iteration overwrites happens once, after the loop. |
| ⬜ |
O0119 |
Reduction recognition |
Sum, product, min, max, AND, OR, XOR folds are classified as reductions, not arbitrary dependencies. |
| ⬜ |
O0120 |
Multiple accumulators |
Split a reduction into independent chains on pipelined targets (a loss on an 8086). |
| ⬜ |
O0121 |
Reduction tree balancing |
A long associative chain becomes a balanced tree, a third of the dependency depth. |
| 🟡 |
O0122 |
Loop interchange |
Swap the nesting so the inner loop walks contiguous memory. |
| ⬜ |
O0123 |
Loop distribution / fission |
Split a loop to enable vectorization or to relieve register pressure. |
| ⬜ |
O0124 |
Loop tiling |
Process multidimensional arrays in cache-sized blocks (386+ only — an 8086 has no cache). |
| ⬜ |
O0125 |
Loop skewing |
Reshape the iteration space so a diagonal dependence stops blocking the inner loop. |
| ⬜ |
O0126 |
Unroll and jam |
Unroll the outer loop and fuse the inner copies, so outer-loop values are reused. |
| ⬜ |
O0127 |
Loop interleaving |
Separate each load from its consumer across unrolled copies to hide latency. |
| ⬜ |
O0128 |
Software pipelining |
Prologue/kernel/epilogue so different iterations occupy different pipeline stages; modulo scheduling. |
| 🟡 |
O0129 |
Unroll factor by cost model |
Pick the factor from register pressure, code size, latency and trip count — not a constant 4. |
| 🟡 |
O0130 |
Trip-count versioning |
Scalar, unrolled and vector variants of a loop, selected at run time by the count. |
| ⬜ |
O0131 |
Exact trip count |
One analysis deriving the iteration count from start, end, step and PB’s wrap semantics. |
| ✅ |
O0132 |
Compile-time loop evaluation |
A finite pure loop runs at compile time and becomes initialized data. |
| ⬜ |
O0133 |
Loop prefix evaluation |
Evaluate the first iterations, then start the runtime loop from that state. |
| ✅ |
O0134 |
Recurrence shortening & closed forms |
Replace a loop-carried recurrence with its closed form where the wrap semantics permit. |
| ⬜ |
O0135 |
Loop-phi constants |
A loop-carried value that never actually changes folds; a decidable back edge collapses. |
| ⬜ |
O0136 |
Adjacent access merging |
Contiguous byte/word loads and stores become one wider access. |
| ⬜ |
O0137 |
Load widening across iterations |
One wide load feeds several unrolled bodies — profitable only if the lanes stay packed. |
| ⬜ |
O0138 |
Overlapping loads combined |
A sliding window carries the previous element forward instead of re-reading it. |
| ⬜ |
O0139 |
Alignment peeling & versioning |
Peel to a vector boundary, and only over-read where padding is provably accessible. |
| ⬜ |
O0140 |
Load hoisting & store sinking |
Move memory operations across provably non-aliasing ones. |
| ⬜ |
O0141 |
Access clustering |
Order memory operations by address for bus, cache-line and merge behavior. |
| ⬜ |
O0142 |
Non-temporal stores |
Large streaming writes bypass the cache on targets that have one. |
| ⬜ |
O0143 |
SLP vectorization |
Pack isomorphic straight-line statements, including after unrolling. |
| ⬜ |
O0144 |
Interleaved-access vectorization |
De-interleave RGB-style data with the unpack family, operate, re-interleave. |
| ⬜ |
O0145 |
Vector reduction |
Packed accumulators plus one horizontal combine — the commonest loop shape there is. |
| ⬜ |
O0146 |
Vector tails |
A runtime remainder, masked lanes, or an overlapping final vector. |
| ⬜ |
O0147 |
Vector width by cost model |
Choose MMX/SSE/AVX width by trip count, transition cost and register pressure — not just by $CPU. |
| ⬜ |
O0148 |
Packed vs widening lanes |
Stay in byte lanes when the ranges prove no lane can overflow. |
| ⬜ |
O0149 |
Saturating pack recognition |
Clamp-then-narrow becomes PACKUSWB / a saturating add. |
| ⬜ |
O0150 |
Vector compare & select |
Per-lane conditionals become masks, packed min/max and blends. |
| ⬜ |
O0151 |
Gather / scatter |
Indirect indexing vectorizes where the target has the instruction and the cost model agrees. |
| ⬜ |
O0152 |
Runtime dependence checks |
A pointer-range test at run time selects the vector path over the scalar one. |
| ⬜ |
O0153 |
SWAR packed arithmetic |
Use ordinary registers as packed byte lanes — vectorization for the 8086, which has no SIMD. |
| ⬜ |
O0154 |
SWAR search idioms |
Zero-byte detection and parallel compare for INSTR-class scans. |
| ⬜ |
O0155 |
Bit planes / bit slicing |
Boolean element arrays become wide bitwise operations, 16 or 32 elements at a time. |
| ⬜ |
O0156 |
Path-sensitive propagation |
Keep per-path value states instead of joining everything away at each merge. |
| ⬜ |
O0157 |
Relational ranges |
Track `x |
评论