Entropy $S$ is a state function.
It only depends on the final and initial states, and not on how the state was reached.
The Clausius' Inequality states
$$\oint \frac{đQ_\textrm{system}}{T_\textrm{source}}\leqq 0\,.\tag{I }$$
When the cycle is reversible, $T_\textrm{source}~=~ T_\textrm{system}$ and equality of $\rm(I)$ applies i.e.,
$$\oint \frac{đQ_\textrm{system}}{T_\textrm{system}} = 0\tag{I.i}$$
It is a matter of few steps from $\rm(I.i)$ to show that the integral $\displaystyle\int \dfrac{đQ}{T}$ takes the same value for two different reversible paths.
So, we can define $S(\rm A) = \displaystyle\int_{\rm O_\textrm{reference state}}^{\rm A}~ \dfrac{đQ_\textrm{rev}}{T_\textrm{system}}$ i.e., for a reversible transformation.
Now, consider two paths equilibrium states $\rm A$ and $\rm B$ such that $\mathsf I$ connecting $\rm A$and $\rm B$ is arbitrary path (reversible or irreversible) and the second path $\mathsf I^\prime$ connecting $\rm B$ and $\rm A$ is reversible.
So, using $\rm(I),$ we get
$$\begin{align} \oint_{\mathrm A \mathsf I \mathrm B \mathsf{^\prime}\mathrm A } \frac{đQ}{T} & \leqq 0 \\ \implies~~~~~~~~~~~~~~~ \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}} + \left (\int_{\mathrm B}^{\mathrm A} \frac{đQ}{T}\right)_{\mathsf{I^\prime}} & \leqq 0\\\implies \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}} - \left[\int_{\mathrm O}^{\mathrm B}\frac{đQ}{T}-\int_{\mathrm O}^{\mathrm A} \frac{đQ}{T}\right]&\leqq 0~~~~~~~~~~~~~~~~~~~~~(\mathsf I^\prime~\textrm{is reversible})\\ \implies~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ S(\mathrm B)- S(\mathrm A)&\geqq \left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}}\tag{II}\end{align}$$
From $\rm (II)$
$$S(\mathrm B)-S(\mathrm A)~=~\left (\int_{\mathrm A}^{\mathrm B} \frac{đQ}{T}\right)_{\mathsf{I}}~~~\textrm{iff}~~~\mathsf I ~\textrm{is a reversible transformation}$$ that is, $$S(\mathrm B)-S(\mathrm A)~=~\int_{\mathrm A}^{\mathrm B} \frac{đQ_\textrm{rev}}{T}\tag{III.i}$$
When $\sf{ I}$ is irreversible, then from $\rm{(II)}$
$$S(\mathrm B)-S(\mathrm A)\gt \int_{\mathrm A}^{\mathrm B} \frac{đQ_\textrm{irrev}}{T}$$
More precisely, using the first law $$\mathrm dS= \dfrac{\textrm{đ} q_\textrm{irrev}}{T}+ \dfrac{\left [ \textrm{đ} w_\textrm{rev}-\textrm{đ} w_\textrm{irrev}\right]}{T}\;.\tag{III.ii}$$
Both $\rm{(III.i)}$ and $\rm{(III.ii)}$ would yield the same entropy change as after-all entropy $S$ is a state function.
But which of $\rm{(III.i)}$ and $\rm{(III.ii)}$ would one use to compute the change in entropy?
Think.
References:
$\bullet$ Thermodynamics by Enrico Fermi.