Free lunches, dry cleaning, massages—frozen eggs?

Silicon Valley’s biggest companies have long offered cushy perks to attract top talent and keep workers happy logging scores of hours on the job. But beyond day-to-day luxuries, Facebook and Apple will now give up to $20,000 in benefits to help employees pay for infertility treatments, sperm donors and even to freeze their eggs. The move comes amid stiff competition for skilled engineers, and as many of the biggest firms try to diversify their male-dominated ranks to include and appeal to more women.