Nashville is screwed eight ways from Sunday if he retires, Montreal much less so. This article spells it out:
https://www.msn.com/en-us/sports/nhl/the-salary-cap-implications-of-a-shea-weber-early-retirement/ar-AAzKrlW
I'd imagine he uses the Pronger loophole (assuming it remains available) and just rides it out on LTIR under suspicious circumstances when it's time.