[PATCH] [InstCombineCompares] Added shl optimization for the instruction - icmp ugt/ult/uge/ule (shl Const2, A), Const1

Ankur Garg ankur29.garg at samsung.com
Thu Nov 6 04:51:26 PST 2014


Hi,
I have made the changes as per your in-line comments.

About the transformation for even const2:

"(and (icmp ugt i32 A, 0), (icmp ult i32 A, 31)) is equivalent to (icmp ult (add i32 A, -1), 30)"

This still transforms the initial two instructions into 2 instructions. I wanted to ask, is it useful to include this transformation.

http://reviews.llvm.org/D6131

Files:
  lib/Transforms/InstCombine/InstCombine.h
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  test/Transforms/InstCombine/icmp.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6131.15854.patch
Type: text/x-patch
Size: 9349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141106/f1cff97b/attachment.bin>


More information about the llvm-commits mailing list