Solar flares abruptly release the free energy stored as a non-potential magnetic field in the corona and may be accompanied by eruptions of the coronal plasma. Formation of a non-potential magnetic field and the mechanisms for triggering the onset of flares are still poorly understood. In particular, photospheric dynamics observed near those polarity inversion lines that are sites of major flare production have not been well observed with high spatial resolution spectro-polarimetry. This paper reports on a remarkable high-speed material flow observed along the polarity inversion line located between flare ribbons at the main energy release side of an X5.4 flare on 7 March 2012. Observations were carried out by the spectro-polarimeter of the Solar Optical Telescope onboard Hinode. The high-speed material flow was observed in the horizontally-oriented magnetic field formed nearly parallel to the polarity inversion line. This flow persisted from at least 6 hours before the onset of the flare, and continued for at least several hours after the onset of the flare. Observations suggest that the observed material flow represents neither the emergence nor convergence of the magnetic flux. Rather, it may be considered to be material flow working both to increase the magnetic shear along the polarity inversion line and to develop magnetic structures favorable for the onset of the eruptive flare.