Skip to main content

can_skip_when_dead

Function can_skip_when_dead 

Source
fn can_skip_when_dead(opcode: u8) -> bool
Expand description

Returns true if the opcode’s logic is safe to skip when its outputs are dead.

This covers opcodes with no side effects beyond stack I/O and no dynamic gas. When NOOP is set the instruction is still present (static gas is charged, stack length is adjusted), only the computation is elided.

Based on solc’s SemanticInformation::movable() with additions for call-constant environment reads that are pure in EVM semantics. Excludes opcodes with dynamic gas (EXP), memory access (MLOAD, KECCAK256), storage/host reads (SLOAD, TLOAD, BALANCE, etc.), and MSIZE/GAS (position-dependent).