[all-commits] [llvm/llvm-project] f879c9: [InstSimplify] fold icmp with mul nuw and constant...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Aug 5 11:32:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f879c9b796210d0b2407d022e216cc4d907818a3
      https://github.com/llvm/llvm-project/commit/f879c9b796210d0b2407d022e216cc4d907818a3
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstCombine/icmp-mul.ll
    M llvm/test/Transforms/InstSimplify/icmp-constant.ll

  Log Message:
  -----------
  [InstSimplify] fold icmp with mul nuw and constant operands

https://rise4fun.com/Alive/pZEr

  Name: mul nuw with icmp eq
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp eq i8 %a, C2
    =>
  %r = false

  Name: mul nuw with icmp ne
  Pre: (C2 %u C1) != 0
  %a = mul nuw i8 %x, C1
  %r = icmp ne i8 %a, C2
    =>
  %r = true

There are potentially several other transforms we need to add based on:
D51625
...but it doesn't look like there was follow-up to that patch.




More information about the All-commits mailing list