For most of the past year, the company has been the best-performing stock among tech giants, with investors betting it was the most likely winner in the artificial intelligence boom.