For thousands of Bay Area techies blessed to be working for benevolent behemoths like Google (GOOG) and Facebook, there could be an end to the free lunch. And the free shuttle to work. And maybe even the free haircut.

As firms pile on benefits to attract and retain the brightest of the bright, it has increasingly been part of the job description of Silicon Valley tech workers that they be pampered nearly to death with perks. But now the IRS is reportedly examining whether free food — and the other free perks — provided by Silicon Valley tech companies qualifies as a fringe benefit on which employees should pay additional tax.

And that set off a great grumbling that could be heard from San Jose to San Francisco.

“It would be stupid to tax this food,” said Sanjeev Agrawal, who ran product marketing for Google from 2003 to 2005 and whose Googler-wife still enjoys the perks today. “Free meals should not be taxed because they’re not compensation. They’re a phenomenal convenience, a terrific motivator and a great social thing because it gives employees an easy way to meet and pass ideas back and forth.”

Great social things aside, the debate is growing within the IRS and among tax experts over whether employees should be taxed for these freebies, or whether the perks should be considered “noncompensatory” and therefore nontaxable, according to The Wall Street Journal.

Some experts say companies like Google are dodging the rules and that in some ways taxpayers are unfairly underwriting free meals for already handsomely paid geeks.

“With the IRS looking for places to reduce any special exclusions to what businesses can write off, it might just start cutting this back,” said Annette Nellen, an accounting and taxation professor at San Jose State. “But this whole issue gets pretty complex; how do you define what qualifies as a work-related meal and what doesn’t? And if Google employees are packing up free food and taking it home to eat, then that doesn’t really seem fair, does it?

“If these companies see the IRS seriously looking at this, they may take a closer look themselves and start to change their own practices.”

Others say that would be unfortunate. But the fact that the IRS is taking a closer look could mean the days of “spicy she-crab soup and grilled steak with chimichurri sauce” served complimentary at Facebook’s Café Epic could be numbered.

The IRS would not comment. Neither would Google, Facebook, Zynga or Twitter, all of which are guilty of fattening their workers with gourmet giveaways. But from the perspective of those accustomed to hogging out freely at the tech trough, denying workers what Gourmet magazine called the “mouthwatering free food” at the Googleplex, including delicacies like “porcini-encrusted grass-fed beef,” would be the valley equivalent of indentured servitude.

“From a cultural perspective,” Agrawal said, “the free meals are one of those soft factors that encourage team-building. When I was at Google, we’d all meet for lunch at Charlie’s Café, where we could share a real sense of belonging to a place.”

That cafe would be the namesake of Charlie Ayers, Google’s founding chef who left to start his own restaurant in 2005 and has been an evangelist for the corporate free-food movement ever since.

“The free meals were a hiring tool and an integral part of Google’s infrastructure, embedded right into the corporate culture,” said Ayers, a former chef for the Grateful Dead who has helped create dining programs for LinkedIn and 10 other Bay Area firms. “The company that eats together makes money together. There’s simply no better way to cross-pollinate ideas than over the dining table, and I try to preach that idea to every company in the valley.

“And these meals should not be taxed,” he said. “Taxing the food would kill these programs.”

Contact Patrick May at 408-920-5689; follow him at Twitter.com/patmaymerc.