[llvm] r340546 - [ValueTracking] Fix an assert from r340480.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 23 10:15:02 PDT 2018
Author: ctopper
Date: Thu Aug 23 10:15:02 2018
New Revision: 340546
URL: http://llvm.org/viewvc/llvm-project?rev=340546&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Analysis/ValueTracking.cpp
Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=340546&r1=340545&r2=340546&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Thu Aug 23 10:15:02 2018
@@ -2213,7 +2213,9 @@ bool MaskedValueIsZero(const Value *V, c
// 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;
More information about the llvm-commits
mailing list