Lines Matching refs:LHSI
1214 Instruction *LHSI, in visitICmpInstWithInstAndIntCst() argument
1218 switch (LHSI->getOpcode()) { in visitICmpInstWithInstAndIntCst()
1224 match(LHSI->getOperand(0), m_Signum(m_Value(V)))) in visitICmpInstWithInstAndIntCst()
1228 if (ICI.isEquality() && LHSI->hasOneUse()) { in visitICmpInstWithInstAndIntCst()
1231 unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(), in visitICmpInstWithInstAndIntCst()
1232 SrcBits = LHSI->getOperand(0)->getType()->getPrimitiveSizeInBits(); in visitICmpInstWithInstAndIntCst()
1234 computeKnownBits(LHSI->getOperand(0), KnownZero, KnownOne, 0, &ICI); in visitICmpInstWithInstAndIntCst()
1241 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1248 if (ConstantInt *XorCst = dyn_cast<ConstantInt>(LHSI->getOperand(1))) { in visitICmpInstWithInstAndIntCst()
1253 Value *CompareVal = LHSI->getOperand(0); in visitICmpInstWithInstAndIntCst()
1259 Worklist.Add(LHSI); in visitICmpInstWithInstAndIntCst()
1277 if (LHSI->hasOneUse()) { in visitICmpInstWithInstAndIntCst()
1284 return new ICmpInst(Pred, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1295 return new ICmpInst(Pred, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1304 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), XorCst); in visitICmpInstWithInstAndIntCst()
1310 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), XorCst); in visitICmpInstWithInstAndIntCst()
1314 if (LHSI->hasOneUse() && isa<ConstantInt>(LHSI->getOperand(1)) && in visitICmpInstWithInstAndIntCst()
1315 LHSI->getOperand(0)->hasOneUse()) { in visitICmpInstWithInstAndIntCst()
1316 ConstantInt *AndCst = cast<ConstantInt>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1321 if (TruncInst *Cast = dyn_cast<TruncInst>(LHSI->getOperand(0))) { in visitICmpInstWithInstAndIntCst()
1331 NewAnd->takeName(LHSI); in visitICmpInstWithInstAndIntCst()
1339 if (ZExtInst *Cast = dyn_cast<ZExtInst>(LHSI->getOperand(0))) { in visitICmpInstWithInstAndIntCst()
1347 NewAnd->takeName(LHSI); in visitICmpInstWithInstAndIntCst()
1357 BinaryOperator *Shift = dyn_cast<BinaryOperator>(LHSI->getOperand(0)); in visitICmpInstWithInstAndIntCst()
1425 LHSI->setOperand(1, NewAndCst); in visitICmpInstWithInstAndIntCst()
1426 LHSI->setOperand(0, Shift->getOperand(0)); in visitICmpInstWithInstAndIntCst()
1450 Builder->CreateAnd(Shift->getOperand(0), NS, LHSI->getName()); in visitICmpInstWithInstAndIntCst()
1463 if (match(LHSI->getOperand(1), m_One())) { in visitICmpInstWithInstAndIntCst()
1464 Constant *One = cast<Constant>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1465 Value *Or = LHSI->getOperand(0); in visitICmpInstWithInstAndIntCst()
1469 if (LHSI->hasOneUse()) in visitICmpInstWithInstAndIntCst()
1489 Value *NewAnd = Builder->CreateAnd(X, NewOr, LHSI->getName()); in visitICmpInstWithInstAndIntCst()
1504 return new ICmpInst(ICmpInst::ICMP_NE, LHSI, in visitICmpInstWithInstAndIntCst()
1510 if (LoadInst *LI = dyn_cast<LoadInst>(LHSI->getOperand(0))) { in visitICmpInstWithInstAndIntCst()
1515 !LI->isVolatile() && isa<ConstantInt>(LHSI->getOperand(1))) { in visitICmpInstWithInstAndIntCst()
1516 ConstantInt *C = cast<ConstantInt>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1525 if (ICI.isEquality() && RHS == LHSI->getOperand(1) && (-RHSV).isPowerOf2()) in visitICmpInstWithInstAndIntCst()
1529 LHSI->getOperand(0), SubOne(RHS)); in visitICmpInstWithInstAndIntCst()
1533 if (ICI.isEquality() && LHSI->hasOneUse() && match(RHS, m_Zero())) { in visitICmpInstWithInstAndIntCst()
1534 if (auto *CI = dyn_cast<ConstantInt>(LHSI->getOperand(1))) { in visitICmpInstWithInstAndIntCst()
1539 Value *Trunc = Builder->CreateTrunc(LHSI->getOperand(0), NTy); in visitICmpInstWithInstAndIntCst()
1554 match(LHSI, m_Signum(m_Value(V)))) in visitICmpInstWithInstAndIntCst()
1559 if (!ICI.isEquality() || !RHS->isNullValue() || !LHSI->hasOneUse()) in visitICmpInstWithInstAndIntCst()
1562 if (match(LHSI, m_Or(m_PtrToInt(m_Value(P)), m_PtrToInt(m_Value(Q))))) { in visitICmpInstWithInstAndIntCst()
1580 ConstantInt *Val = dyn_cast<ConstantInt>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1587 cast<BinaryOperator>(LHSI)->hasNoSignedWrap()) in visitICmpInstWithInstAndIntCst()
1590 LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1598 ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1602 if (match(LHSI, m_Shl(m_One(), m_Value(X)))) { in visitICmpInstWithInstAndIntCst()
1682 if (cast<BinaryOperator>(LHSI)->hasNoUnsignedWrap()) in visitICmpInstWithInstAndIntCst()
1683 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1688 if (cast<BinaryOperator>(LHSI)->hasNoSignedWrap() && RHSV == 0) in visitICmpInstWithInstAndIntCst()
1689 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1692 if (LHSI->hasOneUse()) { in visitICmpInstWithInstAndIntCst()
1699 Builder->CreateAnd(LHSI->getOperand(0),Mask, LHSI->getName()+".mask"); in visitICmpInstWithInstAndIntCst()
1709 cast<BinaryOperator>(LHSI)->hasNoSignedWrap()) in visitICmpInstWithInstAndIntCst()
1711 LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1716 if (LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1719 Constant *Mask = ConstantInt::get(LHSI->getOperand(0)->getType(), in visitICmpInstWithInstAndIntCst()
1723 Builder->CreateAnd(LHSI->getOperand(0), Mask, LHSI->getName()+".mask"); in visitICmpInstWithInstAndIntCst()
1735 if (LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1743 Builder->CreateTrunc(LHSI->getOperand(0), NTy), in visitICmpInstWithInstAndIntCst()
1753 BinaryOperator *BO = cast<BinaryOperator>(LHSI); in visitICmpInstWithInstAndIntCst()
1754 if (ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1))) { in visitICmpInstWithInstAndIntCst()
1775 if (ConstantInt *DivRHS = dyn_cast<ConstantInt>(LHSI->getOperand(1))) in visitICmpInstWithInstAndIntCst()
1776 if (Instruction *R = FoldICmpDivCst(ICI, cast<BinaryOperator>(LHSI), in visitICmpInstWithInstAndIntCst()
1782 ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(0)); in visitICmpInstWithInstAndIntCst()
1789 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1792 Builder->CreateOr(LHSI->getOperand(1), RHSV - 1), in visitICmpInstWithInstAndIntCst()
1798 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1801 Builder->CreateOr(LHSI->getOperand(1), RHSV), LHSC); in visitICmpInstWithInstAndIntCst()
1808 ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(1)); in visitICmpInstWithInstAndIntCst()
1817 return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1820 return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1825 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1828 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), in visitICmpInstWithInstAndIntCst()
1836 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1839 Builder->CreateAnd(LHSI->getOperand(0), -RHSV), in visitICmpInstWithInstAndIntCst()
1845 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() && in visitICmpInstWithInstAndIntCst()
1848 Builder->CreateAnd(LHSI->getOperand(0), ~RHSV), in visitICmpInstWithInstAndIntCst()
1860 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(LHSI)) { in visitICmpInstWithInstAndIntCst()
1941 ICmpInst::ICMP_NE, LHSI, in visitICmpInstWithInstAndIntCst()
1981 } else if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(LHSI)) { in visitICmpInstWithInstAndIntCst()
3185 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitICmpInst() local
3186 if (Instruction *Res = visitICmpInstWithInstAndIntCst(I, LHSI, CI)) in visitICmpInst()
3192 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitICmpInst() local
3193 switch (LHSI->getOpcode()) { in visitICmpInst()
3197 cast<GetElementPtrInst>(LHSI)->hasAllZeroIndices()) in visitICmpInst()
3198 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), in visitICmpInst()
3199 Constant::getNullValue(LHSI->getOperand(0)->getType())); in visitICmpInst()
3205 if (LHSI->getParent() == I.getParent()) in visitICmpInst()
3215 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) { in visitICmpInst()
3219 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2))) { in visitICmpInst()
3236 if (LHSI->hasOneUse()) in visitICmpInst()
3243 Transform = replacedSelectWithOperand(cast<SelectInst>(LHSI), &I, in visitICmpInst()
3248 Op1 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(1), in visitICmpInst()
3251 Op2 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(2), in visitICmpInst()
3253 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2); in visitICmpInst()
3260 DL.getIntPtrType(RHSC->getType()) == LHSI->getOperand(0)->getType()) in visitICmpInst()
3261 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0), in visitICmpInst()
3262 Constant::getNullValue(LHSI->getOperand(0)->getType())); in visitICmpInst()
3268 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) { in visitICmpInst()
3271 !cast<LoadInst>(LHSI)->isVolatile()) in visitICmpInst()
3839 Instruction *LHSI, in FoldFCmp_IntToFP_Cst() argument
3846 int MantissaWidth = LHSI->getType()->getFPMantissaWidth(); in FoldFCmp_IntToFP_Cst()
3849 IntegerType *IntTy = cast<IntegerType>(LHSI->getOperand(0)->getType()); in FoldFCmp_IntToFP_Cst()
3851 bool LHSUnsigned = isa<UIToFPInst>(LHSI); in FoldFCmp_IntToFP_Cst()
4074 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt); in FoldFCmp_IntToFP_Cst()
4133 if (Instruction *LHSI = dyn_cast<Instruction>(Op0)) in visitFCmpInst() local
4134 switch (LHSI->getOpcode()) { in visitFCmpInst()
4137 FPExtInst *LHSExt = cast<FPExtInst>(LHSI); in visitFCmpInst()
4179 if (LHSI->getParent() == I.getParent()) in visitFCmpInst()
4185 if (Instruction *NV = FoldFCmp_IntToFP_Cst(I, LHSI, RHSC)) in visitFCmpInst()
4191 if (match(LHSI, m_FNeg(m_Value(Op)))) in visitFCmpInst()
4198 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) { in visitFCmpInst()
4201 !cast<LoadInst>(LHSI)->isVolatile()) in visitFCmpInst()
4210 CallInst *CI = cast<CallInst>(LHSI); in visitFCmpInst()