[all-commits] [llvm/llvm-project] 00808e: [InstSimplify] allow vector folds for (Pow2C << X)...

RotateRight via All-commits all-commits at lists.llvm.org
Sun Nov 8 07:07:48 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 00808e321c724bd9f2a822bce87fe7fe87376371
      https://github.com/llvm/llvm-project/commit/00808e321c724bd9f2a822bce87fe7fe87376371
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-11-08 (Sun, 08 Nov 2020)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/compare.ll

  Log Message:
  -----------
  [InstSimplify] allow vector folds for (Pow2C << X) == NonPow2C

Existing pre-conditions seem to be correct:
https://rise4fun.com/Alive/lCLB

  Name: non-zero C1
  Pre: !isPowerOf2(C1) && isPowerOf2(C2) && C1 != 0
  %sub = shl i8 C2, %X
  %cmp = icmp eq i8 %sub, C1
  =>
  %cmp = false

  Name: one == C2
  Pre: !isPowerOf2(C1) && isPowerOf2(C2) && C2 == 1
  %sub = shl i8 C2, %X
  %cmp = icmp eq i8 %sub, C1
  =>
  %cmp = false

  Name: nuw
  Pre: !isPowerOf2(C1) && isPowerOf2(C2)
  %sub = shl nuw i8 C2, %X
  %cmp = icmp eq i8 %sub, C1
  =>
  %cmp = false

  Name: nsw
  Pre: !isPowerOf2(C1) && isPowerOf2(C2)
  %sub = shl nsw i8 C2, %X
  %cmp = icmp eq i8 %sub, C1
  =>
  %cmp = false




More information about the All-commits mailing list