/cherry-pick 664a0faac464708fc061d12e5cd492fcbfea979a 3fdb431b636975f2062b1931158aa4dfce6a3ff1 Backport these changes into LLVM 18 so that we will have a released baseline that supports TableGen-based macro fusion.