mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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
This commit is contained in:
@@ -341,10 +341,10 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
|
||||
bool ShlNSW = false;
|
||||
if (match(Op0, m_Shl(m_One(), m_Value(Y)))) {
|
||||
BO = BinaryOperator::CreateShl(Op1, Y);
|
||||
ShlNSW = cast<BinaryOperator>(Op0)->hasNoSignedWrap();
|
||||
ShlNSW = cast<ShlOperator>(Op0)->hasNoSignedWrap();
|
||||
} else if (match(Op1, m_Shl(m_One(), m_Value(Y)))) {
|
||||
BO = BinaryOperator::CreateShl(Op0, Y);
|
||||
ShlNSW = cast<BinaryOperator>(Op1)->hasNoSignedWrap();
|
||||
ShlNSW = cast<ShlOperator>(Op1)->hasNoSignedWrap();
|
||||
}
|
||||
if (BO) {
|
||||
if (I.hasNoUnsignedWrap())
|
||||
|
Reference in New Issue
Block a user