Irreversibility and nonlocality