The world's largest contract chipmaker, whose customers include Apple and Nvidia,has benefited from the surge towards AI.