Home
last modified time | relevance | path

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

12345678910>>...15

/llvm-project-15.0.7/clang/include/clang/AST/
H A DStmtVisitor.h47 if (PTR(BinaryOperator) BinOp = dyn_cast<BinaryOperator>(S)) { in Visit()
49 case BO_PtrMemD: DISPATCH(BinPtrMemD, BinaryOperator); in Visit()
50 case BO_PtrMemI: DISPATCH(BinPtrMemI, BinaryOperator); in Visit()
51 case BO_Mul: DISPATCH(BinMul, BinaryOperator); in Visit()
52 case BO_Div: DISPATCH(BinDiv, BinaryOperator); in Visit()
53 case BO_Rem: DISPATCH(BinRem, BinaryOperator); in Visit()
54 case BO_Add: DISPATCH(BinAdd, BinaryOperator); in Visit()
55 case BO_Sub: DISPATCH(BinSub, BinaryOperator); in Visit()
56 case BO_Shl: DISPATCH(BinShl, BinaryOperator); in Visit()
57 case BO_Shr: DISPATCH(BinShr, BinaryOperator); in Visit()
[all …]
/llvm-project-15.0.7/llvm/lib/Transforms/InstCombine/
H A DInstCombineInternal.h89 Instruction *visitAdd(BinaryOperator &I);
90 Instruction *visitFAdd(BinaryOperator &I);
93 Instruction *visitSub(BinaryOperator &I);
94 Instruction *visitFSub(BinaryOperator &I);
95 Instruction *visitMul(BinaryOperator &I);
107 Instruction *visitAnd(BinaryOperator &I);
108 Instruction *visitOr(BinaryOperator &I);
110 Instruction *visitXor(BinaryOperator &I);
111 Instruction *visitShl(BinaryOperator &I);
116 BinaryOperator &I);
[all …]
H A DInstCombineMulDivRem.cpp65 BinaryOperator *I = dyn_cast<BinaryOperator>(V); in simplifyValueKnownNonZero()
164 BinaryOperator *BO = BinaryOperator::CreateNeg(Op0, I.getName()); in visitMul()
180 BinaryOperator *Mul = cast<BinaryOperator>(I.getOperand(0)); in visitMul()
181 BinaryOperator *BO = BinaryOperator::CreateMul(NewOp, Shl); in visitMul()
193 BinaryOperator *Shl = BinaryOperator::CreateShl(NewOp, NewCst); in visitMul()
212 return BinaryOperator::CreateMul( in visitMul()
273 BinaryOperator *Div = dyn_cast<BinaryOperator>(Op0); in visitMul()
277 Div = dyn_cast<BinaryOperator>(Op1); in visitMul()
319 BinaryOperator *BO = nullptr; in visitMul()
1050 BinaryOperator *BO = BinaryOperator::CreateUDiv( in visitUDiv()
[all …]
H A DInstCombineShifts.cpp142 BinaryOperator *NewShift = BinaryOperator::Create(ShiftOpcode, X, NewShAmt); in reassociateShiftAmtsOfTwoSameDirectionShifts()
443 BinaryOperator *NewShiftOp = in commonShiftTransforms()
730 return BinaryOperator::Create( in FoldShiftByConstant()
792 BinaryOperator *TBO; in FoldShiftByConstant()
809 BinaryOperator *FBO; in FoldShiftByConstant()
918 BinaryOperator *Shr; in visitShl()
961 BinaryOperator *Op0BO; in visitShl()
1052 return BinaryOperator::CreateLShr( in visitShl()
1250 BinaryOperator *OrigMul = cast<BinaryOperator>(Op0); in visitLShr()
1300 BinaryOperator &OldAShr) { in foldVariableSignZeroExtensionOfVariableHighBitExtract()
[all …]
H A DInstCombineAddSub.cpp1137 BinaryOperator &I) { in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract()
1337 return BinaryOperator::CreateSub(A, B); in visitAdd()
1415 return BinaryOperator::CreateOr(A, B); in visitAdd()
1817 BinaryOperator *Res = BinaryOperator::CreateAdd(Op0, V); in visitSub()
1890 return BinaryOperator::CreateNot(Op1); in visitSub()
1982 return BinaryOperator::CreateNeg(Y); in visitSub()
1986 return BinaryOperator::CreateNeg(Y); in visitSub()
2043 return BinaryOperator::CreateAnd( in visitSub()
2061 return BinaryOperator::CreateNeg( in visitSub()
2121 return BinaryOperator::CreateAnd( in visitSub()
[all …]
H A DInstCombineAndOrXor.cpp1709 return BinaryOperator::Create( in foldComplexAndOrPatterns()
1717 return BinaryOperator::Create( in foldComplexAndOrPatterns()
1862 BinaryOperator *BO; in visitAnd()
1913 BinaryOperator::BinaryOps BinOp = cast<BinaryOperator>(Op0)->getOpcode(); in visitAnd()
2211 BinaryOperator *Or0, *Or1; in matchFunnelShift()
2919 if (BinaryOperator *B = dyn_cast<BinaryOperator>(A)) in visitOr()
3108 return BinaryOperator::CreateOr( in visitOr()
3120 return BinaryOperator::CreateOr( in visitOr()
3473 BinaryOperator *NotVal; in foldNot()
3671 return BinaryOperator::CreateXor( in visitXor()
[all …]
/llvm-project-15.0.7/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-15.0.7/llvm/include/llvm/IR/
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 …]
H A DInstrTypes.h188 class BinaryOperator : public Instruction {
200 BinaryOperator *cloneImpl() const;
248 static BinaryOperator *
285 BinaryOperator *BO = Create(Opc, V1, V2, Name);
297 BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
304 BinaryOperator *BO = Create(Opc, V1, V2, Name);
316 BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
323 BinaryOperator *BO = Create(Opc, V1, V2, Name);
335 BinaryOperator *BO = Create(Opc, V1, V2, Name, I);
413 struct OperandTraits<BinaryOperator> :
[all …]
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Checkers/
H A DIdenticalExprChecker.cpp48 bool VisitBinaryOperator(const BinaryOperator *B);
53 void reportIdenticalExpr(const BinaryOperator *B, bool CheckBitwise,
56 void checkComparisonOp(const BinaryOperator *B);
88 while (const BinaryOperator *B2 = dyn_cast<BinaryOperator>(LHS)) { in checkBitwiseOrLogicalOp()
182 BinaryOperator::Opcode Op = B->getOpcode(); in VisitBinaryOperator()
184 if (BinaryOperator::isBitwiseOp(Op)) in VisitBinaryOperator()
187 if (BinaryOperator::isLogicalOp(Op)) in VisitBinaryOperator()
190 if (BinaryOperator::isComparisonOp(Op)) in VisitBinaryOperator()
200 BinaryOperator::Opcode Op = B->getOpcode(); in checkComparisonOp()
452 const BinaryOperator *BinOp1 = cast<BinaryOperator>(Stmt1); in isIdenticalStmt()
[all …]
H A DDivZeroChecker.cpp26 class DivZeroChecker : public Checker< check::PreStmt<BinaryOperator> > {
32 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
38 if (const auto *BE = dyn_cast<BinaryOperator>(S)) in getDenomExpr()
57 void DivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
59 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
H A DUndefResultChecker.cpp29 : public Checker< check::PostStmt<BinaryOperator> > {
34 void checkPostStmt(const BinaryOperator *B, CheckerContext &C) const;
61 static bool isShiftOverflow(const BinaryOperator *B, CheckerContext &C) { in isShiftOverflow()
66 static bool isLeftShiftResultUnrepresentable(const BinaryOperator *B, in isLeftShiftResultUnrepresentable()
76 void UndefResultChecker::checkPostStmt(const BinaryOperator *B, in checkPostStmt()
113 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt()
169 << BinaryOperator::getOpcodeStr(B->getOpcode()) in checkPostStmt()
H A DMallocOverflowSecurityChecker.cpp36 const BinaryOperator *mulop;
40 MallocOverflowCheck(const CallExpr *call, const BinaryOperator *m, in MallocOverflowCheck()
76 const BinaryOperator * mulop = nullptr; in CheckMallocArgument()
82 if (const BinaryOperator *binop = dyn_cast<BinaryOperator>(e)) { in CheckMallocArgument()
176 void CheckAssignmentExpr(BinaryOperator *AssignEx) { in CheckAssignmentExpr()
191 if (const BinaryOperator *BOp = dyn_cast<BinaryOperator>(rhse)) { in CheckAssignmentExpr()
228 void VisitBinaryOperator(BinaryOperator *E) { in VisitBinaryOperator()
H A DTestAfterDivZeroChecker.cpp78 : public Checker<check::PreStmt<BinaryOperator>, check::BranchCondition,
84 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
104 if (const BinaryOperator *BO = P->getStmtAs<BinaryOperator>()) { in REGISTER_SET_WITH_PROGRAMSTATE()
105 BinaryOperator::Opcode Op = BO->getOpcode(); in REGISTER_SET_WITH_PROGRAMSTATE()
200 void TestAfterDivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
202 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
214 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(Condition)) { in checkBranchCondition()
/llvm-project-15.0.7/clang/lib/StaticAnalyzer/Core/
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()
156 assert(BinaryOperator::isComparisonOp(Op) && in assumeSymRel()
166 if (BinaryOperator::isComparisonOp(SE->getOpcode())) in assumeSymRel()
[all …]
H A DSimpleSValBuilder.cpp182 if (BinaryOperator::isComparisonOp(op)) { in MakeSymIntVal()
294 if (BinaryOperator::isComparisonOp(Op)) in doRearrangeUnchecked()
296 else if (BinaryOperator::isAdditiveOp(Op)) in doRearrangeUnchecked()
307 BinaryOperator::Opcode ResultOp; in doRearrangeUnchecked()
309 if (BinaryOperator::isComparisonOp(Op)) { in doRearrangeUnchecked()
346 (!BinaryOperator::isComparisonOp(Op) || in shouldRearrange()
370 if (BinaryOperator::isComparisonOp(Op)) { in tryRearrange()
375 } else if (BinaryOperator::isAdditiveOp(Op)) { in tryRearrange()
699 if (!BinaryOperator::isComparisonOp(op)) in evalBinOpFieldRegionFieldRegion()
884 if (BinaryOperator::isComparisonOp(op)) in evalBinOpLL()
[all …]
/llvm-project-15.0.7/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,
H A DReassociate.h36 class BinaryOperator; variable
103 void ReassociateExpression(BinaryOperator *I);
104 void RewriteExprTree(BinaryOperator *I,
106 Value *OptimizeExpression(BinaryOperator *I,
119 Value *OptimizeMul(BinaryOperator *I,
/llvm-project-15.0.7/llvm/lib/Transforms/Scalar/
H A DReassociate.cpp246 BinaryOperator *Res = in CreateAdd()
258 BinaryOperator *Res = in CreateMul()
604 if (BinaryOperator *UserBO = dyn_cast<BinaryOperator>(U)) in LinearizeExprTree()
670 BinaryOperator *Op = I; in RewriteExprTree()
849 if (BinaryOperator *I = in NegateValue()
1021 BinaryOperator *New = in convertOrWithNoCommonBitsToAdd()
1094 BinaryOperator *Mul = in ConvertShiftToMul()
1647 BinaryOperator *BOp = in OptimizeAdd()
2273 if (BinaryOperator *Tmp = dyn_cast<BinaryOperator>(U)) in OptimizeInst()
2300 if (BinaryOperator *Tmp = dyn_cast<BinaryOperator>(U)) in OptimizeInst()
[all …]
H A DCorrelatedValuePropagation.cpp551 if (auto *BO = dyn_cast<BinaryOperator>(NegX)) in processAbsIntrinsic()
592 if (auto *BO = dyn_cast<BinaryOperator>(NewOp)) in processOverflowIntrinsic()
602 BinaryOperator *BinOp = BinaryOperator::Create( in processSaturatingInst()
612 if (auto *BO = dyn_cast<BinaryOperator>(BinOp)) in processSaturatingInst()
764 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in narrowSDivOrSRem()
808 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in processUDivOrURem()
817 static bool processSRem(BinaryOperator *SDI, LazyValueInfo *LVI) { in processSRem()
873 static bool processSDiv(BinaryOperator *SDI, LazyValueInfo *LVI) { in processSDiv()
942 static bool processAShr(BinaryOperator *SDI, LazyValueInfo *LVI) { in processAShr()
1117 BBChanged |= processAShr(cast<BinaryOperator>(&II), LVI); in runImpl()
[all …]
/llvm-project-15.0.7/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-15.0.7/llvm/lib/Transforms/Utils/
H A DIntegerDivision.cpp374 bool llvm::expandRemainder(BinaryOperator *Rem) { in expandRemainder()
403 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandRemainder()
416 if (BinaryOperator *UDiv = dyn_cast<BinaryOperator>(Builder.GetInsertPoint())) { in expandRemainder()
432 bool llvm::expandDivision(BinaryOperator *Div) { in expandDivision()
462 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandDivision()
525 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo32Bits()
573 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo64Bits()
582 bool llvm::expandDivisionUpTo32Bits(BinaryOperator *Div) { in expandDivisionUpTo32Bits()
622 return expandDivision(cast<BinaryOperator>(ExtDiv)); in expandDivisionUpTo32Bits()
630 bool llvm::expandDivisionUpTo64Bits(BinaryOperator *Div) { in expandDivisionUpTo64Bits()
[all …]
/llvm-project-15.0.7/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()
325 getOperands(const BinaryOperator *Op) { in getOperands()
443 AST_MATCHER(BinaryOperator, operandsAreEquivalent) { in AST_MATCHER() argument
464 AST_MATCHER(BinaryOperator, binaryOperatorIsInMacro) { in AST_MATCHER() argument
705 if (!BinaryOperator::isComparisonOp(Opcode)) in retrieveRelationalIntegerConstantExpr()
722 Opcode = BinaryOperator::reverseComparisonOp(Opcode); in retrieveRelationalIntegerConstantExpr()
724 Opcode = BinaryOperator::negateComparisonOp(Opcode); in retrieveRelationalIntegerConstantExpr()
1038 Result.Nodes.getNodeAs<BinaryOperator>( in checkArithmeticExpr()
[all …]
/llvm-project-15.0.7/llvm/lib/Target/AMDGPU/
H A DAMDGPUCodeGenPrepare.cpp95 bool isSigned(const BinaryOperator &I) const;
163 bool replaceMulWithMul24(BinaryOperator &I) const;
167 bool foldBinOpIntoSelect(BinaryOperator &I) const;
169 bool divHasSpecialOptimization(BinaryOperator &I,
171 int getDivNumBits(BinaryOperator &I,
190 void expandDivRem64(BinaryOperator &I) const;
207 bool visitFDiv(BinaryOperator &I);
208 bool visitXor(BinaryOperator &I);
211 bool visitBinaryOperator(BinaryOperator &I);
1037 if (BinaryOperator *BinOpDen = dyn_cast<BinaryOperator>(Den)) { in divHasSpecialOptimization()
[all …]
/llvm-project-15.0.7/clang-tools-extra/clang-tidy/bugprone/
H A DPosixReturnCheck.cpp24 (Result.Nodes.getNodeAs<BinaryOperator>(BindingStr))->getLHS()); in getFunctionSpelling()
64 Result.Nodes.getNodeAs<BinaryOperator>("ltzop")) { in check()
73 Result.Nodes.getNodeAs<BinaryOperator>("atop")) { in check()
80 const auto *BinOp = Result.Nodes.getNodeAs<BinaryOperator>("binop"); in check()

12345678910>>...15