diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp --- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp +++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp @@ -46,8 +46,9 @@ static bool isExtractExtractCheap(Instruction *Ext0, Instruction *Ext1, unsigned Opcode, const TargetTransformInfo &TTI) { - assert(Ext0->getOperand(1) == Ext1->getOperand(1) && - isa(Ext0->getOperand(1)) && + assert(isa(Ext0->getOperand(1)) && + (cast(Ext0->getOperand(1))->getZExtValue() == + cast(Ext1->getOperand(1))->getZExtValue()) && "Expected same constant extract index"); Type *ScalarTy = Ext0->getType();