forked from OSchip/llvm-project
[NFC] Detect IV increment expressed as uadd_with_overflow and usub_with_overflow
Current callers do not call it with such argument, so this is NFC. But for further changes, it can be very useful to detect such cases.
This commit is contained in:
parent
8d835f42a5
commit
9fac8496ea
|
@ -1293,6 +1293,12 @@ getIVIncrement(const PHINode *PN, const LoopInfo *LI) {
|
|||
return std::make_pair(IVInc, ConstantExpr::getNeg(Step));
|
||||
if (match(IVInc, m_Add(m_Specific(PN), m_Constant(Step))))
|
||||
return std::make_pair(IVInc, Step);
|
||||
if (match(IVInc, m_ExtractValue<0>(m_Intrinsic<Intrinsic::usub_with_overflow>(
|
||||
m_Specific(PN), m_Constant(Step)))))
|
||||
return std::make_pair(IVInc, ConstantExpr::getNeg(Step));
|
||||
if (match(IVInc, m_ExtractValue<0>(m_Intrinsic<Intrinsic::uadd_with_overflow>(
|
||||
m_Specific(PN), m_Constant(Step)))))
|
||||
return std::make_pair(IVInc, Step);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue