diff options
author | Craig Topper <craig.topper@intel.com> | 2018-08-23 17:15:02 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-08-23 17:15:02 +0000 |
commit | 15f869238140e45f4a9331429bd42f1254e77259 (patch) | |
tree | 24a622743cb994d91c6d2c10659ec0c5f9d75f06 | |
parent | 354d1cc7185d396f5a732f8cd3610a7d0ae3829d (diff) | |
download | bcm5719-llvm-15f869238140e45f4a9331429bd42f1254e77259.tar.gz bcm5719-llvm-15f869238140e45f4a9331429bd42f1254e77259.zip |
[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
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 322d5c2a876..d2844d80c51 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -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; |