A few months ago, International Business Machines (IBM) looked like collateral damage in the artificial intelligence boom.