  Confinement remains one the most interesting and challenging nonperturbative
phenomenon in non-Abelian gauge theories. Recent semiclassical (for SU(2)) and
lattice (for QCD) studies have suggested that confinement arises from
interactions of statistical ensembles of instanton-dyons with the Polyakov
loop. In this work, we extend studies of semiclassical ensemble of dyons to the
$SU(3)$ Yang-Mills theory. We find that such interactions do generate the
expected first-order deconfinement phase transition. The properties of the
ensemble, including correlations and topological susceptibility, are studied
over a range of temperatures above and below $T_c$. Additionally, the dyon
ensemble is studied in the Yang-Mills theory containing an extra
trace-deformation term. It is shown that such a term can cause the theory to
remain confined and even retain the same topological observables at high
temperatures.
