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

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


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e8760bb9a8a3a22fe22302ffe1932c13c3fcff8e
      https://github.com/llvm/llvm-project/commit/e8760bb9a8a3a22fe22302ffe1932c13c3fcff8e
  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 nsw and constant operands

https://rise4fun.com/Alive/slvl

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

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

Follow-up to the 'nuw' variation added with:
rGf879c9b79621




More information about the All-commits mailing list