forked from OSchip/llvm-project
[ValueTracking] Fix an assert from r340480.
We need to allow ConstantExpr Selects in addition to SelectInst. I'll try to put together a test case, but I wanted to fix the issues being reported. Fixes PR38677 llvm-svn: 340546
This commit is contained in:
parent
354d1cc718
commit
15f8692381
|
@ -2213,7 +2213,9 @@ bool MaskedValueIsZero(const Value *V, const APInt &Mask, unsigned Depth,
|
|||
// Returns the input and lower/upper bounds.
|
||||
static bool isSignedMinMaxClamp(const Value *Select, const Value *&In,
|
||||
const APInt *&CLow, const APInt *&CHigh) {
|
||||
assert(isa<SelectInst>(Select) && "Input should be a SelectInst!");
|
||||
assert(isa<Operator>(Select) &&
|
||||
cast<Operator>(Select)->getOpcode() == Instruction::Select &&
|
||||
"Input should be a SelectInst!");
|
||||
|
||||
const Value *LHS, *RHS, *LHS2, *RHS2;
|
||||
SelectPatternFlavor SPF = matchSelectPattern(Select, LHS, RHS).Flavor;
|
||||
|
|
Loading…
Reference in New Issue