This is the continuation of https://github.com/llvm/llvm-project/pull/88674. Fixes #88433, #90496. --------- Co-authored-by: aniplcc <aniplccode@gmail.com>