[all-commits] [llvm/llvm-project] a3b30d: [InstCombine] add tests for bswap with shift op; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Wed May 18 12:08:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a3b30d22da173446d1a2ccd49e442b3900b0027c
      https://github.com/llvm/llvm-project/commit/a3b30d22da173446d1a2ccd49e442b3900b0027c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-18 (Wed, 18 May 2022)

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

  Log Message:
  -----------
  [InstCombine] add tests for bswap with shift op; NFC

issue #55327


  Commit: ebbc37391f9d1de5e8c4bee14493fce20f9c6906
      https://github.com/llvm/llvm-project/commit/ebbc37391f9d1de5e8c4bee14493fce20f9c6906
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-18 (Wed, 18 May 2022)

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

  Log Message:
  -----------
  [InstCombine] allow variable shift amount in bswap + shift fold

When shifting by a byte-multiple:
bswap (shl X, Y) --> lshr (bswap X), Y
bswap (lshr X, Y) --> shl (bswap X), Y

This was limited to constants as a first step in D122010 / 60820e53ec9d3be02 ,
but issue #55327 shows a source example (and there's a test based on that here)
where a variable shift amount is used in this pattern.


Compare: https://github.com/llvm/llvm-project/compare/d4257fbbba23...ebbc37391f9d


More information about the All-commits mailing list