TL:DR: Set boundaries.
This is not at all uncommon, and because of that, it takes a fair amount of insight to label yelling as abuse, but abuse it is. You're asking if witnessing abuse is bad for your daughter, and you already suspect that it is (which is true), so what is the best way to handle it?
You have listed two options: put up with it and hope for the best, or limit your daughter's exposure to your mother. Regardless of the love involved all around, abuse is not something that a child should learn to tolerate. Witnessing abuse teaches a child that the world is not quite a safe place, even with those whom you love and who are supposed to love you. So limit her exposure to your mother's abuse by setting up protective fences around both of you in the form of boundaries.
Read about boundaries online and in good books until you feel you have a good handle on them. Then start applying them to your relationship with your mother.
A boundary that most people can recognize as reasonable and healthy is
You may not physically strike me. If you do, I will be forced to protect myself by separating myself from you, and if you do not seek treatment, I will protect myself by ending the relationshiip.
That's an easy one to understand because most people understand that striking others is abusive. It's harder to convince someone that yelling is abuse as well. Everyone yells from time to time, but frequent or derogatory yelling is not ok.
An unhealthy boundary is
If you don't do as I say when I say so, I can't continue to be in relationship with you.
The latter is an attempt to control a person.
Boundaries are not a means to control others; you cannot control anyone but yourself. Boundaries are a means to protect yourself and those under your protection from harmful behaviors. They are vital to healthy relationships. You need some common sense and skill to set good ones; that's why you should really familiarize yourself with them before trying to set them.
Personal boundaries are also not punishments, although your abuser will probably tell you she is being punished and that you are evil for drawing your lines in the sand.
When you know about boundaries and are convinced you have a right to be treated with respect even by the woman who gave birth to you, sit down with your mother and have a heart to heart talk, or at least a heart to ear talk. Tell her (if it's true) how much you love her, how grateful you are for all the love and blessings she has given you and those you love, and anything else you really feel is important for her to hear. Then tell her that you are concerned that her yelling is a form of disrespect to you and a bad example to set for your daughter. Tell her that as much as you love her, and as much as your daughter loves her, you can't let your daughter be exposed to her yelling. Tell her you want to see her, and you want your daughter to see her, but not when she's yelling. So from now on, when she's yelling, you will remove yourself and your daughter from her presence.
She may scoff or argue or get angry and yell. That's her choice. Yours is how you'll react. Then start doing it.
You say this happens when your mom visits. That's a harder situation to control, so change this to visiting her more or meeting her somewhere if possible. If she doesn't yell, wonderful. If she does, remind her of your talk, say you enjoyed your visit until the yelling began, tell her you love her (if you do that kind of thing) and that you look forward to your next visit (all this speaks of your love), then excuse yourself/yourselves and leave. No arguing, no pleading, no second chances; just leave. (If this happens at your home, you'll need to ask your mother to leave, which is a lot harder, but possible, and the additional benefit is that it will teach your daughter that it's okay to stand up for yourself.) Repeat as necessary.
Boundaries can be painful for the people on either side. If you love someone and value your relationship with them, you will set your boundaries carefully and respectfully, and you will honor your boundaries so that trust can be built between you and your mother about them, trust being a vital part of a good relationship.
Finally, if you're having difficulty with setting good boundaries, a counselor might be able to help you sort through these difficult issues and help you see where you should draw your boundaries. You may find something that you're much happier with than what you can come up with.
10 Ways to Build and Preserve Better Boundaries
How to set clear-cut boundaries in dysfunctional family relationships