Let $U$ be a smooth variety, and $U\hookrightarrow X$ an smooth compactification with snc boundary $D=X\setminus U$. Suppose that $\omega\in H^0(U,\Omega^n_U)$ is global algebraic $n$-form on $U$. It defines a class in $H^n(U,\mathbb{C})=\mathbb{H}^n(X,\Omega_X^\bullet(\log D))$.
The form $\omega$ extends to a meromorphic form on $X$, denote it by $\tilde{\omega}$. This is not necessarily an element of $H^0(X,\Omega_X^n(\log D))$, since $\tilde{\omega}$ can have poles of higher order. Is there an element $\omega'\in H^0(X,\Omega_X^n(\log D))$ such that $\omega'|_U$ defines the same cohomology class as $\omega$ in $H^n(U,\mathbb{C})$?
Here are my thoughts: the Hodge spectral sequence degenerates, and so we have $$Gr_F^i(H^n(U,\mathbb{C}))=H^{n-i}(X,\Omega^i(\log D)),$$ and so non-canonically (I believe) $$H^n(U,\mathbb{C})=\bigoplus_i H^{n-i}(X,\Omega^i(\log D)).$$ Now it seems that the class defined by $\omega$ should be contributed by the summand $H^{0}(X,\Omega^n(\log D))$, which would imply the claim. However, to prove this I think one would need something analogous to what Peters and Steenbrink call a "Hodge decomposition in the strong sense" (page 45). However, I do not know if this kind of result exists for non-compact $U$?