Impact of evolving dark energy on the search for primordial gravitational waves