[PATCH] D22537: [InstSimplify] recognize trunc + icmp sgt/slt variants of select simplifications (PR28466)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 14:54:22 PDT 2016


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

rL245171 exposed a hole in InstSimplify that manifested in a strange way in PR28466:
https://llvm.org/bugs/show_bug.cgi?id=28466

It's possible to use trunc + icmp sgt/slt in place of an and + icmp eq/ne, so we need to recognize that pattern to eliminate selects that are choosing between some value and some bitmasked version of that value.

https://reviews.llvm.org/D22537

Files:
  lib/Analysis/InstructionSimplify.cpp
  test/Transforms/InstSimplify/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22537.64567.patch
Type: text/x-patch
Size: 7127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160719/f5a570dd/attachment.bin>


More information about the llvm-commits mailing list