I'd absolutely tell my current manager - he's very big on well-being.
I would have told most previous managers, too, but I might have told some of them rather less detail - certainly one of them, I knew more about what some colleagues were going through than they had told me themselves, and I expect at least two of them didn't want more being shared than health problems, rather than the actual conditions. It was pre-GDPR, but even so, you shouldn't be a gossip as a manager.
Many years ago, I was going through some personal stuff, and I wasn't comfortable talking to my direct line manager, but I spoke to his manager instead (which was rather more human.) I said I didn't know how I was going to feel about the things happening, how it would affect me. He said he wouldn't know, either, but if I had a day I felt I really couldn't manage work, to let him know, and he woukd sort it with my manager and HR. I think just knowing I had that support made things feel more manageable and less trapped by having to be in the office no matter what - which made it easier to be there.
One of my current team just forwarded me a copy of a letter from the hospital- as he said, it was easier than him trying to explain it.
We have lots of support available, and some is available with no manager input, e.g. the EAP. But there are things that it's easier to get support for and manage if the manager knows about it.
If you're just being snappy and miserable, but aren't telling anyone what's going on, a good manager will probably take you aside and enquire. But if you don't tell them, then it's more likely to be a path towards a performance improvement plan instead.