“Dolemite Is My Name” starts out as a comedy of failure and foolish hope. When we first meet him, in Los Angeles in the early ’70s, Rudy Ray Moore is a multi-hyphenate might-have-been. As he slides toward middle age, popular culture seems to be running in the other direction. His novelty R&B singles can’t even get played in the record store where he works as assistant manager. His semi-naughty stand-up routine (“What did the elephant say to the naked man?”) is too corny for a generation discovering the matter-of-fact raunchiness of Redd Foxx.

Rudy, a real-life actor, comedian and dedicated self-promoter, is played by Eddie Murphy, one of Foxx’s heirs. Murphy’s celebrity, which has faded a bit recently (he’s been scarce on the big screen for a decade or so), both overshadows Moore’s and illuminates it. For much of the movie, we’re being treated to two wildly profane, bracingly inventive performances in one.