[llvm] r372625 - [InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 23 09:04:32 PDT 2019
Author: lebedevri
Date: Mon Sep 23 09:04:32 2019
New Revision: 372625
URL: http://llvm.org/viewvc/llvm-project?rev=372625&view=rev
Log:
[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=372625&r1=372624&r2=372625&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Mon Sep 23 09:04:32 2019
@@ -1055,23 +1055,23 @@ static Value *foldUnsignedUnderflowCheck
ICmpInst *UnsignedICmp, bool IsAnd,
const SimplifyQuery &Q,
InstCombiner::BuilderTy &Builder) {
- Value *Subtracted;
+ Value *ZeroCmpOp;
ICmpInst::Predicate EqPred;
- if (!match(ZeroICmp, m_ICmp(EqPred, m_Value(Subtracted), m_Zero())) ||
+ if (!match(ZeroICmp, m_ICmp(EqPred, m_Value(ZeroCmpOp), m_Zero())) ||
!ICmpInst::isEquality(EqPred))
return nullptr;
Value *Base, *Offset;
- if (!match(Subtracted, m_Sub(m_Value(Base), m_Value(Offset))))
+ if (!match(ZeroCmpOp, m_Sub(m_Value(Base), m_Value(Offset))))
return nullptr;
ICmpInst::Predicate UnsignedPred;
- // Subtracted < Base && Subtracted != 0 --> Base > Offset iff Offset != 0
- // Subtracted >= Base || Subtracted == 0 --> Base <= Base iff Offset != 0
+ // ZeroCmpOp < Base && ZeroCmpOp != 0 --> Base > Offset iff Offset != 0
+ // ZeroCmpOp >= Base || ZeroCmpOp == 0 --> Base <= Base iff Offset != 0
if (match(UnsignedICmp,
- m_c_ICmp(UnsignedPred, m_Specific(Subtracted), m_Specific(Base)))) {
- if (UnsignedICmp->getOperand(0) != Subtracted)
+ m_c_ICmp(UnsignedPred, m_Specific(ZeroCmpOp), m_Specific(Base)))) {
+ if (UnsignedICmp->getOperand(0) != ZeroCmpOp)
UnsignedPred = ICmpInst::getSwappedPredicate(UnsignedPred);
if (UnsignedPred == ICmpInst::ICMP_ULT && IsAnd &&
More information about the llvm-commits
mailing list