Cache primality checks