Use the formula of the magnetic moment of a bar magnet.
Step 1: Write the expression of the initial magnetic moment.
We have length $=1$,
Magnetic moment $= M$
Therefore
$M = ml ;$ where $m =$ pole strength
Step 2: Calculate the final magnetic moment.
Now wire of length 1 changes to semicircle (Let radius is $r$ ) therefore $1=\pi r$
$\Rightarrow r =\frac{1}{\pi}$
Now new magnetic moment
$M'=M \times 2 r=\frac{2 m l}{\pi}=\frac{M}{\pi}$