Closes https://github.com/llvm/llvm-project/issues/99097 Closes https://github.com/llvm/llvm-project/issues/99100 As ddx and ddy are near identical implementations I've combined them in this PR. This aims to unblock https://github.com/llvm/llvm-project/pull/161378 --------- Co-authored-by: Alexander Johnston <alexander.johnston@amd.com>