US stocks rose Tuesday after getting a reminder that the artificial-intelligence boom may also have an upside.