Add flag to control loopification

It is off by default, which is meant to be a workaround for #8275.
Once #8275 is fixed we will enable this option by default.