Lines Matching refs:BinaryOperator

163 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {  in isReassociableOp()
164 auto *BO = dyn_cast<BinaryOperator>(V); in isReassociableOp()
171 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode1, in isReassociableOp()
173 auto *BO = dyn_cast<BinaryOperator>(V); in isReassociableOp()
237 assert(isa<BinaryOperator>(I) && "Expected binary operator."); in canonicalizeOperands()
245 cast<BinaryOperator>(I)->swapOperands(); in canonicalizeOperands()
248 static BinaryOperator *CreateAdd(Value *S1, Value *S2, const Twine &Name, in CreateAdd()
252 return BinaryOperator::CreateAdd(S1, S2, Name, InsertBefore); in CreateAdd()
254 BinaryOperator *Res = in CreateAdd()
255 BinaryOperator::CreateFAdd(S1, S2, Name, InsertBefore); in CreateAdd()
261 static BinaryOperator *CreateMul(Value *S1, Value *S2, const Twine &Name, in CreateMul()
265 return BinaryOperator::CreateMul(S1, S2, Name, InsertBefore); in CreateMul()
267 BinaryOperator *Res = in CreateMul()
268 BinaryOperator::CreateFMul(S1, S2, Name, InsertBefore); in CreateMul()
278 return BinaryOperator::CreateNeg(S1, Name, InsertBefore); in CreateNeg()
287 static BinaryOperator *LowerNegateToMultiply(Instruction *Neg) { in LowerNegateToMultiply()
288 assert((isa<UnaryOperator>(Neg) || isa<BinaryOperator>(Neg)) && in LowerNegateToMultiply()
291 unsigned OpNo = isa<BinaryOperator>(Neg) ? 1 : 0; in LowerNegateToMultiply()
296 BinaryOperator *Res = in LowerNegateToMultiply()
384 assert((isa<UnaryOperator>(I) || isa<BinaryOperator>(I)) && in LinearizeExprTree()
444 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) { in LinearizeExprTree()
511 if (BinaryOperator *UserBO = dyn_cast<BinaryOperator>(U)) in LinearizeExprTree()
568 void ReassociatePass::RewriteExprTree(BinaryOperator *I, in RewriteExprTree()
584 SmallVector<BinaryOperator*, 8> NodesToRewrite; in RewriteExprTree()
586 BinaryOperator *Op = I; in RewriteExprTree()
606 BinaryOperator *ExpressionChangedStart = nullptr, in RewriteExprTree()
636 BinaryOperator *BO = isReassociableOp(OldLHS, Opcode); in RewriteExprTree()
642 BinaryOperator *BO = isReassociableOp(OldRHS, Opcode); in RewriteExprTree()
669 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode); in RewriteExprTree()
685 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode); in RewriteExprTree()
698 BinaryOperator *NewOp; in RewriteExprTree()
701 NewOp = BinaryOperator::Create(Instruction::BinaryOps(Opcode), Poison, in RewriteExprTree()
760 cast<BinaryOperator>(*ExpressionChangedStart->user_begin()); in RewriteExprTree()
765 for (BinaryOperator *BO : NodesToRewrite) in RewriteExprTree()
796 if (BinaryOperator *I = in NegateValue()
960 static BinaryOperator *convertOrWithNoCommonBitsToAdd(Instruction *Or) { in convertOrWithNoCommonBitsToAdd()
962 BinaryOperator *New = CreateAdd(Or->getOperand(0), Or->getOperand(1), "", in convertOrWithNoCommonBitsToAdd()
1007 static BinaryOperator *BreakUpSubtract(Instruction *Sub, in BreakUpSubtract()
1015 BinaryOperator *New = in BreakUpSubtract()
1031 static BinaryOperator *ConvertShiftToMul(Instruction *Shl) { in ConvertShiftToMul()
1037 BinaryOperator *Mul = BinaryOperator::CreateMul(Shl->getOperand(0), MulCst, in ConvertShiftToMul()
1050 bool NSW = cast<BinaryOperator>(Shl)->hasNoSignedWrap(); in ConvertShiftToMul()
1051 bool NUW = cast<BinaryOperator>(Shl)->hasNoUnsignedWrap(); in ConvertShiftToMul()
1101 BinaryOperator *BO = isReassociableOp(V, Instruction::Mul, Instruction::FMul); in RemoveFactorFromExpression()
1176 BinaryOperator *BO = isReassociableOp(V, Instruction::Mul, Instruction::FMul); in FindSingleUseMultiplyFactors()
1248 Instruction *I = BinaryOperator::CreateAnd( in createAndInstr()
1590 BinaryOperator *BOp = in OptimizeAdd()
1655 ? BinaryOperator::CreateAdd(MaxOccVal, MaxOccVal) in OptimizeAdd()
1656 : BinaryOperator::CreateFAdd(MaxOccVal, MaxOccVal); in OptimizeAdd()
1661 BinaryOperator *BOp = in OptimizeAdd()
1860 Value *ReassociatePass::OptimizeMul(BinaryOperator *I, in OptimizeMul()
1890 Value *ReassociatePass::OptimizeExpression(BinaryOperator *I, in OptimizeExpression()
2144 if (!isa<UnaryOperator>(I) && !isa<BinaryOperator>(I)) in OptimizeInst()
2216 if (BinaryOperator *Tmp = dyn_cast<BinaryOperator>(U)) in OptimizeInst()
2234 Value *Op = isa<BinaryOperator>(I) ? I->getOperand(1) : in OptimizeInst()
2243 if (BinaryOperator *Tmp = dyn_cast<BinaryOperator>(U)) in OptimizeInst()
2255 BinaryOperator *BO = cast<BinaryOperator>(I); in OptimizeInst()
2282 void ReassociatePass::ReassociateExpression(BinaryOperator *I) { in ReassociateExpression()