[all-commits] [llvm/llvm-project] 727e64: [InstCombine] generalize fold for mask-with-signbi...

RotateRight via All-commits all-commits at lists.llvm.org
Fri Oct 15 13:32:02 PDT 2021


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

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/and.ll
    M llvm/test/Transforms/InstCombine/icmp.ll
    M llvm/test/Transforms/InstCombine/mul-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/mul.ll

  Log Message:
  -----------
  [InstCombine] generalize fold for mask-with-signbit-splat

(iN X s>> (N-1)) & Y --> (X < 0) ? Y : 0

https://alive2.llvm.org/ce/z/qeYhdz

I was looking at a missing abs() transform and found my way to this
generalization of an existing fold that was added with D67799.
As discussed in that review, we want to make sure codegen handles
this difference well, and for all of the targets/types that I
spot-checked, it looks good.

I am leaving the existing fold in place in this commit because
it covers a potentially missing icmp fold, but I plan to remove
that as a follow-up commit as suggested during review.

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




More information about the All-commits mailing list