[PATCH] Teach ScalarEvolution to exploit min and max expressions.

Sanjoy Das sanjoy at playingwithpointers.com
Thu Dec 11 20:28:16 PST 2014


Hi atrick, reames, nlewycky, hfinkel,

Teach ScalarEvolution to exploit min and max expressions when proving `isKnownPredicate`.

The motivation for this change is to optimize away checks in loops like this:

  limit = min(t, len)
  for (i = 0 to limit)
    if (i >= len || i < 0) throw_array_of_of_bounds();
    a[i] = ...

http://reviews.llvm.org/D6635

Files:
  lib/Analysis/ScalarEvolution.cpp
  test/Transforms/IndVarSimplify/backedge-on-min-max.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6635.17212.patch
Type: text/x-patch
Size: 17438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141212/c7ca350f/attachment.bin>


More information about the llvm-commits mailing list