InstCombine: match can find ConstantExprs, don't assume we have a Value
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 4 Jan 2015 07:36:02 +0000 (07:36 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 4 Jan 2015 07:36:02 +0000 (07:36 +0000)
commit07d7dbae9eb59eef7a44cfe257e7475e75b06ffd
treeb5a7a9aa544f048f3c4ff377182b89ec4c980642
parent77e22b7836613f97bfd7579e064b66e3ebc6c2f3
InstCombine: match can find ConstantExprs, don't assume we have a Value

We assumed the output of a match was a Value, this would cause us to
assert because we would fail a cast<>.  Instead, use a helper in the
Operator family to hide the distinction between Value and Constant.

This fixes PR22087.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225127 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
test/Transforms/InstCombine/mul.ll