Backport https://github.com/llvm/llvm-project/pull/102605 into 19.x branch /cherry-pick https://github.com/llvm/llvm-project/commit/d469794d0cdfd2fea50a6ce0c0e33abb242d744c