Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:LHSI

1021                                                           Instruction *LHSI,
1025 switch (LHSI->getOpcode()) {
1027 if (ICI.isEquality() && LHSI->hasOneUse()) {
1030 unsigned DstBits = LHSI->getType()->getPrimitiveSizeInBits(),
1031 SrcBits = LHSI->getOperand(0)->getType()->getPrimitiveSizeInBits();
1033 ComputeMaskedBits(LHSI->getOperand(0), KnownZero, KnownOne);
1040 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
1047 if (ConstantInt *XorCST = dyn_cast<ConstantInt>(LHSI->getOperand(1))) {
1052 Value *CompareVal = LHSI->getOperand(0);
1058 Worklist.Add(LHSI);
1076 if (LHSI->hasOneUse()) {
1083 return new ICmpInst(Pred, LHSI->getOperand(0),
1095 return new ICmpInst(Pred, LHSI->getOperand(0),
1103 if (LHSI->hasOneUse() && isa<ConstantInt>(LHSI->getOperand(1)) &&
1104 LHSI->getOperand(0)->hasOneUse()) {
1105 ConstantInt *AndCST = cast<ConstantInt>(LHSI->getOperand(1));
1110 if (TruncInst *Cast = dyn_cast<TruncInst>(LHSI->getOperand(0))) {
1120 NewAnd->takeName(LHSI);
1128 if (ZExtInst *Cast = dyn_cast<ZExtInst>(LHSI->getOperand(0))) {
1136 NewAnd->takeName(LHSI);
1146 BinaryOperator *Shift = dyn_cast<BinaryOperator>(LHSI->getOperand(0));
1199 LHSI->setOperand(1, NewAndCST);
1200 LHSI->setOperand(0, Shift->getOperand(0));
1224 Builder->CreateAnd(Shift->getOperand(0), NS, LHSI->getName());
1236 return new ICmpInst(ICmpInst::ICMP_NE, LHSI,
1242 if (LoadInst *LI = dyn_cast<LoadInst>(LHSI->getOperand(0))) {
1247 !LI->isVolatile() && isa<ConstantInt>(LHSI->getOperand(1))) {
1248 ConstantInt *C = cast<ConstantInt>(LHSI->getOperand(1));
1256 if (!ICI.isEquality() || !RHS->isNullValue() || !LHSI->hasOneUse())
1259 if (match(LHSI, m_Or(m_PtrToInt(m_Value(P)), m_PtrToInt(m_Value(Q))))) {
1277 ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1));
1303 if (cast<BinaryOperator>(LHSI)->hasNoUnsignedWrap())
1304 return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0),
1307 if (LHSI->hasOneUse()) {
1315 Builder->CreateAnd(LHSI->getOperand(0),Mask, LHSI->getName()+".mask");
1323 if (LHSI->hasOneUse() &&
1326 Constant *Mask = ConstantInt::get(LHSI->getOperand(0)->getType(),
1330 Builder->CreateAnd(LHSI->getOperand(0), Mask, LHSI->getName()+".mask");
1342 if (LHSI->hasOneUse() &&
1350 Builder->CreateTrunc(LHSI->getOperand(0), NTy),
1360 BinaryOperator *BO = cast<BinaryOperator>(LHSI);
1361 if (ConstantInt *ShAmt = dyn_cast<ConstantInt>(LHSI->getOperand(1))) {
1382 if (ConstantInt *DivRHS = dyn_cast<ConstantInt>(LHSI->getOperand(1)))
1383 if (Instruction *R = FoldICmpDivCst(ICI, cast<BinaryOperator>(LHSI),
1391 ConstantInt *LHSC = dyn_cast<ConstantInt>(LHSI->getOperand(1));
1400 return new ICmpInst(ICmpInst::ICMP_SLT, LHSI->getOperand(0),
1403 return new ICmpInst(ICmpInst::ICMP_SGE, LHSI->getOperand(0),
1408 return new ICmpInst(ICmpInst::ICMP_ULT, LHSI->getOperand(0),
1411 return new ICmpInst(ICmpInst::ICMP_UGE, LHSI->getOperand(0),
1425 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(LHSI)) {
1510 ICmpInst::ICMP_NE, LHSI,
1537 } else if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(LHSI)) {
2227 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
2228 if (Instruction *Res = visitICmpInstWithInstAndIntCst(I, LHSI, CI))
2234 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
2235 switch (LHSI->getOpcode()) {
2239 cast<GetElementPtrInst>(LHSI)->hasAllZeroIndices())
2240 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0),
2241 Constant::getNullValue(LHSI->getOperand(0)->getType()));
2247 if (LHSI->getParent() == I.getParent())
2256 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1)))
2258 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2)))
2267 if ((Op1 && Op2) || (LHSI->hasOneUse() && (Op1 || Op2))) {
2269 Op1 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(1),
2272 Op2 = Builder->CreateICmp(I.getPredicate(), LHSI->getOperand(2),
2274 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
2282 LHSI->getOperand(0)->getType())
2283 return new ICmpInst(I.getPredicate(), LHSI->getOperand(0),
2284 Constant::getNullValue(LHSI->getOperand(0)->getType()));
2290 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) {
2293 !cast<LoadInst>(LHSI)->isVolatile())
2694 Instruction *LHSI,
2701 int MantissaWidth = LHSI->getType()->getFPMantissaWidth();
2707 unsigned InputSize = LHSI->getOperand(0)->getType()->getScalarSizeInBits();
2710 bool LHSUnsigned = isa<UIToFPInst>(LHSI);
2756 IntegerType *IntTy = cast<IntegerType>(LHSI->getOperand(0)->getType());
2891 return new ICmpInst(Pred, LHSI->getOperand(0), RHSInt);
2936 if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
2937 switch (LHSI->getOpcode()) {
2940 FPExtInst *LHSExt = cast<FPExtInst>(LHSI);
2982 if (LHSI->getParent() == I.getParent())
2988 if (Instruction *NV = FoldFCmp_IntToFP_Cst(I, LHSI, RHSC))
2996 if (LHSI->hasOneUse()) {
2997 if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(1))) {
3002 LHSI->getOperand(2), RHSC, I.getName());
3003 } else if (Constant *C = dyn_cast<Constant>(LHSI->getOperand(2))) {
3007 Op1 = Builder->CreateFCmp(I.getPredicate(), LHSI->getOperand(1),
3013 return SelectInst::Create(LHSI->getOperand(0), Op1, Op2);
3019 if (match(LHSI, m_FNeg(m_Value(Op))))
3026 dyn_cast<GetElementPtrInst>(LHSI->getOperand(0))) {
3029 !cast<LoadInst>(LHSI)->isVolatile())
3035 CallInst *CI = cast<CallInst>(LHSI);