[all-commits] [llvm/llvm-project] 3fabd9: [InstCombine] fold (trunc (X>>C1)) << C to shift+m...

RotateRight via All-commits all-commits at lists.llvm.org
Fri Oct 1 11:22:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fabd98e5b3e4c9525c0bf97f5595a1aeff3e85a
      https://github.com/llvm/llvm-project/commit/3fabd98e5b3e4c9525c0bf97f5595a1aeff3e85a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-10-01 (Fri, 01 Oct 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    M llvm/test/Transforms/InstCombine/bswap.ll
    M llvm/test/Transforms/InstCombine/shift-shift.ll

  Log Message:
  -----------
  [InstCombine] fold (trunc (X>>C1)) << C to shift+mask directly

This is no-externally-visible-functional-difference-intended.
That is, the test diffs show identical instructions other than
name changes (those are included specifically to verify the logic).

The existing transforms created extra instructions and relied
on subsequent folds to get to the final result, but that could
conflict with other transforms like the proposed D110170 (and
caused that patch to be reverted twice so far because of infinite
combine loops).




More information about the All-commits mailing list