https://github.com/shiltian commented: I like this method, but just out of curiosity, did we use anything in AMDGPU implementation that has target dependent lowering in the front end? If not, this is totally fine I'd say. https://github.com/llvm/llvm-project/pull/119091