BaiXilin wrote: This PR has been paused for too long, and as other reviewers pointed out, a lot of changes are missing/incorrect. I opened a new PR #155194 as a fresh start. Closing this one for now. https://github.com/llvm/llvm-project/pull/122649