Technically, if you change your content based on the IPs or user agents visiting that piece of content, specifically giving GoogleBot different content than your users, that would be against Google’s cloaking policy and warrant a Google penalty. But based on the intent of that change, most likely, you won’t be penalized.
Google defines cloaking as “the practice of presenting different content or URLs to human users and search engines. Cloaking is considered a violation of Google’s Webmaster Guidelines because it provides our users with different results than they expected.”
Now, if you change parts of your page’s content for reasons beyond manipulating Google, then Google likely won’t care and likely won’t penalize you. I mean, technically, Google can penalize your site, but it likely won’t according to Gary Illyes of Google.
Gary Illyes said in a Reddit thread “I can’t promise no action, but if it’s not done for manipulating rankings or actual spamming, I’d be mighty surprised if the WebSpam team cared.”
This isn’t really new, Google generally takes into account the intent of the action before manually assigning a penalty. The intent just might not alway be obvious, although, Google’s webspam team has a lot of experience with these things.
Forum discussion at Reddit.