[all-commits] [llvm/llvm-project] af47d4: [InstCombine] recognizeBSwapOrBitReverseIdiom - re...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Sep 30 04:10:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: af47d40b9c68744eb66aa2ef779065e946aaa099
      https://github.com/llvm/llvm-project/commit/af47d40b9c68744eb66aa2ef779065e946aaa099
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-30 (Wed, 30 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/InstCombine/bswap.ll

  Log Message:
  -----------
  [InstCombine] recognizeBSwapOrBitReverseIdiom - recognise zext(bswap(trunc(x))) patterns (PR39793)

PR39793 demonstrated an issue where we fail to recognize 'partial' bswap patterns of the lower bytes of an integer source.

In fact, most of this is already in place collectBitParts suitably tags zero bits, so we just need to correctly handle this case by finding the zero'd upper bits and reducing the bswap pattern just to the active demanded bits.

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




More information about the All-commits mailing list