diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h --- a/llvm/include/llvm/IR/PatternMatch.h +++ b/llvm/include/llvm/IR/PatternMatch.h @@ -1235,6 +1235,9 @@ return Op1.match(I->getOperand(0)) && Op2.match(I->getOperand(1)) && Op3.match(I->getOperand(2)); } + if (auto *CE = dyn_cast(V)) + return (CE->getOpcode() == Opcode) && Op1.match(CE->getOperand(0)) && + Op2.match(CE->getOperand(1)) && Op3.match(CE->getOperand(2)); return false; } };