[PATCH] D33186: [InstCombine] Canonicalize clamp of float types to minmax in fast mode.

Andrei Elovikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 02:23:54 PDT 2017


a.elovikov updated this revision to Diff 105234.
a.elovikov added a comment.

Compare types instead of their sizes to decide if CastInst is needed.

Note, that casts of "inner" min/max prohibit clamp pattern recognition
because the casts are being looked by one level of use only, and to
get the original value being clamped two levels of look through are
required.


https://reviews.llvm.org/D33186

Files:
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/clamp-to-minmax.ll
  llvm/test/Transforms/InstCombine/minmax-fold.ll
  llvm/test/Transforms/InstCombine/pr27236.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33186.105234.patch
Type: text/x-patch
Size: 17260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170705/db58ed28/attachment-0001.bin>


More information about the llvm-commits mailing list