[llvm] [NVPTX] Use PRMT instruction to lower i16 bswap (PR #168968)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 15:51:39 PST 2025


Chengjunp wrote:

> If you wanted to go above and beyond, I think it would be best to instead implement this (and all other bswap expansion) as a custom legalization to allow for DAGCombiner to optimize them.

I see. Do you mean that we just lower all the bswap into bit operations first and let DAGCombiner decide how to optimize using PRMT?

https://github.com/llvm/llvm-project/pull/168968


More information about the llvm-commits mailing list