Google, Amazon and more tech companies cut staff, invest in AI