| /freebsd/contrib/llvm-project/clang/include/clang/AST/ |
| H A D | StmtVisitor.h | 49 if (PTR(BinaryOperator) BinOp = dyn_cast<BinaryOperator>(S)) { in Visit() 51 case BO_PtrMemD: DISPATCH(BinPtrMemD, BinaryOperator); in Visit() 52 case BO_PtrMemI: DISPATCH(BinPtrMemI, BinaryOperator); in Visit() 53 case BO_Mul: DISPATCH(BinMul, BinaryOperator); in Visit() 54 case BO_Div: DISPATCH(BinDiv, BinaryOperator); in Visit() 55 case BO_Rem: DISPATCH(BinRem, BinaryOperator); in Visit() 56 case BO_Add: DISPATCH(BinAdd, BinaryOperator); in Visit() 57 case BO_Sub: DISPATCH(BinSub, BinaryOperator); in Visit() 58 case BO_Shl: DISPATCH(BinShl, BinaryOperator); in Visit() 59 case BO_Shr: DISPATCH(BinShr, BinaryOperator); in Visit() [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
| H A D | InstCombineInternal.h | 92 Instruction *visitAdd(BinaryOperator &I); 93 Instruction *visitFAdd(BinaryOperator &I); 96 Instruction *visitSub(BinaryOperator &I); 97 Instruction *visitFSub(BinaryOperator &I); 98 Instruction *visitMul(BinaryOperator &I); 99 Instruction *foldPowiReassoc(BinaryOperator &I); 100 Instruction *foldFMulReassoc(BinaryOperator &I); 101 Instruction *visitFMul(BinaryOperator &I); 102 Instruction *visitURem(BinaryOperator &I); 103 Instruction *visitSRem(BinaryOperator &I); [all …]
|
| H A D | InstCombineMulDivRem.cpp | 67 BinaryOperator *I = dyn_cast<BinaryOperator>(V); in simplifyValueKnownNonZero() 100 static Value *foldMulSelectToNegate(BinaryOperator &I, in foldMulSelectToNegate() 142 static Value *foldMulShl1(BinaryOperator &Mul, bool CommuteOperands, in foldMulShl1() 162 BinaryOperator *Shift; in foldMulShl1() 189 Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) { in visitMul() 215 return HasNSW ? BinaryOperator::CreateNSWNeg(Op0) in visitMul() 216 : BinaryOperator::CreateNeg(Op0); in visitMul() 231 BinaryOperator *Mul = cast<BinaryOperator>(I.getOperand(0)); in visitMul() 232 BinaryOperator *BO = BinaryOperator::CreateMul(NewOp, Shl); in visitMul() 243 BinaryOperator *Shl = BinaryOperator::CreateShl(NewOp, NewCst); in visitMul() [all …]
|
| H A D | InstCombineShifts.cpp | 59 BinaryOperator *Sh0, const SimplifyQuery &SQ, in reassociateShiftAmtsOfTwoSameDirectionShifts() 147 BinaryOperator *NewShift = BinaryOperator::Create(ShiftOpcode, X, NewShAmt); in reassociateShiftAmtsOfTwoSameDirectionShifts() 189 dropRedundantMaskingOfLeftShiftInput(BinaryOperator *OuterShift, in dropRedundantMaskingOfLeftShiftInput() 334 auto *NewShift = BinaryOperator::Create(OuterShift->getOpcode(), X, in dropRedundantMaskingOfLeftShiftInput() 340 return BinaryOperator::Create(Instruction::And, NewShift, NewMask); in dropRedundantMaskingOfLeftShiftInput() 348 static Instruction *foldShiftOfShiftedBinOp(BinaryOperator &I, in foldShiftOfShiftedBinOp() 351 auto *BinInst = dyn_cast<BinaryOperator>(I.getOperand(0)); in foldShiftOfShiftedBinOp() 402 return BinaryOperator::Create(BinInst->getOpcode(), Op1, Op2); in foldShiftOfShiftedBinOp() 405 Instruction *InstCombinerImpl::commonShiftTransforms(BinaryOperator &I) { in commonShiftTransforms() 417 return BinaryOperator::Create(I.getOpcode(), Op0, NewExt); in commonShiftTransforms() [all …]
|
| H A D | InstCombineAddSub.cpp | 752 static Value *checkForNegativeOperand(BinaryOperator &I, in checkForNegativeOperand() 809 static Instruction *foldNoWrapAdd(BinaryOperator &Add, in foldNoWrapAdd() 843 return BinaryOperator::CreateAdd(WideX, NewC); in foldNoWrapAdd() 851 return BinaryOperator::CreateAdd(WideX, NewC); in foldNoWrapAdd() 856 Instruction *InstCombinerImpl::foldAddWithConstant(BinaryOperator &Add) { in foldAddWithConstant() 871 return BinaryOperator::CreateSub(ConstantExpr::getAdd(Op00C, Op1C), X); in foldAddWithConstant() 878 return BinaryOperator::CreateAdd(Builder.CreateNot(Y), X); in foldAddWithConstant() 894 BinaryOperator *Res = in foldAddWithConstant() 895 BinaryOperator::CreateSub(ConstantExpr::getSub(Op1C, COne), X); in foldAddWithConstant() 914 BinaryOperator *NewAdd = in foldAddWithConstant() [all …]
|
| H A D | InstCombineAndOrXor.cpp | 1571 Instruction *InstCombinerImpl::foldLogicOfIsFPClass(BinaryOperator &BO, in foldLogicOfIsFPClass() 1638 BinaryOperator &I) { in canonicalizeConditionalNegationViaMathToSelect() 1639 assert(I.getOpcode() == BinaryOperator::Xor && "Only for xor!"); in canonicalizeConditionalNegationViaMathToSelect() 1655 static Instruction *reassociateFCmps(BinaryOperator &BO, in reassociateFCmps() 1690 return BinaryOperator::Create(Opcode, NewFCmp, BO11); in reassociateFCmps() 1696 static Instruction *matchDeMorgansLaws(BinaryOperator &I, in matchDeMorgansLaws() 1714 return BinaryOperator::CreateNot(AndOr); in matchDeMorgansLaws() 1726 return BinaryOperator::Create(Opcode, A, IC.Builder.CreateNot(FlippedBO)); in matchDeMorgansLaws() 1749 static Instruction *foldLogicCastConstant(BinaryOperator &Logic, CastInst *Cast, in foldLogicCastConstant() 1784 Instruction *InstCombinerImpl::foldCastedBitwiseLogic(BinaryOperator &I) { in foldCastedBitwiseLogic() [all …]
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Utils/ |
| H A D | IntegerDivision.h | 22 class BinaryOperator; variable 34 LLVM_ABI bool expandRemainder(BinaryOperator *Rem); 43 LLVM_ABI bool expandDivision(BinaryOperator *Div); 51 LLVM_ABI bool expandRemainderUpTo32Bits(BinaryOperator *Rem); 57 LLVM_ABI bool expandRemainderUpTo64Bits(BinaryOperator *Rem); 64 LLVM_ABI bool expandDivisionUpTo32Bits(BinaryOperator *Div); 70 LLVM_ABI bool expandDivisionUpTo64Bits(BinaryOperator *Div);
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
| H A D | Instruction.def | 147 HANDLE_BINARY_INST(13, Add , BinaryOperator) 148 HANDLE_BINARY_INST(14, FAdd , BinaryOperator) 149 HANDLE_BINARY_INST(15, Sub , BinaryOperator) 150 HANDLE_BINARY_INST(16, FSub , BinaryOperator) 151 HANDLE_BINARY_INST(17, Mul , BinaryOperator) 152 HANDLE_BINARY_INST(18, FMul , BinaryOperator) 153 HANDLE_BINARY_INST(19, UDiv , BinaryOperator) 154 HANDLE_BINARY_INST(20, SDiv , BinaryOperator) 155 HANDLE_BINARY_INST(21, FDiv , BinaryOperator) 156 HANDLE_BINARY_INST(22, URem , BinaryOperator) [all …]
|
| H A D | InstrTypes.h | 171 class BinaryOperator : public Instruction { 177 LLVM_ABI BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty, 183 LLVM_ABI BinaryOperator *cloneImpl() const; 198 LLVM_ABI static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2, 206 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \ 212 static BinaryOperator *Create##OPC(Value *V1, Value *V2, const Twine &Name, \ 218 static BinaryOperator * 222 BinaryOperator *BO = Create(Opc, V1, V2, Name, InsertBefore); 227 static BinaryOperator *CreateWithFMF(BinaryOps Opc, Value *V1, Value *V2, 231 BinaryOperator *BO = Create(Opc, V1, V2, Name, InsertBefore); [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
| H A D | ExpandLargeDivRem.cpp | 56 static void scalarize(BinaryOperator *BO, in scalarize() 57 SmallVectorImpl<BinaryOperator *> &Replace) { in scalarize() 69 if (auto *NewBO = dyn_cast<BinaryOperator>(Op)) { in scalarize() 80 SmallVector<BinaryOperator *, 4> Replace; in runImpl() 81 SmallVector<BinaryOperator *, 4> ReplaceVector; in runImpl() 111 ReplaceVector.push_back(&cast<BinaryOperator>(I)); in runImpl() 113 Replace.push_back(&cast<BinaryOperator>(I)); in runImpl() 123 BinaryOperator *BO = ReplaceVector.pop_back_val(); in runImpl() 131 BinaryOperator *I = Replace.pop_back_val(); in runImpl()
|
| /freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Core/ |
| H A D | RangedConstraintManager.cpp | 36 BinaryOperator::Opcode op = SIE->getOpcode(); in assumeSym() 37 if (BinaryOperator::isComparisonOp(op) && op != BO_Cmp) { in assumeSym() 39 op = BinaryOperator::negateComparisonOp(op); in assumeSym() 50 BinaryOperator::Opcode Op = SSE->getOpcode(); in assumeSym() 51 if (BinaryOperator::isComparisonOp(Op)) { in assumeSym() 69 Op = BinaryOperator::reverseComparisonOp(Op); in assumeSym() 71 Op = BinaryOperator::negateComparisonOp(Op); in assumeSym() 75 if (BinaryOperator::isEqualityOp(Op)) { in assumeSym() 154 BinaryOperator::Opcode Op, in assumeSymRel() 156 assert(BinaryOperator::isComparisonOp(Op) && in assumeSymRel() [all …]
|
| H A D | SimpleSValBuilder.cpp | 72 SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, 74 SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op, 76 SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op, 96 SVal MakeSymIntVal(const SymExpr *LHS, BinaryOperator::Opcode op, 129 BinaryOperator::Opcode op, in MakeSymIntVal() 197 if (BinaryOperator::isComparisonOp(op)) { in MakeSymIntVal() 216 } else if (BinaryOperator::isAdditiveOp(op) && RHS.isNegative()) { in MakeSymIntVal() 234 static bool isInRelation(BinaryOperator::Opcode Rel, SymbolRef Sym, in isInRelation() 280 if (BinaryOperator::isAdditiveOp(SymInt->getOpcode())) in decomposeSymbol() 294 BinaryOperator::Opcode Op, in doRearrangeUnchecked() [all …]
|
| /freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/ |
| H A D | NaryReassociate.h | 89 class BinaryOperator; variable 139 Instruction *tryReassociateBinaryOp(BinaryOperator *I); 144 BinaryOperator *I); 147 BinaryOperator *I); 150 bool matchTernaryOp(BinaryOperator *I, Value *V, Value *&Op1, Value *&Op2); 153 const SCEV *getBinarySCEV(BinaryOperator *I, const SCEV *LHS,
|
| H A D | Reassociate.h | 37 class BinaryOperator; variable 105 void ReassociateExpression(BinaryOperator *I); 106 void RewriteExprTree(BinaryOperator *I, 109 Value *OptimizeExpression(BinaryOperator *I, 122 Value *OptimizeMul(BinaryOperator *I,
|
| /freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
| H A D | Reassociate.cpp | 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() 250 static BinaryOperator *CreateAdd(Value *S1, Value *S2, const Twine &Name, in CreateAdd() 254 return BinaryOperator::CreateAdd(S1, S2, Name, InsertBefore); in CreateAdd() 256 BinaryOperator *Res = in CreateAdd() 257 BinaryOperator::CreateFAdd(S1, S2, Name, InsertBefore); in CreateAdd() [all …]
|
| H A D | CorrelatedValuePropagation.cpp | 516 static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI); 546 if (auto *BO = dyn_cast<BinaryOperator>(NegX)) in processAbsIntrinsic() 649 if (auto *BO = dyn_cast<BinaryOperator>(NewOp)) in processOverflowIntrinsic() 659 BinaryOperator *BinOp = BinaryOperator::Create( in processSaturatingInst() 669 if (auto *BO = dyn_cast<BinaryOperator>(BinOp)) in processSaturatingInst() 768 static bool narrowSDivOrSRem(BinaryOperator *Instr, const ConstantRange &LCR, in narrowSDivOrSRem() 805 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in narrowSDivOrSRem() 814 static bool expandUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in expandUDivOrURem() 895 static bool narrowUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in narrowUDivOrURem() 923 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in narrowUDivOrURem() [all …]
|
| H A D | SeparateConstOffsetFromGEP.cpp | 269 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended, 321 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO, 515 BinaryOperator *BO, in CanTraceInto() 582 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() 632 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() 714 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() 720 BinaryOperator *NewBO = nullptr; in distributeExtsAndCloneChain() 722 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain() 725 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain() 737 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() [all …]
|
| /freebsd/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ |
| H A D | TestAfterDivZeroChecker.cpp | 76 : public Checker<check::PreStmt<BinaryOperator>, check::BranchCondition, 82 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const; 102 if (const BinaryOperator *BO = P->getStmtAs<BinaryOperator>()) { in REGISTER_SET_WITH_PROGRAMSTATE() 103 BinaryOperator::Opcode Op = BO->getOpcode(); in REGISTER_SET_WITH_PROGRAMSTATE() 193 void TestAfterDivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt() 195 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt() 207 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(Condition)) { in checkBranchCondition()
|
| H A D | UndefResultChecker.cpp | 28 : public Checker< check::PostStmt<BinaryOperator> > { 33 void checkPostStmt(const BinaryOperator *B, CheckerContext &C) const; 60 void UndefResultChecker::checkPostStmt(const BinaryOperator *B, in checkPostStmt() 92 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt() 99 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt()
|
| H A D | BitwiseShiftChecker.cpp | 54 const BinaryOperator *const Op; 65 BitwiseShiftValidator(const BinaryOperator *O, CheckerContext &C, in BitwiseShiftValidator() 81 bool assumeRequirement(OperandSide Side, BinaryOperator::Opcode Cmp, unsigned Limit); 83 void recordAssumption(OperandSide Side, BinaryOperator::Opcode Cmp, unsigned Limit); 136 BinaryOperator::Opcode Comparison, in assumeRequirement() 298 BinaryOperator::Opcode Comparison, in recordAssumption() 345 class BitwiseShiftChecker : public Checker<check::PreStmt<BinaryOperator>> { 349 void checkPreStmt(const BinaryOperator *B, CheckerContext &Ctx) const { in checkPreStmt() 350 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
|
| H A D | DivZeroChecker.cpp | 28 class DivZeroChecker : public CheckerFamily<check::PreStmt<BinaryOperator>> { 41 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const; 50 if (const auto *BE = dyn_cast<BinaryOperator>(S)) in getDenomExpr() 82 void DivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt() 84 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
|
| H A D | FixedAddressChecker.cpp | 26 : public Checker< check::PreStmt<BinaryOperator> > { 30 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const; 34 void FixedAddressChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
|
| /freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
| H A D | IntegerDivision.cpp | 354 bool llvm::expandRemainder(BinaryOperator *Rem) { in expandRemainder() 380 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandRemainder() 392 if (BinaryOperator *UDiv = dyn_cast<BinaryOperator>(Builder.GetInsertPoint())) { in expandRemainder() 406 bool llvm::expandDivision(BinaryOperator *Div) { in expandDivision() 433 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandDivision() 455 bool llvm::expandRemainderUpTo32Bits(BinaryOperator *Rem) { in expandRemainderUpTo32Bits() 496 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo32Bits() 504 bool llvm::expandRemainderUpTo64Bits(BinaryOperator *Rem) { in expandRemainderUpTo64Bits() 542 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo64Bits() 551 bool llvm::expandDivisionUpTo32Bits(BinaryOperator *Div) { in expandDivisionUpTo32Bits() [all …]
|
| /freebsd/contrib/llvm-project/llvm/lib/Analysis/ |
| H A D | PHITransAddr.cpp | 249 bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap(); in translateSubExpr() 250 bool isNUW = cast<BinaryOperator>(Inst)->hasNoUnsignedWrap(); in translateSubExpr() 256 if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(LHS)) in translateSubExpr() 284 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) in translateSubExpr() 416 BinaryOperator *Res = BinaryOperator::CreateAdd( in insertTranslatedSubExpr() 419 Res->setHasNoSignedWrap(cast<BinaryOperator>(Inst)->hasNoSignedWrap()); in insertTranslatedSubExpr() 420 Res->setHasNoUnsignedWrap(cast<BinaryOperator>(Inst)->hasNoUnsignedWrap()); in insertTranslatedSubExpr()
|
| H A D | Lint.cpp | 103 void visitXor(BinaryOperator &I); 104 void visitSub(BinaryOperator &I); 105 void visitLShr(BinaryOperator &I); 106 void visitAShr(BinaryOperator &I); 107 void visitShl(BinaryOperator &I); 108 void visitSDiv(BinaryOperator &I); 109 void visitUDiv(BinaryOperator &I); 110 void visitSRem(BinaryOperator &I); 111 void visitURem(BinaryOperator &I); 515 void Lint::visitXor(BinaryOperator &I) { in visitXor() [all …]
|