search for: swapoperands

Displaying 1 result from an estimated 1 matches for "swapoperands".

Did you mean: scanoperands
2016 Feb 07
3
[PATCH] strlen -> strnlen optimization
...getContext()); + Value *LHS = IC->getOperand(0), *RHS = IC->getOperand(1); + + ConstantInt *Con; + if (!((Con = dyn_cast<ConstantInt>(LHS)) || (Con = dyn_cast<ConstantInt>(RHS)))) + return nullptr; + uint64_t con_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 +...