[all-commits] [llvm/llvm-project] 42f488: [InstCombine] improve matching for sext-lshr-trunc...

RotateRight via All-commits all-commits at lists.llvm.org
Mon Jun 8 08:55:50 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 42f488b63a04fdaa931315bdadecb6d23e20529a
      https://github.com/llvm/llvm-project/commit/42f488b63a04fdaa931315bdadecb6d23e20529a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/cast.ll

  Log Message:
  -----------
  [InstCombine] improve matching for sext-lshr-trunc patterns

This is intended to preserve the logic of the existing transform,
but remove unnecessary restrictions on uses and types.

https://rise4fun.com/Alive/pYfR

  Pre: C1 <= width(C1) - 8
  %B = sext i8 %A
  %C = lshr %B, C1
  %r = trunc %C to i8
   =>
  %r = ashr i8 %A, trunc(umin(C1, 7))




More information about the All-commits mailing list