Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:LHSI

1052                                                           Instruction *LHSI,
1056 switch (LHSI->getOpcode()) {
1058 if (ICI.isEquality() && LHSI->hasOneUse()) {
1061 unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(),
1062 SrcBits = LHSI->getOperand(0)->getType()->getPrimitiveSizeInBits();
1064 ComputeMaskedBits(LHSI->getOperand(0), KnownZero, KnownOne);
1071 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
1078 if (ConstantInt *XorCST = dyn_cast<ConstantInt>(LHSI->getOperand(1))) {
1083 Value *CompareVal = LHSI->getOperand(0);
1089 Worklist.Add(LHSI);
1107 if (LHSI->hasOneUse()) {
1114 return new ICmpInst(Pred, LHSI->getOperand(0),
1125 return new ICmpInst(Pred, LHSI->getOperand(0),
1134 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0), XorCST);
1140 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0), XorCST);
1144 if (LHSI->hasOneUse() && isa<ConstantInt>(LHSI->getOperand(1)) &&
1145 LHSI->getOperand(0)->hasOneUse()) {
1146 ConstantInt *AndCST = cast<ConstantInt>(LHSI->getOperand(1));
1151 if (TruncInst *Cast = dyn_cast<TruncInst>(LHSI->getOperand(0))) {
1161 NewAnd->takeName(LHSI);
1169 LHSI->getOperand(0))) {
1177 NewAnd->takeName(LHSI);
1187 BinaryOperator *Shift = dyn_cast<BinaryOperator>(LHSI->getOperand(0));
1238 LHSI->setOperand(1, NewAndCST);
1239 LHSI->setOperand(0, Shift->getOperand(0));
1263 Builder->CreateAnd(Shift->getOperand(0), NS, LHSI->getName());
1275 return new ICmpInst(ICmpInst::ICMP_NE, LHSI,
1281 if (LoadInst *LI = dyn_cast<LoadInst>(LHSI->getOperand(0))) {
1286 !LI->isVolatile() && isa<ConstantInt>(LHSI->getOperand(1))) {
1287 ConstantInt *C = cast<ConstantInt>(LHSI->getOperand(1));
1296 if (ICI.isEquality() && RHS == LHSI->getOperand(1) && (-RHSV).isPowerOf2())
1300 LHSI->getOperand(0), SubOne(RHS));
1304 if (!ICI.isEquality() || !RHS->isNullValue() || !LHSI->hasOneUse())
1307 if (match(LHSI, m_Or(m_PtrToInt(m_Value(P)), m_PtrToInt(m_Value(Q))))) {
1325 ConstantInt *Val = dyn_cast<ConstantInt>(LHSI->getOperand(1));
1332 cast<BinaryOperator>(LHSI)->hasNoSignedWrap())
1335 LHSI->getOperand(0),
1343 ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1));
1347 if (match(LHSI, m_Shl(m_One(), m_Value(X)))) {
1437 if (cast<BinaryOperator>(LHSI)->hasNoUnsignedWrap())
1438 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
1443 if (cast<BinaryOperator>(LHSI)->hasNoSignedWrap() && RHSV == 0)
1444 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
1447 if (LHSI->hasOneUse()) {
1454 Builder->CreateAnd(LHSI->getOperand(0),Mask, LHSI->getName()+".mask");
1464 cast<BinaryOperator>(LHSI)->hasNoSignedWrap())
1466 LHSI->getOperand(0),
1471 if (LHSI->hasOneUse() &&
1474 Constant *Mask = ConstantInt::get(LHSI->getOperand(0)->getType(),
1478 Builder->CreateAnd(LHSI->getOperand(0), Mask, LHSI->getName()+".mask");
1490 if (LHSI->hasOneUse() &&
1498 Builder->CreateTrunc(LHSI->getOperand(0), NTy),
1508 BinaryOperator *BO = cast<BinaryOperator>(LHSI);
1509 if (ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1))) {
1530 if (ConstantInt *DivRHS = dyn_cast<ConstantInt>(LHSI->getOperand(1)))
1531 if (Instruction *R = FoldICmpDivCst(ICI, cast<BinaryOperator>(LHSI),
1537 ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(0));
1544 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() &&
1547 Builder->CreateOr(LHSI->getOperand(1), RHSV - 1),
1553 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() &&
1556 Builder->CreateOr(LHSI->getOperand(1), RHSV), LHSC);
1563 ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(1));
1572 return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0),
1575 return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0),
1580 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0),
1583 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0),
1591 if (ICI.getPredicate() == ICmpInst::ICMP_ULT && LHSI->hasOneUse() &&
1594 Builder->CreateAnd(LHSI->getOperand(0), -RHSV),
1600 if (ICI.getPredicate() == ICmpInst::ICMP_UGT && LHSI->hasOneUse() &&
1603 Builder->CreateAnd(LHSI->getOperand(0), ~RHSV),
1615 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(LHSI)) {
1696 ICmpInst::ICMP_NE, LHSI,
1736 } else if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(LHSI)) {
2426 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
2427 if (Instruction *Res = visitICmpInstWithInstAndIntCst(I, LHSI, CI))
2433 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
2434 switch (LHSI->getOpcode()) {
2438 cast<GetElementPtrInst>(LHSI)->hasAllZeroIndices())
2439 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0),
2440 Constant::getNullValue(LHSI->getOperand(0)->getType()));
2446 if (LHSI->getParent() == I.getParent())
2455 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1)))
2457 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2)))
2466 if ((Op1 && Op2) || (LHSI->hasOneUse() && (Op1 || Op2))) {
2468 Op1 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(1),
2471 Op2 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(2),
2473 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
2481 LHSI->getOperand(0)->getType())
2482 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0),
2483 Constant::getNullValue(LHSI->getOperand(0)->getType()));
2489 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) {
2492 !cast<LoadInst>(LHSI)->isVolatile())
2950 Instruction *LHSI,
2957 int MantissaWidth = LHSI->getType()->getFPMantissaWidth();
2963 unsigned InputSize = LHSI->getOperand(0)->getType()->getScalarSizeInBits();
2966 bool LHSUnsigned = isa<UIToFPInst>(LHSI);
3012 IntegerType *IntTy = cast<IntegerType>(LHSI->getOperand(0)->getType());
3147 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt);
3192 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
3193 switch (LHSI->getOpcode()) {
3196 FPExtInst *LHSExt = cast<FPExtInst>(LHSI);
3238 if (LHSI->getParent() == I.getParent())
3244 if (Instruction *NV = FoldFCmp_IntToFP_Cst(I, LHSI, RHSC))
3252 if (LHSI->hasOneUse()) {
3253 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) {
3258 LHSI->getOperand(2), RHSC, I.getName());
3259 } else if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2))) {
3263 Op1 = Builder->CreateFCmp(I.getPredicate(), LHSI->getOperand(1),
3269 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
3275 if (match(LHSI, m_FNeg(m_Value(Op))))
3282 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) {
3285 !cast<LoadInst>(LHSI)->isVolatile())
3291 CallInst *CI = cast<CallInst>(LHSI);