Lines Matching refs:Builder
62 static Value *generateMinMaxSelectPattern(InstCombiner::BuilderTy *Builder,
67 return Builder->CreateSelect(Builder->CreateICmp(Pred, A, B), A, B);
157 Value *NewSI = Builder->CreateSelect(SI.getCondition(), TI->getOperand(0),
202 Value *NewSI = Builder->CreateSelect(SI.getCondition(), OtherOpT,
250 Value *NewSel = Builder->CreateSelect(SI.getCondition(), OOp, C);
280 Value *NewSel = Builder->CreateSelect(SI.getCondition(), C, OOp);
311 InstCombiner::BuilderTy *Builder) {
342 V = Builder->CreateZExtOrTrunc(V, Y->getType());
343 V = Builder->CreateShl(V, C2Log - C1Log);
345 V = Builder->CreateLShr(V, C1Log - C2Log);
346 V = Builder->CreateZExtOrTrunc(V, Y->getType());
348 V = Builder->CreateZExtOrTrunc(V, Y->getType());
353 V = Builder->CreateXor(V, *C2);
355 return Builder->CreateOr(V, Y);
371 InstCombiner::BuilderTy *Builder) {
402 IRBuilder<> Builder(II);
407 Builder.Insert(NewI);
408 return Builder.CreateZExtOrTrunc(NewI, ValueOnZero->getType());
529 Value *AShr = Builder->CreateAShr(CmpLHS, Ty->getBitWidth()-1);
533 return replaceInstUsesWith(SI, Builder->CreateOr(AShr, C1));
535 Value *And = Builder->CreateAnd(AShr, C2->getValue()-C1->getValue());
536 return replaceInstUsesWith(SI, Builder->CreateAdd(And, C1));
584 V = Builder->CreateAnd(X, ~(*Y));
588 V = Builder->CreateAnd(X, ~(*Y));
592 V = Builder->CreateOr(X, *Y);
596 V = Builder->CreateOr(X, *Y);
603 if (Value *V = foldSelectICmpAndOr(SI, TrueVal, FalseVal, Builder))
606 if (Value *V = foldSelectCttzCtlz(ICI, TrueVal, FalseVal, Builder))
712 Value *NewSI = Builder->CreateSelect(
749 NotA = Builder->CreateNot(A);
751 NotB = Builder->CreateNot(B);
753 NotC = Builder->CreateNot(C);
756 Builder, getInverseMinMaxSelectPattern(SPF1), NotA, NotB);
757 Value *NewOuter = Builder->CreateNot(generateMinMaxSelectPattern(
758 Builder, getInverseMinMaxSelectPattern(SPF2), NewInner, NotC));
771 InstCombiner::BuilderTy *Builder) {
797 TrueVal = ConstantInt::get(Builder->getContext(),
799 FalseVal = ConstantInt::get(Builder->getContext(),
821 Value *V = Builder->CreateZExtOrTrunc(LHS, SI.getType());
823 V = Builder->CreateShl(V, ValZeros - AndZeros);
825 V = Builder->CreateLShr(V, AndZeros - ValZeros);
832 V = Builder->CreateXor(V, ValC);
836 V = Builder->CreateAdd(V, Offset);
843 InstCombiner::BuilderTy &Builder) {
880 NegVal = Builder.CreateFNeg(SubOp->getOperand(1));
887 NegVal = Builder.CreateNeg(SubOp->getOperand(1));
894 Value *NewSel = Builder.CreateSelect(CondVal, NewTrueOp, NewFalseOp,
930 Value *NotCond = Builder->CreateNot(CondVal, "not." + CondVal->getName());
939 Value *NotCond = Builder->CreateNot(CondVal, "not." + CondVal->getName());
975 Value *NotCond = Builder->CreateNot(CondVal, "not." + CondVal->getName());
981 Value *NotCond = Builder->CreateNot(CondVal, "not." + CondVal->getName());
988 if (Value *V = foldSelectICmpAnd(SI, TrueValC, FalseValC, Builder))
1026 IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
1027 Builder->setFastMathFlags(FCI->getFastMathFlags());
1028 Value *NewCond = Builder->CreateFCmp(InvPred, TrueVal, FalseVal,
1069 IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
1070 Builder->setFastMathFlags(FCI->getFastMathFlags());
1071 Value *NewCond = Builder->CreateFCmp(InvPred, FalseVal, TrueVal,
1088 if (Instruction *Add = foldAddSubSelect(SI, *Builder))
1116 Cmp = Builder->CreateICmp(Pred, LHS, RHS);
1118 IRBuilder<>::FastMathFlagGuard FMFG(*Builder);
1120 Builder->setFastMathFlags(FMF);
1121 Cmp = Builder->CreateFCmp(Pred, LHS, RHS);
1124 Value *NewSI = Builder->CreateCast(CastOp,
1125 Builder->CreateSelect(Cmp, LHS, RHS),
1163 Value *NewLHS = Builder->CreateNot(LHS);
1164 Value *NewRHS = Builder->CreateNot(RHS);
1166 ? Builder->CreateICmpSLT(NewLHS, NewRHS)
1167 : Builder->CreateICmpULT(NewLHS, NewRHS);
1169 Builder->CreateNot(Builder->CreateSelect(NewCmp, NewLHS, NewRHS));
1200 Value *And = Builder->CreateAnd(CondVal, TrueSI->getCondition());
1218 Value *Or = Builder->CreateOr(CondVal, FalseSI->getCondition());