[PATCH] [ValueTracking] Allow min/max detection to see through casts.

James Molloy james.molloy at arm.com
Wed May 13 07:34:27 PDT 2015


Hi reames,

This teaches the min/max idiom detector in ValueTracking to see through
casts such as SExt/ZExt/Trunc. SCEV can already do this, so we're bringing
non-SCEV analyses up to the same level.

The returned LHS/RHS will not match the type of the original SelectInst
any more, so a CastOp is returned too to inform the caller how to
convert to the SelectInst's type.

UIToFP/FPToSI are not yet handled - that would require this function to be able to return floating point min/max, which I intend to do in the future.

No in-tree users yet; this will be used by InstCombine in a followup and will be tested there.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9748

Files:
  include/llvm/Analysis/ValueTracking.h
  lib/Analysis/ValueTracking.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9748.25685.patch
Type: text/x-patch
Size: 7074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150513/90388a45/attachment.bin>


More information about the llvm-commits mailing list