AI hiring frenzy to fuel layoffs in other tech segments as firms strive to balance costs