A film is rated according to the film manufacturer. That's the ISO - meaning the EI (Exposure Index) where you get enough shadow detail according to their tests.
If you give half the exposure by changing from 1/500th s to 1/1,000th s you will under-expose the film. You give it less light.
This means a loss of shadow detail, because shadow detail is almost solely dependent on how you expose the film.
You can compensate for this by developing longer, and you can bring your mid-tones and highlights up to look normal by doing this (exposure AND development determines mid-tones and highlights), but you can never compensate for lost shadow detail.
So, by underexposing to obtain a higher shutter speed, you sacrifice something else - shadow detail.
Instead of underexposing and compensating - try using a wider aperture and get a correct exposure. Or use a film like Ilford Delta 3200, (which is not rated by the manufacturer, but is about ISO 1000).
But if you don't have enough light to expose your film at EI 400, you have no choice. Like Frank says, it's better to get an underexposed frame rather than nothing, if the frame is important to you.
It is better practice to use the film as it was designed to be used. When people do testing of their film, most end up exposing the film at somewhere between EI 200 and 400. It varies from film to film, and some people choose to use an EI of 800, if they don't think that the extra shadow detail is worth much to them. It's a personal choice, and the film will exhibit a different look depending on your choice of exposure and processing. Testing and hard work in processing and eventually printing the negs often. Only after you print your negs often will the whole process come full circle.