[all-commits] [llvm/llvm-project] 1d7604: [InstCombine] Simplify bswap -> shift

Paweł Bylica via All-commits all-commits at lists.llvm.org
Thu Jan 20 16:26:08 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d7604fdcebda9cc431b7f19c2f4cb769efdca02
      https://github.com/llvm/llvm-project/commit/1d7604fdcebda9cc431b7f19c2f4cb769efdca02
  Author: Pawe Bylica <chfast at gmail.com>
  Date:   2022-01-21 (Fri, 21 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/bswap-fold.ll

  Log Message:
  -----------
  [InstCombine] Simplify bswap -> shift

Simplify bswap(x) to shl(x) or lshr(x) if x has exactly one
"active byte", i.e. all active bits are contained in boundaries
of a single byte of x.

https://alive2.llvm.org/ce/z/nvbbU5
https://alive2.llvm.org/ce/z/KiiL3J

Reviewed By: spatel, craig.topper, lebedev.ri

Differential Revision: https://reviews.llvm.org/D117680




More information about the All-commits mailing list