[all-commits] [llvm/llvm-project] 81e91e: [NVPTX] Use PRMT instruction to lower i16 bswap (#...

Chengjun via All-commits all-commits at lists.llvm.org
Mon Nov 24 16:11:27 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 81e91ea1c52a77093a44a186958cca29cf4d3dd8
      https://github.com/llvm/llvm-project/commit/81e91ea1c52a77093a44a186958cca29cf4d3dd8
  Author: Chengjun <chengjunp at Nvidia.com>
  Date:   2025-11-24 (Mon, 24 Nov 2025)

  Changed paths:
    M llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
    M llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
    M llvm/test/CodeGen/NVPTX/bswap.ll

  Log Message:
  -----------
  [NVPTX] Use PRMT instruction to lower i16 bswap (#168968)

Previously, i16 `bswap` was lowered using multiple shift and OR
operations. This patch adds a pattern to directly lower i16 `bswap`
using the `PRMT` (permute) instruction, which is more efficient.

Additionally, the lowering of `bswap` is moved into operation
legalization, which allows for DAGCombiner to optimize the lowered code.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list