diff options
| author | Erik Verbruggen <erikjv@me.com> | 2014-03-28 14:50:57 +0000 |
|---|---|---|
| committer | Erik Verbruggen <erikjv@me.com> | 2014-03-28 14:50:57 +0000 |
| commit | 5e1bac3a38c8061173a2ee8398511e77cd1203bf (patch) | |
| tree | d65e89f898270a1ec9daa7dfad6c53cfd120d6a8 /llvm/lib/Transforms | |
| parent | 2074ebd8af23e4495769512231025c6ba6a57be3 (diff) | |
| download | bcm5719-llvm-5e1bac3a38c8061173a2ee8398511e77cd1203bf.tar.gz bcm5719-llvm-5e1bac3a38c8061173a2ee8398511e77cd1203bf.zip | |
Revert "InstCombine: merge constants in both operands of icmp."
This reverts commit r204912, and follow-up commit r204948.
This introduced a performance regression, and the fix is not completely
clear yet.
llvm-svn: 205010
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index fea0d0245c8..8c0ad525980 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -3008,20 +3008,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { // icmp X, X+Cst if (match(Op1, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op0 == X) return FoldICmpAddOpCst(I, X, Cst, I.getSwappedPredicate()); - - ConstantInt *Cst2; - if (I.isSigned() && - match(Op1, m_ConstantInt(Cst)) && - match(Op0, m_Add(m_Value(X), m_ConstantInt(Cst2))) && - cast<BinaryOperator>(Op0)->hasNoSignedWrap()) { - // icmp X+Cst2, Cst --> icmp X, Cst-Cst2 - // iff Cst-Cst2 does not overflow - bool Overflow; - APInt NewCst = Cst->getValue().ssub_ov(Cst2->getValue(), Overflow); - if (!Overflow) - return new ICmpInst(I.getPredicate(), X, - ConstantInt::get(Cst->getType(), NewCst)); - } } return Changed ? &I : 0; } |

