If China invades, the West probably couldn't swallow Russian-style sanctions for the whole country, but it would assuredly enact sanctions related to activity in Taiwan. TSMC is not trading with China suppliers to make its chips, its trading West.
So TSMC would probably become irrelevant in due time if there were strong sanctions against China. That, and the persistent rumour that Taiwan has a plan to literally blow up the fabs if China invades gives us a picture were invading Taiwan is ideological for China, not an economic power grab.
Europe and even US still buying Russian oil through obfuscated, transshipped means as stop gap and that's a fungible commodity. Would west cut off their access to 90% of advanced nodes, where they reap most of the value add, and sustains their leading tech industries? Maybe that dependency goes down to 70% in 10 years, but maybe it's closer 100% since there's a lot of dependencies from TW industries itself.
Realistically PRC will glass most of TW defense, start a blockade and leverage continued acess to western semi to try to constrain conflict. It's not like PRC can maintain TSMC without western input. Keeping TSMC running is pretty much the only strategic goal in everyone's interest.
https://www.techspot.com/news/96291-taiwan-destroying-tsmc-e...
So TSMC would probably become irrelevant in due time if there were strong sanctions against China. That, and the persistent rumour that Taiwan has a plan to literally blow up the fabs if China invades gives us a picture were invading Taiwan is ideological for China, not an economic power grab.