search for: icmp_sge

Displaying 6 results from an estimated 6 matches for "icmp_sge".

Did you mean: icmp_sgt
2012 Oct 30
0
[LLVMdev] Any plan to add MIN/MAX isd node?
...here is part of a transform using this, from InstructionSimplify.cpp: // Signed variants on "max(a,b)>=a -> true". if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) { if (A != RHS) std::swap(A, B); // smax(A, B) pred A. EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". // We analyze this as smax(A, B) pred A. P = Pred; } At the codegen level, the same could be done. Also, if a target has a max/min instruction it can transform compare+select to max/min, in fact I'm pretty sure some targets...
2012 Oct 30
1
[LLVMdev] Any plan to add MIN/MAX isd node?
...here is part of a transform using this, from InstructionSimplify.cpp: // Signed variants on "max(a,b)>=a -> true". if (match(LHS, m_SMax(m_Value(A), m_Value(B))) && (A == RHS || B == RHS)) { if (A != RHS) std::swap(A, B); // smax(A, B) pred A. EqP = CmpInst::ICMP_SGE; // "A == smax(A, B)" iff "A sge B". // We analyze this as smax(A, B) pred A. P = Pred; } At the codegen level, the same could be done. Also, if a target has a max/min instruction it can transform compare+select to max/min, in fact I'm pretty sure some targets...
2012 Oct 30
2
[LLVMdev] Any plan to add MIN/MAX isd node?
Hi Duncan, To use select, usually, there is a compare before select. Presence of comparison will disable some opportunities to optimize some code. Select and Compare is not associative neither. Thanks, Yin -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Duncan Sands Sent: Tuesday, October 30, 2012
2010 Feb 12
2
[LLVMdev] [PATCH] Fix off-by-one errors in the doxygen documentation
..., /// equal - ICMP_NE = 33, /// not equal - ICMP_UGT = 34, /// unsigned greater than - ICMP_UGE = 35, /// unsigned greater or equal - ICMP_ULT = 36, /// unsigned less than - ICMP_ULE = 37, /// unsigned less or equal - ICMP_SGT = 38, /// signed greater than - ICMP_SGE = 39, /// signed greater or equal - ICMP_SLT = 40, /// signed less than - ICMP_SLE = 41, /// signed less or equal + ICMP_EQ = 32, ///< equal + ICMP_NE = 33, ///< not equal + ICMP_UGT = 34, ///< unsigned greater than + ICMP_UGE = 35, ///< unsigned...
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...val = Con->getZExtValue(); + + if (RHS == CI) + IC->swapOperands(); + + switch (IC->getPredicate()) { + case ICmpInst::ICMP_EQ: + case ICmpInst::ICMP_NE: + case ICmpInst::ICMP_UGT: + case ICmpInst::ICMP_UGE: + case ICmpInst::ICMP_ULE: + case ICmpInst::ICMP_SGT: + case ICmpInst::ICMP_SGE: + case ICmpInst::ICMP_SLE: + // XXX: check for wrapping + if (con_val == UINT64_MAX) + return nullptr; + return emitStrNLen(Src, ConstantInt::get(SizeType, con_val + 1), + B, DL, TLI); + case ICmpInst::ICMP_ULT: + case ICmpInst::ICMP_SLT: + return emitStrNLen(Src, Con, +...
2016 Sep 02
2
ScalarEvolution pass and interprocedural analysis
Hello all, I was looking for an analysis pass that could provide comprehensive information on pointer arithmetic in the context of whole-program optimization. It seems that Scalar Evolution provides exactly what I'm looking for, but it is restricted to only intraprocedural analysis. E.g., consider this toy snippet: void foo(int* p) { (*p)++; } int bar() { int i; for (i = 0; i < n;