Lines Matching refs:getOperand
135 Value *X = Op->getOperand(0); in OptAndOp()
259 Value *ShVal = Op->getOperand(0); in OptAndOp()
349 !isa<ConstantInt>(LHSI->getOperand(1))) return 0; in FoldLogicalPlusAnd()
351 ConstantInt *N = cast<ConstantInt>(LHSI->getOperand(1)); in FoldLogicalPlusAnd()
386 return Builder->CreateSub(LHSI->getOperand(0), RHS, "fold"); in FoldLogicalPlusAnd()
387 return Builder->CreateAdd(LHSI->getOperand(0), RHS, "fold"); in FoldLogicalPlusAnd()
502 if (ConstantInt *C = dyn_cast<ConstantInt>(I->getOperand(1))) in decomposeBitTestICmp()
504 X = I->getOperand(0); in decomposeBitTestICmp()
514 if (ConstantInt *C = dyn_cast<ConstantInt>(I->getOperand(1))) in decomposeBitTestICmp()
516 X = I->getOperand(0); in decomposeBitTestICmp()
537 if (LHS->getOperand(0)->getType() != RHS->getOperand(0)->getType()) return 0; in foldLogOpOfMaskedICmpsHelper()
539 if (LHS->getOperand(0)->getType()->isVectorTy()) return 0; in foldLogOpOfMaskedICmpsHelper()
547 Value *L1 = LHS->getOperand(0); in foldLogOpOfMaskedICmpsHelper()
548 Value *L2 = LHS->getOperand(1); in foldLogOpOfMaskedICmpsHelper()
570 Value *R1 = RHS->getOperand(0); in foldLogOpOfMaskedICmpsHelper()
571 Value *R2 = RHS->getOperand(1); in foldLogOpOfMaskedICmpsHelper()
709 if (LHS->getOperand(0) == RHS->getOperand(1) && in FoldAndOfICmps()
710 LHS->getOperand(1) == RHS->getOperand(0)) in FoldAndOfICmps()
712 if (LHS->getOperand(0) == RHS->getOperand(0) && in FoldAndOfICmps()
713 LHS->getOperand(1) == RHS->getOperand(1)) { in FoldAndOfICmps()
714 Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1); in FoldAndOfICmps()
726 Value *Val = LHS->getOperand(0), *Val2 = RHS->getOperand(0); in FoldAndOfICmps()
727 ConstantInt *LHSCst = dyn_cast<ConstantInt>(LHS->getOperand(1)); in FoldAndOfICmps()
728 ConstantInt *RHSCst = dyn_cast<ConstantInt>(RHS->getOperand(1)); in FoldAndOfICmps()
939 if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1))) in FoldAndOfFCmps()
940 if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) { in FoldAndOfFCmps()
945 return Builder->CreateFCmpORD(LHS->getOperand(0), RHS->getOperand(0)); in FoldAndOfFCmps()
950 if (isa<ConstantAggregateZero>(LHS->getOperand(1)) && in FoldAndOfFCmps()
951 isa<ConstantAggregateZero>(RHS->getOperand(1))) in FoldAndOfFCmps()
952 return Builder->CreateFCmpORD(LHS->getOperand(0), RHS->getOperand(0)); in FoldAndOfFCmps()
956 Value *Op0LHS = LHS->getOperand(0), *Op0RHS = LHS->getOperand(1); in FoldAndOfFCmps()
957 Value *Op1LHS = RHS->getOperand(0), *Op1RHS = RHS->getOperand(1); in FoldAndOfFCmps()
1012 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitAnd()
1031 Value *Op0LHS = Op0I->getOperand(0); in visitAnd()
1032 Value *Op0RHS = Op0I->getOperand(1); in visitAnd()
1100 if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1))) in visitAnd()
1196 if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) in visitAnd()
1197 if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) in visitAnd()
1205 Type *SrcTy = Op0C->getOperand(0)->getType(); in visitAnd()
1207 SrcTy == Op1C->getOperand(0)->getType() && in visitAnd()
1209 Value *Op0COp = Op0C->getOperand(0), *Op1COp = Op1C->getOperand(0); in visitAnd()
1238 SI0->getOperand(1) == SI1->getOperand(1) && in visitAnd()
1241 Builder->CreateAnd(SI0->getOperand(0), SI1->getOperand(0), in visitAnd()
1244 SI1->getOperand(1)); in visitAnd()
1307 return CollectBSwapParts(I->getOperand(0), OverallLeftShift, ByteMask, in CollectBSwapParts()
1309 CollectBSwapParts(I->getOperand(1), OverallLeftShift, ByteMask, in CollectBSwapParts()
1315 if (I->isLogicalShift() && isa<ConstantInt>(I->getOperand(1))) { in CollectBSwapParts()
1317 cast<ConstantInt>(I->getOperand(1))->getLimitedValue(~0U); in CollectBSwapParts()
1337 return CollectBSwapParts(I->getOperand(0), OverallLeftShift, ByteMask, in CollectBSwapParts()
1344 isa<ConstantInt>(I->getOperand(1))) { in CollectBSwapParts()
1348 const APInt &AndMask = cast<ConstantInt>(I->getOperand(1))->getValue(); in CollectBSwapParts()
1370 return CollectBSwapParts(I->getOperand(0), OverallLeftShift, ByteMask, in CollectBSwapParts()
1464 if (LHS->getOperand(0) == RHS->getOperand(1) && in FoldOrOfICmps()
1465 LHS->getOperand(1) == RHS->getOperand(0)) in FoldOrOfICmps()
1467 if (LHS->getOperand(0) == RHS->getOperand(0) && in FoldOrOfICmps()
1468 LHS->getOperand(1) == RHS->getOperand(1)) { in FoldOrOfICmps()
1469 Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1); in FoldOrOfICmps()
1482 Value *Val = LHS->getOperand(0), *Val2 = RHS->getOperand(0); in FoldOrOfICmps()
1483 ConstantInt *LHSCst = dyn_cast<ConstantInt>(LHS->getOperand(1)); in FoldOrOfICmps()
1484 ConstantInt *RHSCst = dyn_cast<ConstantInt>(RHS->getOperand(1)); in FoldOrOfICmps()
1556 if (LHS->getOperand(0) == RHS->getOperand(0)) { in FoldOrOfICmps()
1564 Value *And = Builder->CreateAnd(LHS->getOperand(0), NegCst); in FoldOrOfICmps()
1671 LHS->getOperand(0)->getType() == RHS->getOperand(0)->getType()) { in FoldOrOfFCmps()
1672 if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1))) in FoldOrOfFCmps()
1673 if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) { in FoldOrOfFCmps()
1681 return Builder->CreateFCmpUNO(LHS->getOperand(0), RHS->getOperand(0)); in FoldOrOfFCmps()
1686 if (isa<ConstantAggregateZero>(LHS->getOperand(1)) && in FoldOrOfFCmps()
1687 isa<ConstantAggregateZero>(RHS->getOperand(1))) in FoldOrOfFCmps()
1688 return Builder->CreateFCmpUNO(LHS->getOperand(0), RHS->getOperand(0)); in FoldOrOfFCmps()
1693 Value *Op0LHS = LHS->getOperand(0), *Op0RHS = LHS->getOperand(1); in FoldOrOfFCmps()
1694 Value *Op1LHS = RHS->getOperand(0), *Op1RHS = RHS->getOperand(1); in FoldOrOfFCmps()
1756 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitOr()
1947 SI0->getOperand(1) == SI1->getOperand(1) && in visitOr()
1949 Value *NewOp = Builder->CreateOr(SI0->getOperand(0), SI1->getOperand(0), in visitOr()
1952 SI1->getOperand(1)); in visitOr()
1997 if ((Op0 == B->getOperand(0) || Op0 == B->getOperand(1)) && in visitOr()
2000 Value *NotOp = Op0 == B->getOperand(0) ? B->getOperand(1) : in visitOr()
2001 B->getOperand(0); in visitOr()
2009 if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1))) in visitOr()
2010 if (ICmpInst *LHS = dyn_cast<ICmpInst>(I.getOperand(0))) in visitOr()
2015 if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) in visitOr()
2016 if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) in visitOr()
2024 Type *SrcTy = Op0C->getOperand(0)->getType(); in visitOr()
2025 if (SrcTy == Op1C->getOperand(0)->getType() && in visitOr()
2027 Value *Op0COp = Op0C->getOperand(0), *Op1COp = Op1C->getOperand(0); in visitOr()
2093 Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1); in visitXor()
2114 if (dyn_castNotVal(Op0I->getOperand(1))) in visitXor()
2116 if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) { in visitXor()
2118 Builder->CreateNot(Op0I->getOperand(1), in visitXor()
2119 Op0I->getOperand(1)->getName()+".not"); in visitXor()
2127 if (isFreeToInvert(Op0I->getOperand(0)) && in visitXor()
2128 isFreeToInvert(Op0I->getOperand(1))) { in visitXor()
2130 Builder->CreateNot(Op0I->getOperand(0), "notlhs"); in visitXor()
2132 Builder->CreateNot(Op0I->getOperand(1), "notrhs"); in visitXor()
2140 if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) in visitXor()
2141 return BinaryOperator::CreateAShr(Op0NotVal, Op0I->getOperand(1)); in visitXor()
2153 CI->getOperand(0), CI->getOperand(1)); in visitXor()
2157 if (CmpInst *CI = dyn_cast<CmpInst>(Op0C->getOperand(0))) { in visitXor()
2174 if (Constant *Op0I0C = dyn_cast<Constant>(Op0I->getOperand(0))) { in visitXor()
2178 return BinaryOperator::CreateAdd(Op0I->getOperand(1), ConstantRHS); in visitXor()
2181 if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1))) { in visitXor()
2189 Op0I->getOperand(0)); in visitXor()
2194 return BinaryOperator::CreateAdd(Op0I->getOperand(0), C); in visitXor()
2199 if (MaskedValueIsZero(Op0I->getOperand(0), Op0CI->getValue())) { in visitXor()
2207 I.setOperand(0, Op0I->getOperand(0)); in visitXor()
2217 (E1 = dyn_cast<BinaryOperator>(Op0I->getOperand(0))) && in visitXor()
2219 (C1 = dyn_cast<ConstantInt>(E1->getOperand(1)))) { in visitXor()
2225 Value *Opnd0 = Builder->CreateLShr(E1->getOperand(0), C2); in visitXor()
2293 Op0I->getOperand(1) == Op1I->getOperand(1) && in visitXor()
2296 Builder->CreateXor(Op0I->getOperand(0), Op1I->getOperand(0), in visitXor()
2299 Op1I->getOperand(1)); in visitXor()
2319 if (ICmpInst *RHS = dyn_cast<ICmpInst>(I.getOperand(1))) in visitXor()
2320 if (ICmpInst *LHS = dyn_cast<ICmpInst>(I.getOperand(0))) in visitXor()
2322 if (LHS->getOperand(0) == RHS->getOperand(1) && in visitXor()
2323 LHS->getOperand(1) == RHS->getOperand(0)) in visitXor()
2325 if (LHS->getOperand(0) == RHS->getOperand(0) && in visitXor()
2326 LHS->getOperand(1) == RHS->getOperand(1)) { in visitXor()
2327 Value *Op0 = LHS->getOperand(0), *Op1 = LHS->getOperand(1); in visitXor()
2340 Type *SrcTy = Op0C->getOperand(0)->getType(); in visitXor()
2341 if (SrcTy == Op1C->getOperand(0)->getType() && SrcTy->isIntegerTy() && in visitXor()
2343 ShouldOptimizeCast(Op0C->getOpcode(), Op0C->getOperand(0), in visitXor()
2345 ShouldOptimizeCast(Op1C->getOpcode(), Op1C->getOperand(0), in visitXor()
2347 Value *NewOp = Builder->CreateXor(Op0C->getOperand(0), in visitXor()
2348 Op1C->getOperand(0), I.getName()); in visitXor()