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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 11:41:36 PST 2017


spatel created this revision.
spatel added reviewers: nlopes, bryant, majnemer.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

Try harder to fold icmp with shl nsw as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108749.html

Notice that an earlier transform converts the 'sgt' to 'eq' in some cases, and we miss this transform. I can look at those cases along with other predicates next.

This may eventually help solve:
https://llvm.org/bugs/show_bug.cgi?id=30773


https://reviews.llvm.org/D28406

Files:
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  test/Transforms/InstCombine/icmp-shl-nsw.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28406.83394.patch
Type: text/x-patch
Size: 4393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170106/15f08c7d/attachment.bin>


More information about the llvm-commits mailing list