[PATCH] D28406: [InstCombine] icmp sgt (shl nsw X, C1), C0 --> icmp sgt X, C0 >> C1

bryant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 10:29:30 PST 2017


bryant added a comment.

This looks like the signed analogue of the unsigned case on line 1965. Since the unsigned case handles both ugt and ule (but makes the substitutions for ult), perhaps you could handle sle as well:

  Name: sle
  %c = shl nsw i8 %x, C1
  %d = icmp sle %c, C0
    =>
  %d = icmp sle %x, (C0 >> C1)
  
  ----------------------------------------
  Optimization: sle
  Done: 1
  Optimization is correct! 

http://rise4fun.com/Alive/j


https://reviews.llvm.org/D28406





More information about the llvm-commits mailing list