[instcombine] Fix oss-fuzz 39934 (mul matcher can match non-instruction)
authorPhilip Reames <listmail@philipreames.com>
Sun, 24 Oct 2021 01:07:21 +0000 (18:07 -0700)
committerPhilip Reames <listmail@philipreames.com>
Sun, 24 Oct 2021 21:42:03 +0000 (14:42 -0700)
commit3c06ecaa1e8d0267fe67c1e5c8fa5f294de2aab8
tree6fd25f4ef5d880d6b5769151abc9b231a26f5e4a
parent850217686e211f9515d60f31e31bc4171f544239
[instcombine] Fix oss-fuzz 39934 (mul matcher can match non-instruction)

Fixes a crash observed by oss-fuzz in 39934.  Issue at hand is that code expects a pattern match on m_Mul to imply the operand is a mul instruction, however mul constexprs are also valid here.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-mul.ll