The amplification and phase modulation of a surface electromagnetic wave propagating along a helical trajectory in a cylindrical semiconductor waveguide under the condition of phase matching with a longitudinal space-charge wave are considered. The evolution of a phase-modulated electromagnetic wave after passing through a semiconductor waveguide is studied and the conditions leading to the transformation of an initially stationary wave into a sequence of optical pulses with a terahertz repetition rate are determined.