[PATCH] D63026: [InstCombine] Fix fold order for icmp pred (and (sh X, Y), C), 0.

Huihui Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 14:12:38 PDT 2019


huihuiz created this revision.
huihuiz added reviewers: lebedev.ri, efriedma, spatel, craig.topper.
Herald added a project: LLVM.

To generate simplified IR, make sure fold

  ((X << Y) & signbit) ==/!= 0) -> (X << Y) >=/< 0;
  (X << Y) & ~C ==/!= 0 -> (X << Y) </>= C+1, C+1 is power of 2;

are scheduled before fold

  ((X << Y) & C) == 0 -> (X & (C >> Y)) == 0.


Repository:
  rL LLVM

https://reviews.llvm.org/D63026

Files:
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  test/Transforms/InstCombine/icmp-shift-and-negC.ll
  test/Transforms/InstCombine/icmp-shift-and-signbit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63026.203622.patch
Type: text/x-patch
Size: 14734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190607/6e9708ab/attachment.bin>


More information about the llvm-commits mailing list