International Business Machines Corp. will cut thousands of workers this quarter while it continues to shift the focus of its business to higher-growth software and services.