Rebased over https://github.com/llvm/llvm-project/pull/93243 Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>