Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:Builder

72                               InstCombiner::BuilderTy *Builder) {
76 return Builder->CreateICmp(NewPred, LHS, RHS);
82 InstCombiner::BuilderTy *Builder) {
90 return Builder->CreateFCmp(Pred, LHS, RHS);
130 Builder->getInt(ConstLHS->getValue().byteSwap());
133 Builder->getInt(ConstRHS->getValue().byteSwap());
137 BinOp = Builder->CreateAnd(NewLHS, NewRHS);
139 BinOp = Builder->CreateOr(NewLHS, NewRHS);
141 BinOp = Builder->CreateXor(NewLHS, NewRHS);
144 return Builder->CreateCall(F, BinOp);
163 Value *And = Builder->CreateAnd(X, AndRHS);
172 Value *Or = Builder->CreateOr(X, Together);
183 Value *And = Builder->CreateAnd(X, Together);
215 Value *NewAnd = Builder->CreateAnd(X, AndRHS);
231 ConstantInt *CI = Builder->getInt(AndRHS->getValue() & ShlMask);
251 ConstantInt *CI = Builder->getInt(AndRHS->getValue() & ShrMask);
271 Constant *C = Builder->getInt(AndRHS->getValue() & ShrMask);
276 ShVal = Builder->CreateLShr(ShVal, OpRHS, Op->getName());
298 return Builder->getFalse();
304 return Builder->CreateICmp(pred, V, Hi);
309 Value *Add = Builder->CreateAdd(V, NegLo, V->getName()+".off");
311 return Builder->CreateICmpULT(Add, UpperBound);
315 return Builder->getTrue();
322 return Builder->CreateICmp(pred, V, Hi);
328 Value *Add = Builder->CreateAdd(V, NegLo, V->getName()+".off");
330 return Builder->CreateICmpUGT(Add, LowerBound);
400 return Builder->CreateSub(LHSI->getOperand(0), RHS, "fold");
401 return Builder->CreateAdd(LHSI->getOperand(0), RHS, "fold");
692 llvm::InstCombiner::BuilderTy *Builder) {
723 Value *NewOr = Builder->CreateOr(B, D);
724 Value *NewAnd = Builder->CreateAnd(A, NewOr);
729 return Builder->CreateICmp(NewCC, NewAnd, Zero);
734 Value *NewOr = Builder->CreateOr(B, D);
735 Value *NewAnd = Builder->CreateAnd(A, NewOr);
736 return Builder->CreateICmp(NewCC, NewAnd, NewOr);
741 Value *NewAnd1 = Builder->CreateAnd(B, D);
742 Value *NewAnd2 = Builder->CreateAnd(A, NewAnd1);
743 return Builder->CreateICmp(NewCC, NewAnd2, A);
803 Value *NewOr1 = Builder->CreateOr(B, D);
805 Value *NewAnd = Builder->CreateAnd(A, NewOr1);
806 return Builder->CreateICmp(NewCC, NewAnd, NewOr2);
864 return Builder->CreateICmp(NewPred, Input, RangeEnd);
881 return getNewICmpValue(isSigned, Code, Op0, Op1, Builder);
886 if (Value *V = foldLogOpOfMaskedICmps(LHS, RHS, true, Builder))
909 Value *NewOr = Builder->CreateOr(Val, Val2);
910 return Builder->CreateICmp(LHSCC, NewOr, LHSCst);
941 Value *NewAnd = Builder->CreateAnd(V, Low | AndCst->getValue());
944 return Builder->CreateICmp(LHSCC, NewAnd, NewVal);
1002 return Builder->CreateICmpULT(Val, LHSCst);
1008 return Builder->CreateICmpSLT(Val, LHSCst);
1021 Value *Add = Builder->CreateAdd(Val, AddCST, Val->getName()+".off");
1022 return Builder->CreateICmpUGT(Add, ConstantInt::get(Add->getType(), 1),
1065 return Builder->CreateICmp(LHSCC, Val, RHSCst);
1083 return Builder->CreateICmp(LHSCC, Val, RHSCst);
1120 Builder);
1133 return Builder->getFalse();
1134 return Builder->CreateFCmpORD(LHS->getOperand(0), RHS->getOperand(0));
1141 return Builder->CreateFCmpORD(LHS->getOperand(0), RHS->getOperand(0));
1152 InstCombiner::BuilderTy *Builder) {
1168 Value *LogicOp = Builder->CreateBinOp(Opcode, Op0NotVal, Op1NotVal,
1186 Value *LogicOp = Builder->CreateBinOp(Opcode, A, B,
1188 Value *Not = Builder->CreateNot(LogicOp);
1223 Value *NewOp = Builder->CreateBinOp(LogicOpc, BC, NewConstant, I.getName());
1246 Value *NewOp = Builder->CreateBinOp(LogicOpc, Cast0Src, Cast1Src,
1347 Value *NewRHS = Builder->CreateAnd(Op0RHS, AndRHS,
1354 Value *NewLHS = Builder->CreateAnd(Op0LHS, AndRHS,
1390 Value *NewNeg = Builder->CreateNeg(Op0RHS);
1402 Builder->CreateICmpEQ(Op0RHS, Constant::getNullValue(I.getType()));
1422 Value *NewCast = Builder->CreateTrunc(X, I.getType(), "and.shrunk");
1438 if (Instruction *DeMorgan = matchDeMorgansLaws(I, Builder))
1476 return BinaryOperator::CreateAnd(A, Builder->CreateNot(B));
1492 return BinaryOperator::CreateAnd(Op0, Builder->CreateNot(C));
1498 return BinaryOperator::CreateAnd(Op1, Builder->CreateNot(C));
1524 return replaceInstUsesWith(I, Builder->CreateAnd(Res, Y));
1527 return replaceInstUsesWith(I, Builder->CreateAnd(Res, X));
1532 return replaceInstUsesWith(I, Builder->CreateAnd(Res, Y));
1535 return replaceInstUsesWith(I, Builder->CreateAnd(Res, X));
1614 InstCombiner::BuilderTy &Builder) {
1646 return Builder.CreateXor(Cond, AC);
1654 InstCombiner::BuilderTy &Builder) {
1665 if (Value *Cond = getSelectCondition(A, B, Builder)) {
1667 // The bitcasts will either all exist or all not exist. The builder will
1669 Value *BitcastC = Builder.CreateBitCast(C, A->getType());
1670 Value *BitcastD = Builder.CreateBitCast(D, A->getType());
1671 Value *Select = Builder.CreateSelect(Cond, BitcastC, BitcastD);
1672 return Builder.CreateBitCast(Select, OrigType);
1704 Mask = Builder->CreateOr(LAnd->getOperand(1), RAnd->getOperand(1));
1705 Masked = Builder->CreateAnd(LAnd->getOperand(0), Mask);
1711 Mask = Builder->CreateOr(LAnd->getOperand(0), RAnd->getOperand(0));
1712 Masked = Builder->CreateAnd(LAnd->getOperand(1), Mask);
1716 return Builder->CreateICmp(ICmpInst::ICMP_NE, Masked, Mask);
1767 Value *NewAnd = Builder->CreateAnd(LAddOpnd, MaskCst);
1768 Value *NewAdd = Builder->CreateAdd(NewAnd, MaxAddCst);
1769 return (Builder->CreateICmp(LHS->getPredicate(), NewAdd, LHSCst));
1785 return getNewICmpValue(isSigned, Code, Op0, Op1, Builder);
1791 if (Value *V = foldLogOpOfMaskedICmps(LHS, RHS, false, Builder))
1816 return Builder->CreateICmp(
1818 Builder->CreateAdd(B, ConstantInt::getSigned(B->getType(), -1)), A);
1835 Value *NewOr = Builder->CreateOr(Val, Val2);
1836 return Builder->CreateICmp(LHSCC, NewOr, LHSCst);
1846 return Builder->CreateICmpULE(Val, LHSCst);
1900 Value *Cst = Builder->getInt(Xor);
1901 Value *Or = Builder->CreateOr(LHS->getOperand(0), Cst);
1902 return Builder->CreateICmp(ICmpInst::ICMP_EQ, Or, RHSCst);
1909 Value *Add = Builder->CreateAdd(Val, AddCST, Val->getName()+".off");
1911 return Builder->CreateICmpULT(Add, AddCST);
1934 return Builder->getTrue();
1986 return Builder->getTrue();
2001 return Builder
2032 Builder);
2042 return Builder->getTrue();
2046 return Builder->CreateFCmpUNO(LHS->getOperand(0), RHS->getOperand(0));
2053 return Builder->CreateFCmpUNO(LHS->getOperand(0), RHS->getOperand(0));
2083 Value *NewOp = Builder->CreateAnd((V1 == A) ? B : A, CI1);
2115 Value *NewOp = Builder->CreateAnd(V1 == A ? B : A, CI1);
2151 Value *Or = Builder->CreateOr(X, RHS);
2154 Builder->getInt(RHS->getValue() | C1->getValue()));
2160 Value *Or = Builder->CreateOr(X, RHS);
2163 Builder->getInt(C1->getValue() & ~RHS->getValue()));
2187 Value *NOr = Builder->CreateOr(A, Op1);
2196 Value *NOr = Builder->CreateOr(A, Op0);
2209 return BinaryOperator::CreateOr(Builder->CreateNot(A), B);
2238 Builder->getInt(C1->getValue()|C2->getValue()));
2246 Builder->getInt(C1->getValue()|C2->getValue()));
2255 V2 = Builder->CreateOr(V1, ConstantExpr::getOr(C3, C4), "bitfield");
2257 Builder->getInt(C1->getValue()|C2->getValue()));
2267 if (Value *V = matchSelectFromAndOr(A, C, B, D, *Builder))
2269 if (Value *V = matchSelectFromAndOr(A, C, D, B, *Builder))
2271 if (Value *V = matchSelectFromAndOr(C, A, B, D, *Builder))
2273 if (Value *V = matchSelectFromAndOr(C, A, D, B, *Builder))
2275 if (Value *V = matchSelectFromAndOr(B, D, A, C, *Builder))
2277 if (Value *V = matchSelectFromAndOr(B, D, C, A, *Builder))
2279 if (Value *V = matchSelectFromAndOr(D, B, A, C, *Builder))
2281 if (Value *V = matchSelectFromAndOr(D, B, C, A, *Builder))
2342 return BinaryOperator::CreateOr(Op1, Builder->CreateAnd(A, C));
2344 if (Instruction *DeMorgan = matchDeMorgansLaws(I, Builder))
2366 Value *Not = Builder->CreateNot(B, B->getName()+".not");
2370 Value *Not = Builder->CreateNot(A, A->getName()+".not");
2384 Value *Not = Builder->CreateNot(NotOp, NotOp->getName()+".not");
2391 return BinaryOperator::CreateXor(Builder->CreateNot(A), B);
2396 return BinaryOperator::CreateXor(Builder->CreateNot(A), B);
2414 return replaceInstUsesWith(I, Builder->CreateOr(Res, Y));
2417 return replaceInstUsesWith(I, Builder->CreateOr(Res, X));
2422 return replaceInstUsesWith(I, Builder->CreateOr(Res, Y));
2425 return replaceInstUsesWith(I, Builder->CreateOr(Res, X));
2453 Value *Inner = Builder->CreateOr(A, Op1);
2466 Value *orTrue = Builder->CreateOr(A, C);
2467 Value *orFalse = Builder->CreateOr(B, D);
2508 Builder->CreateNot(Op0I->getOperand(1),
2522 Builder->CreateNot(Op0I->getOperand(0), "notlhs");
2524 Builder->CreateNot(Op0I->getOperand(1), "notrhs");
2554 (RHS == ConstantExpr::getCast(Opcode, Builder->getTrue(),
2584 Constant *C = Builder->getInt(RHS->getValue() + Op0CI->getValue());
2617 Value *Opnd0 = Builder->CreateLShr(E1->getOperand(0), C2);
2670 return BinaryOperator::CreateAnd(A, Builder->CreateNot(Op1));
2677 return BinaryOperator::CreateAnd(Builder->CreateNot(A), Op1);
2721 Builder->CreateAnd(Builder->CreateNot(A), B), C);
2724 Builder->CreateAnd(Builder->CreateNot(B), A), C);
2731 Builder->CreateAnd(Builder->CreateNot(A), B), C);
2734 Builder->CreateAnd(Builder->CreateNot(B), A), C);
2750 return BinaryOperator::CreateNot(Builder->CreateAnd(A, B));
2766 Builder));