[all-commits] [llvm/llvm-project] 21d387: [InstCombine] fold not-shift of signbit to icmp+ze...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Sun Jan 8 09:04:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21d3871b7c90f85b3ae417724d7864369173bde0
      https://github.com/llvm/llvm-project/commit/21d3871b7c90f85b3ae417724d7864369173bde0
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-08 (Sun, 08 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    M llvm/test/Transforms/InstCombine/and-xor-merge.ll
    M llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
    M llvm/test/Transforms/InstCombine/lshr.ll
    M llvm/test/Transforms/InstCombine/negated-bitmask.ll
    M llvm/test/Transforms/InstCombine/xor.ll
    M llvm/test/Transforms/InstCombine/zext.ll

  Log Message:
  -----------
  [InstCombine] fold not-shift of signbit to icmp+zext, part 2

Follow-up to:
6c39a3aae1dc

That converted a pattern with ashr directly to icmp+zext, and
this updates the pattern that we used to convert to.

This canonicalizes to icmp for better analysis in the minimum case
and shortens patterns where the source type is not the same as dest type:
https://alive2.llvm.org/ce/z/tpXJ64
https://alive2.llvm.org/ce/z/dQ405O

This requires an adjustment to an icmp transform to avoid infinite looping.




More information about the All-commits mailing list