This is a bit of an obscure topic, basically during the 8th century the Tang dynasty battled the Tibetan empire and during this time a kingdom of dubious ethnic affiliation(I think it was a mix of Yi and Bai people) emerged in the region of Yunnan and the surroundings and after the collapse of the Tibetan empire it entered a expansionistic period by annexing various smaller territories from Burma Guinzhou and Sichuan, threatening the fledgling Tang presence in the area, attempting to siege Chengdu a couple of times and the last attempt is said to have been a close call:
"Throughout the 860s Nanzhao armies roamed unhindered throughout the southwest, though their military activity seemed focused on southern Sichuan. In 869, Shilong amassed a huge force that once again reached the gates of Chengdu, and the city barely survived the siegeY When yet another large Nanzhao invasion of Qian, in 873, threatened the Chinese presence south of the Yangzi River, the Tang court issued a hastily crafted appeal to Han Chinese in North China to settle in the Qianzhong circuit in order to secure the territory from Nanzhao invaders."
Amid the Clouds and Mist China's Colonization of Guizhou, 1200-1700
So the the Whaf-If question is what would have happened if they indeed were able to siege the city? I find this particularly interesting by factoring the contemporary rebellions that could be more successful and especially the undermining of the presence of Han Chinese in the South-West and the affiliation of the various small kingdoms in the region, plus the long term situation of the Nanzhao kingdom, which if it doesn't decline and fall like OTL, could capitalize on the Tang instabilities even further by raiding the rest of the region and possibly by settling in Sichuan politically-speaking and separate it from the rest of China, at least short-term.
The situation in Vietnam is also interesting, the Nanzhao raided and occupied parts of it but if their ascendancy continues is it possible for Vietnam to go independent sooner?