[PATCH] D38536: Improve lookThroughCast function.

Artur Gainullin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 03:21:53 PDT 2017


ArturGainullin created this revision.

When we have the following case:

  %c = cmp iN %x, a
  %t = trunc iN %y to iK
  %sel = select i1 %c, iK %t, iK b

We could possibly match only min/max pattern after looking through cast.
So it is more profitable if widened b constant will be equal a. That is
why extend b using upper bits from a.

Also description for lookTroughCast function was added.


https://reviews.llvm.org/D38536

Files:
  lib/Analysis/ValueTracking.cpp
  test/Transforms/InstCombine/minmax-fold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38536.117651.patch
Type: text/x-patch
Size: 4784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171004/cd65512b/attachment-0001.bin>


More information about the llvm-commits mailing list