summaryrefslogtreecommitdiff
path: root/include/llvm/Support/PatternMatch.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-15 05:52:27 +0000
committerChris Lattner <sabre@nondot.org>2011-01-15 05:52:27 +0000
commit4de2c7654289bb655edfad70c18a4a1352827bd0 (patch)
tree9010fdd016cda623c73214c270914158f4e4f427 /include/llvm/Support/PatternMatch.h
parent67920320b26cbc8c1203ee94654ac1ce1fd2af13 (diff)
downloadllvm-4de2c7654289bb655edfad70c18a4a1352827bd0.tar.gz
llvm-4de2c7654289bb655edfad70c18a4a1352827bd0.tar.bz2
llvm-4de2c7654289bb655edfad70c18a4a1352827bd0.tar.xz
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
Diffstat (limited to 'include/llvm/Support/PatternMatch.h')
-rw-r--r--include/llvm/Support/PatternMatch.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h
index 8b5812141d..322ed436c9 100644
--- a/include/llvm/Support/PatternMatch.h
+++ b/include/llvm/Support/PatternMatch.h
@@ -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: