First thing I would do on landing would be to google BBC traffic news. If either route shows an incident, let that guide you to the other one.
If no traffic incidents, I'd pick the M4, just because the onward journey from Swindon is on better roads than the single carriageway A40.