They're facing a major problem, and it's partially of their own creation: there already is a wall between their content and the user searching for it. It's called Gemini. Would they be facing it if they boycotted AI early on rather than selling their user's content to Google et al? Probably not as bad. But they'd still be having problems.
Reddit's stock is down today after u/spez basically said "We're fucked" to the shareholders, pointing out there's been a dramatic reduction in web traffic, and that Gemini isn't sending them anything significant.
How enforcing logins will help is anyone's idea. But the website is dying at the moment, and it's not primarily because of Spez's utter incompetence, it's mostly because the open web is being shutdown by Big Tech in favor of slop generation. Reddit is the "Mostly open web", it relies upon the open web to exist. But the idea of posting questions and answers and discussions about specific technical things being viable as a "thing" is obsolete.
Look at Reddit today, look at r/all or r/popular, and it's primarily bot-created videos with stock sound tracks about nothing. It's a shell of its former self, and might only survive as a competitor to TikTok. And when was the last time anyone went to TikTok for anything more substantial than doomscrolling?