They should move all their tooling for processes more advanced than what China and Russia are capable of producing to a safer country, that way, if China does invade, they won't be getting technology any better than what they already have.
Right now, the world is highly dependent on Taiwan's advanced fabs. This gives everyone a reason to care greatly what happens to it. If Taiwan took the source of its most valuable exports and moved it to a 3rd country, it would mostly eliminate the main reason for anyone caring what happens to it. China wants Taiwan either way, but Taiwan needs the rest of the world to be invested in its independence. You should try thinking about this from Taiwan's perspective.
If China invades Taiwan, NVIDIA and AMD are basically done, because where else are they going to produce their GPU's, if not at TSMC's fabs?
AMD is currently fabbing some of its chips at TSMC's Arizona fab, as is Apple. It's a fair question just how independent that fab is from the "mother ship", however. AMD has also been dabbling with Samsung, whom Nvidia is also rumored to be going back to (Ampere was made on Samsung 8nm).
And then there's Intel's foundry. Gelsinger said he welcomed Nvidia and AMD fabbing their chips there. I can understand why they're reluctant to do so, but I think they'd do it in a pinch.
Samsung? South Korea is hardly safer than Taiwan,
That'd be a whole different ball game, if war broke out on the Korean peninsula. Currently, nobody is predicting that. Also, like TSMC, Samsung also has fabs in the US and Japan.
BTW, you forgot about Japan's semiconductor industry, which most notably includes Rapidus.