Home
last modified time | relevance | path

Searched refs:BinaryOperator (Results 1 – 25 of 418) sorted by relevance

12345678910>>...17

/llvm-project/clang/include/clang/AST/
H A DStmtVisitor.h49 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()
[all...]
/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineInternal.h91 Instruction *visitAdd(BinaryOperator &I);
92 Instruction *visitFAdd(BinaryOperator &I);
95 Instruction *visitSub(BinaryOperator &I);
96 Instruction *visitFSub(BinaryOperator &I);
97 Instruction *visitMul(BinaryOperator &I);
98 Instruction *foldPowiReassoc(BinaryOperator &I);
99 Instruction *foldFMulReassoc(BinaryOperator &I);
100 Instruction *visitFMul(BinaryOperator &I);
101 Instruction *visitURem(BinaryOperator &I);
102 Instruction *visitSRem(BinaryOperator
[all...]
H A DInstCombineMulDivRem.cpp67 BinaryOperator *I = dyn_cast<BinaryOperator>(V); in simplifyValueKnownNonZero()
100 static Value *foldMulSelectToNegate(BinaryOperator &I, in foldMulSelectToNegate()
142 static Value *foldMulShl1(BinaryOperator &Mul, bool CommuteOperands,
162 BinaryOperator *Shift; in foldMulShl1()
189 Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
215 return HasNSW ? BinaryOperator::CreateNSWNeg(Op0) in visitMul()
216 : BinaryOperator::CreateNeg(Op0); in visitMul()
231 BinaryOperator *Mul = cast<BinaryOperator>( in visitMul()
[all...]
H A DInstCombineShifts.cpp59 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
[all...]
H A DInstCombineAddSub.cpp752 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 foldAddWithConstant()
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 *NewAd in foldAddWithConstant()
[all...]
H A DInstCombineAndOrXor.cpp1570 Instruction *InstCombinerImpl::foldLogicOfIsFPClass(BinaryOperator &BO, in reassociateFCmps()
1637 BinaryOperator &I) { in matchDeMorgansLaws()
1638 assert(I.getOpcode() == BinaryOperator::Xor && "Only for xor!"); in matchDeMorgansLaws()
1654 static Instruction *reassociateFCmps(BinaryOperator &BO, in shouldOptimizeCast()
1689 return BinaryOperator::Create(Opcode, NewFCmp, BO11); in foldLogicCastConstant()
1695 static Instruction *matchDeMorgansLaws(BinaryOperator &I,
1713 return BinaryOperator::CreateNot(AndOr); in foldCastedBitwiseLogic()
1725 return BinaryOperator::Create(Opcode, A, IC.Builder.CreateNot(FlippedBO)); in foldCastedBitwiseLogic()
1748 static Instruction *foldLogicCastConstant(BinaryOperator &Logic, CastInst *Cast, in foldCastedBitwiseLogic()
1783 Instruction *InstCombinerImpl::foldCastedBitwiseLogic(BinaryOperator in foldCastedBitwiseLogic()
[all...]
/llvm-project/llvm/include/llvm/Transforms/Utils/
H A DIntegerDivision.h20 class BinaryOperator; variable
32 bool expandRemainder(BinaryOperator *Rem);
41 bool expandDivision(BinaryOperator* Div);
49 bool expandRemainderUpTo32Bits(BinaryOperator *Rem);
55 bool expandRemainderUpTo64Bits(BinaryOperator *Rem);
62 bool expandDivisionUpTo32Bits(BinaryOperator *Div);
68 bool expandDivisionUpTo64Bits(BinaryOperator *Div);
/llvm-project/llvm/include/llvm/IR/
H A DInstrTypes.h167 // BinaryOperator Class
170 class BinaryOperator : public Instruction {
176 BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
182 BinaryOperator *cloneImpl() const;
197 static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
205 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
211 static BinaryOperator *Create##OPC(Value *V1, Value *V2, const Twine &Name, \
217 static BinaryOperator *
221 BinaryOperator *BO = Create(Opc, V1, V2, Name, InsertBefore);
226 static BinaryOperator *CreateWithFM
[all...]
H A DInstruction.def147 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 …]
/llvm-project/clang-tools-extra/clang-tidy/readability/
H A DMathMissingParenthesesCheck.cpp28 static int getPrecedence(const BinaryOperator *BinOp) { in getPrecedence()
49 static void addParantheses(const BinaryOperator *BinOp, in addParantheses()
50 const BinaryOperator *ParentBinOp, in addParantheses()
82 addParantheses(dyn_cast<BinaryOperator>(BinOp->getLHS()->IgnoreImpCasts()), in addParantheses()
84 addParantheses(dyn_cast<BinaryOperator>(BinOp->getRHS()->IgnoreImpCasts()), in addParantheses()
90 const auto *BinOp = Result.Nodes.getNodeAs<BinaryOperator>("binOp"); in check()
92 std::pair<clang::SourceRange, std::pair<const clang::BinaryOperator *, in check()
93 const clang::BinaryOperator *>>> in check()
H A DSimplifyBooleanExprCheck.cpp47 if (isa<BinaryOperator>(E) || isa<ConditionalOperator>(E)) in needsParensAfterUnaryNegation()
60 static StringRef negatedOperator(const BinaryOperator *BinOp) { in negatedOperator()
64 return BinaryOperator::getOpcodeStr(NegatableOp.second); in negatedOperator()
66 return BinaryOperator::getOpcodeStr(NegatableOp.first); in negatedOperator()
146 (isa<BinaryOperator>(E) ? ("(" + getText(Context, *E) + ")") in compareExpressionToConstant()
192 if (const auto *BinOp = dyn_cast<BinaryOperator>(E)) { in replacementExpression()
300 bool VisitBinaryOperator(const BinaryOperator *Op) const { in VisitBinaryOperator()
405 const auto *BO = dyn_cast<BinaryOperator>(S); in VisitIfStmt()
523 const auto *BinaryOp = dyn_cast<BinaryOperator>(E); in isExpectedBinaryOp()
529 static bool checkEitherSide(const BinaryOperator *BO, Functor Func) { in checkEitherSide()
[all …]
/llvm-project/clang/lib/StaticAnalyzer/Checkers/
H A DIdenticalExprChecker.cpp
H A DTestAfterDivZeroChecker.cpp79 : public Checker<check::PreStmt<BinaryOperator>, check::BranchCondition,
85 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
105 if (const BinaryOperator *BO = P->getStmtAs<BinaryOperator>()) { in REGISTER_SET_WITH_PROGRAMSTATE()
106 BinaryOperator::Opcode Op = BO->getOpcode(); in REGISTER_SET_WITH_PROGRAMSTATE()
196 void TestAfterDivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
198 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
210 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(Condition)) { in checkBranchCondition()
H A DMallocOverflowSecurityChecker.cpp
H A DUndefResultChecker.cpp29 : public Checker< check::PostStmt<BinaryOperator> > {
34 void checkPostStmt(const BinaryOperator *B, CheckerContext &C) const;
61 void UndefResultChecker::checkPostStmt(const BinaryOperator *B, in checkPostStmt()
93 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt()
100 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt()
/llvm-project/clang/lib/StaticAnalyzer/Core/
H A DSimpleSValBuilder.cpp72 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 in doRearrangeUnchecked()
[all...]
H A DRangedConstraintManager.cpp36 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 in assumeSymRel()
[all...]
/llvm-project/llvm/lib/CodeGen/
H A DExpandLargeDivRem.cpp56 static void scalarize(BinaryOperator *BO,
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()
/llvm-project/llvm/lib/Transforms/Scalar/
H A DReassociate.cpp163 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 in CreateAdd()
[all...]
H A DCorrelatedValuePropagation.cpp504 static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI); in processAbsIntrinsic()
534 if (auto *BO = dyn_cast<BinaryOperator>(NegX)) in processAbsIntrinsic()
637 if (auto *BO = dyn_cast<BinaryOperator>(NewOp)) in processSaturatingInst()
647 BinaryOperator *BinOp = BinaryOperator::Create( in processSaturatingInst()
657 if (auto *BO = dyn_cast<BinaryOperator>(BinOp)) in processCallSite()
756 static bool narrowSDivOrSRem(BinaryOperator *Instr, const ConstantRange &LCR, in narrowSDivOrSRem()
793 if (auto *BinOp = dyn_cast<BinaryOperator>(BO))
802 static bool expandUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in expandUDivOrURem()
883 static bool narrowUDivOrURem(BinaryOperator *Inst in narrowUDivOrURem()
[all...]
/llvm-project/llvm/include/llvm/Transforms/Scalar/
H A DNaryReassociate.h89 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,
/llvm-project/clang/unittests/AST/
H A DASTTypeTraitsTest.cpp69 EXPECT_TRUE(DNT<Expr>().isBaseOf(DNT<BinaryOperator>())); in TEST()
70 EXPECT_FALSE(DNT<CallExpr>().isBaseOf(DNT<BinaryOperator>())); in TEST()
71 EXPECT_FALSE(DNT<BinaryOperator>().isBaseOf(DNT<CallExpr>())); in TEST()
81 EXPECT_TRUE(DNT<BinaryOperator>().isSame( in TEST()
82 ASTNodeKind::getMostDerivedType(DNT<Expr>(), DNT<BinaryOperator>()))); in TEST()
83 EXPECT_TRUE(DNT<BinaryOperator>().isSame( in TEST()
84 ASTNodeKind::getMostDerivedType(DNT<BinaryOperator>(), DNT<Expr>()))); in TEST()
92 DNT<BinaryOperator>()).isNone()); in TEST()
97 DNT<Expr>(), DNT<BinaryOperator>()))); in TEST()
99 DNT<BinaryOperator>(), DNT<Expr>()))); in TEST()
/llvm-project/clang-tools-extra/clang-tidy/misc/
H A DRedundantExpressionCheck.cpp137 if (cast<BinaryOperator>(Left)->isAssignmentOp()) in areEquivalentExpr()
139 return cast<BinaryOperator>(Left)->getOpcode() == in areEquivalentExpr()
140 cast<BinaryOperator>(Right)->getOpcode(); in areEquivalentExpr()
315 static OverloadedOperatorKind getOp(const BinaryOperator *Op) { in getOp()
316 return BinaryOperator::getOverloadedOperator(Op->getOpcode()); in getOp()
326 getOperands(const BinaryOperator *Op) { in getOperands()
444 AST_MATCHER(BinaryOperator, operandsAreEquivalent) { in AST_MATCHER() argument
448 AST_MATCHER(BinaryOperator, nestedOperandsAreEquivalent) { in AST_MATCHER() argument
465 AST_MATCHER(BinaryOperator, binaryOperatorIsInMacro) { in AST_MATCHER() argument
561 if (const auto *BinExpr = Result.Nodes.getNodeAs<BinaryOperator>(I in retrieveBinOpIntegerConstantExpr()
[all...]
/llvm-project/llvm/lib/Transforms/Utils/
H A DIntegerDivision.cpp354 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) {
433 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandDivision()
455 bool llvm::expandRemainderUpTo32Bits(BinaryOperator *Rem) {
496 return expandRemainder(cast<BinaryOperator>(ExtRe in expandRemainderUpTo32Bits()
[all...]
/llvm-project/llvm/lib/Analysis/
H A DLint.cpp108 void visitXor(BinaryOperator &I);
109 void visitSub(BinaryOperator &I);
110 void visitLShr(BinaryOperator &I);
111 void visitAShr(BinaryOperator &I);
112 void visitShl(BinaryOperator &I);
113 void visitSDiv(BinaryOperator &I);
114 void visitUDiv(BinaryOperator &I);
115 void visitSRem(BinaryOperator &I);
116 void visitURem(BinaryOperator &I);
526 void Lint::visitXor(BinaryOperator in visitShl()
[all...]

12345678910>>...17