Make DeleteDeadInstruction be a static function, move some code around.