The mask that compiles to nothing: how HotSpot's JIT learned to reason about bits
Summary
The article dives into how HotSpot's JIT uses known-bits analysis alongside range information to optimize bitwise operations. It explains the canonicalization loop that refines both the range and per-bit masks, enabling elimination of redundant masks like (x << 2) & -4. It also shows practical assembly-level consequences and links to OpenJDK code for transfer rules.