diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1930,6 +1930,15 @@ break; } case Intrinsic::ptrmask: { + Value *Op0 = II->getArgOperand(0); + Value *Op1 = II->getArgOperand(1); + // Fail loudly in case this is ever changed. + // TODO: If vector types are supported the merging of (ptrmask (ptrmask)) + // need to ensure we don't merge a vectype with non-vec type. + assert(!Op0->getType()->isVectorTy() && !Op1->getType()->isVectorTy() && + "These combines where written at a time when ptrmask did not " + "support vector types and may not work for vectors"); + Value *InnerPtr, *InnerMask; if (match(II->getArgOperand(0), m_OneUse(m_Intrinsic(m_Value(InnerPtr),