Answer
Xuanzang went to Chengdu when the Sui dynasty fell. This was because he was a Buddhist monk and Chengdu was a major center of Buddhism in China at the time. He spent several years there studying and teaching, and eventually traveled to India in search of Buddhist texts.