mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Fix m_Not and m_Neg to not match random ConstantInt's. Before
these would try hard to match constants by inverting the bits and recursively matching. There are two problems with this: 1) some patterns would match when we didn't want them to (theoretical) 2) this is insanely expensive to do, and most often pointless. This was apparently useful in just 2 instcombine cases, which I added code to handle explicitly. This change speeds up 'opt' time on 176.gcc by 1% and produces bitwise identical code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123518 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
67920320b2
commit
4de2c76542
@ -521,8 +521,6 @@ struct not_match {
|
||||
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
|
||||
if (CE->getOpcode() == Instruction::Xor)
|
||||
return matchIfNot(CE->getOperand(0), CE->getOperand(1));
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
|
||||
return L.match(ConstantExpr::getNot(CI));
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
@ -557,8 +555,6 @@ struct neg_match {
|
||||
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
|
||||
if (CE->getOpcode() == Instruction::Sub)
|
||||
return matchIfNeg(CE->getOperand(0), CE->getOperand(1));
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
|
||||
return L.match(ConstantExpr::getNeg(CI));
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user