OSDN Git Service

Allow min/max detection to see through casts.
authorJames Molloy <james.molloy@arm.com>
Fri, 15 May 2015 16:04:50 +0000 (16:04 +0000)
committerJames Molloy <james.molloy@arm.com>
Fri, 15 May 2015 16:04:50 +0000 (16:04 +0000)
commiteb9033d963e97c83b964c5ee75bf39b996cb5d20
tree2a0da5b8aee4115c35e8077cb616f13752cb443c
parent975307cc507c7f0b03aa5fd709b5327439d92f45
Allow min/max detection to see through casts.

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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237452 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ValueTracking.h
lib/Analysis/ValueTracking.cpp