Home
last modified time | relevance | path

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

12345678910>>...12

/openbsd-src/gnu/llvm/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 …]
/openbsd-src/gnu/llvm/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);
96 Instruction *visitFMul(BinaryOperator &I);
97 Instruction *visitURem(BinaryOperator &I);
98 Instruction *visitSRem(BinaryOperator &I);
99 Instruction *visitFRem(BinaryOperator &I);
100 bool simplifyDivRemOfSelectWithZeroOp(BinaryOperator &I);
[all …]
H A DInstCombineMulDivRem.cpp66 BinaryOperator *I = dyn_cast<BinaryOperator>(V); in simplifyValueKnownNonZero()
99 static Value *foldMulSelectToNegate(BinaryOperator &I, in foldMulSelectToNegate()
145 static Value *foldMulShl1(BinaryOperator &Mul, bool CommuteOperands, in foldMulShl1()
165 BinaryOperator *Shift; in foldMulShl1()
188 Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) { in visitMul()
214 return HasNSW ? BinaryOperator::CreateNSWNeg(Op0) in visitMul()
215 : BinaryOperator::CreateNeg(Op0); in visitMul()
228 BinaryOperator *Mul = cast<BinaryOperator>(I.getOperand(0)); in visitMul()
229 BinaryOperator *BO = BinaryOperator::CreateMul(NewOp, Shl); in visitMul()
240 BinaryOperator *Shl = BinaryOperator::CreateShl(NewOp, NewCst); in visitMul()
[all …]
H A DInstCombineShifts.cpp59 BinaryOperator *Sh0, const SimplifyQuery &SQ, in reassociateShiftAmtsOfTwoSameDirectionShifts()
142 BinaryOperator *NewShift = BinaryOperator::Create(ShiftOpcode, X, NewShAmt); in reassociateShiftAmtsOfTwoSameDirectionShifts()
184 dropRedundantMaskingOfLeftShiftInput(BinaryOperator *OuterShift, in dropRedundantMaskingOfLeftShiftInput()
316 auto *NewShift = BinaryOperator::Create(OuterShift->getOpcode(), X, in dropRedundantMaskingOfLeftShiftInput()
322 return BinaryOperator::Create(Instruction::And, NewShift, NewMask); in dropRedundantMaskingOfLeftShiftInput()
329 static Instruction *foldShiftOfShiftedLogic(BinaryOperator &I, in foldShiftOfShiftedLogic()
332 auto *LogicInst = dyn_cast<BinaryOperator>(I.getOperand(0)); in foldShiftOfShiftedLogic()
367 return BinaryOperator::Create(LogicInst->getOpcode(), NewShift1, NewShift2); in foldShiftOfShiftedLogic()
370 Instruction *InstCombinerImpl::commonShiftTransforms(BinaryOperator &I) { in commonShiftTransforms()
382 return BinaryOperator::Create(I.getOpcode(), Op0, NewExt); in commonShiftTransforms()
[all …]
H A DInstCombineAddSub.cpp752 static Value *checkForNegativeOperand(BinaryOperator &I, in checkForNegativeOperand()
809 static Instruction *foldNoWrapAdd(BinaryOperator &Add, in foldNoWrapAdd()
836 return BinaryOperator::CreateAdd(WideX, NewC); in foldNoWrapAdd()
843 return BinaryOperator::CreateAdd(WideX, NewC); in foldNoWrapAdd()
849 Instruction *InstCombinerImpl::foldAddWithConstant(BinaryOperator &Add) { in foldAddWithConstant()
864 return BinaryOperator::CreateSub(ConstantExpr::getAdd(Op00C, Op1C), X); in foldAddWithConstant()
871 return BinaryOperator::CreateAdd(Builder.CreateNot(Y), X); in foldAddWithConstant()
884 return BinaryOperator::CreateSub(InstCombiner::SubOne(Op1C), X); in foldAddWithConstant()
901 return BinaryOperator::CreateAdd(X, ConstantExpr::getAdd(Op01C, Op1C)); in foldAddWithConstant()
906 return BinaryOperator::CreateXor(Op0, ConstantInt::get(Add.getType(), *C2)); in foldAddWithConstant()
[all …]
H A DInstCombineAndOrXor.cpp54 static Value *SimplifyBSwap(BinaryOperator &I, in SimplifyBSwap()
1325 Instruction *InstCombinerImpl::foldLogicOfIsFPClass(BinaryOperator &BO, in foldLogicOfIsFPClass()
1367 BinaryOperator &I) { in canonicalizeConditionalNegationViaMathToSelect()
1368 assert(I.getOpcode() == BinaryOperator::Xor && "Only for xor!"); in canonicalizeConditionalNegationViaMathToSelect()
1384 static Instruction *reassociateFCmps(BinaryOperator &BO, in reassociateFCmps()
1423 return BinaryOperator::Create(Opcode, NewFCmp, BO11); in reassociateFCmps()
1429 static Instruction *matchDeMorgansLaws(BinaryOperator &I, in matchDeMorgansLaws()
1447 return BinaryOperator::CreateNot(AndOr); in matchDeMorgansLaws()
1459 return BinaryOperator::Create(Opcode, A, Builder.CreateNot(FlippedBO)); in matchDeMorgansLaws()
1482 static Instruction *foldLogicCastConstant(BinaryOperator &Logic, CastInst *Cast, in foldLogicCastConstant()
[all …]
/openbsd-src/gnu/llvm/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);
/openbsd-src/gnu/llvm/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.h187 class BinaryOperator : public Instruction {
191 BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
193 BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
199 BinaryOperator *cloneImpl() const;
214 static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
222 static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
229 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
235 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
241 static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
247 static BinaryOperator *
[all …]
/openbsd-src/gnu/llvm/clang/lib/StaticAnalyzer/Checkers/
H A DIdenticalExprChecker.cpp48 bool VisitBinaryOperator(const BinaryOperator *B);
53 void reportIdenticalExpr(const BinaryOperator *B, bool CheckBitwise,
55 void checkBitwiseOrLogicalOp(const BinaryOperator *B, bool CheckBitwise);
56 void checkComparisonOp(const BinaryOperator *B);
60 void FindIdenticalExprVisitor::reportIdenticalExpr(const BinaryOperator *B, in reportIdenticalExpr()
77 void FindIdenticalExprVisitor::checkBitwiseOrLogicalOp(const BinaryOperator *B, in checkBitwiseOrLogicalOp()
88 while (const BinaryOperator *B2 = dyn_cast<BinaryOperator>(LHS)) { in checkBitwiseOrLogicalOp()
181 bool FindIdenticalExprVisitor::VisitBinaryOperator(const BinaryOperator *B) { in VisitBinaryOperator()
182 BinaryOperator::Opcode Op = B->getOpcode(); in VisitBinaryOperator()
184 if (BinaryOperator::isBitwiseOp(Op)) in VisitBinaryOperator()
[all …]
H A DDivZeroChecker.cpp27 class DivZeroChecker : public Checker< check::PreStmt<BinaryOperator> > {
33 void checkPreStmt(const BinaryOperator *B, CheckerContext &C) const;
39 if (const auto *BE = dyn_cast<BinaryOperator>(S)) in getDenomExpr()
58 void DivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
60 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.cpp37 const BinaryOperator *mulop;
41 MallocOverflowCheck(const CallExpr *call, const BinaryOperator *m, in MallocOverflowCheck()
77 const BinaryOperator * mulop = nullptr; in CheckMallocArgument()
83 if (const BinaryOperator *binop = dyn_cast<BinaryOperator>(e)) { in CheckMallocArgument()
177 void CheckAssignmentExpr(BinaryOperator *AssignEx) { in CheckAssignmentExpr()
192 if (const BinaryOperator *BOp = dyn_cast<BinaryOperator>(rhse)) { in CheckAssignmentExpr()
229 void VisitBinaryOperator(BinaryOperator *E) { in VisitBinaryOperator()
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()
201 void TestAfterDivZeroChecker::checkPreStmt(const BinaryOperator *B, in checkPreStmt()
203 BinaryOperator::Opcode Op = B->getOpcode(); in checkPreStmt()
215 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(Condition)) { in checkBranchCondition()
/openbsd-src/gnu/llvm/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()
154 BinaryOperator::Opcode Op, in assumeSymRel()
156 assert(BinaryOperator::isComparisonOp(Op) && in assumeSymRel()
[all …]
H A DSimpleSValBuilder.cpp67 SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op,
69 SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op,
71 SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op,
81 SVal MakeSymIntVal(const SymExpr *LHS, BinaryOperator::Opcode op,
114 BinaryOperator::Opcode op, in MakeSymIntVal()
183 if (BinaryOperator::isComparisonOp(op)) { in MakeSymIntVal()
202 } else if (BinaryOperator::isAdditiveOp(op) && RHS.isNegative()) { in MakeSymIntVal()
220 static bool isInRelation(BinaryOperator::Opcode Rel, SymbolRef Sym, in isInRelation()
265 if (BinaryOperator::isAdditiveOp(SymInt->getOpcode())) in decomposeSymbol()
279 BinaryOperator::Opcode Op, in doRearrangeUnchecked()
[all …]
/openbsd-src/gnu/llvm/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,
/openbsd-src/gnu/llvm/llvm/lib/Transforms/Scalar/
H A DReassociate.cpp156 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) { in isReassociableOp()
157 auto *BO = dyn_cast<BinaryOperator>(V); in isReassociableOp()
164 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode1, in isReassociableOp()
166 auto *BO = dyn_cast<BinaryOperator>(V); in isReassociableOp()
230 assert(isa<BinaryOperator>(I) && "Expected binary operator."); in canonicalizeOperands()
238 cast<BinaryOperator>(I)->swapOperands(); in canonicalizeOperands()
241 static BinaryOperator *CreateAdd(Value *S1, Value *S2, const Twine &Name, in CreateAdd()
244 return BinaryOperator::CreateAdd(S1, S2, Name, InsertBefore); in CreateAdd()
246 BinaryOperator *Res = in CreateAdd()
247 BinaryOperator::CreateFAdd(S1, S2, Name, InsertBefore); in CreateAdd()
[all …]
H A DCorrelatedValuePropagation.cpp496 static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI);
551 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()
708 static bool narrowSDivOrSRem(BinaryOperator *Instr, const ConstantRange &LCR, in narrowSDivOrSRem()
747 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in narrowSDivOrSRem()
756 static bool expandUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in expandUDivOrURem()
829 static bool narrowUDivOrURem(BinaryOperator *Instr, const ConstantRange &XCR, in narrowUDivOrURem()
858 if (auto *BinOp = dyn_cast<BinaryOperator>(BO)) in narrowUDivOrURem()
[all …]
/openbsd-src/gnu/llvm/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()
393 if (BinaryOperator *UDiv = dyn_cast<BinaryOperator>(Builder.GetInsertPoint())) { in expandRemainder()
407 bool llvm::expandDivision(BinaryOperator *Div) { in expandDivision()
434 BinaryOperator *BO = dyn_cast<BinaryOperator>(Builder.GetInsertPoint()); in expandDivision()
456 bool llvm::expandRemainderUpTo32Bits(BinaryOperator *Rem) { in expandRemainderUpTo32Bits()
497 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo32Bits()
505 bool llvm::expandRemainderUpTo64Bits(BinaryOperator *Rem) { in expandRemainderUpTo64Bits()
543 return expandRemainder(cast<BinaryOperator>(ExtRem)); in expandRemainderUpTo64Bits()
552 bool llvm::expandDivisionUpTo32Bits(BinaryOperator *Div) { in expandDivisionUpTo32Bits()
[all …]
/openbsd-src/gnu/llvm/llvm/lib/Target/AMDGPU/
H A DAMDGPUCodeGenPrepare.cpp95 bool isSigned(const BinaryOperator &I) const;
116 bool promoteUniformOpToI32(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,
176 Value* expandDivRem24(IRBuilder<> &Builder, BinaryOperator &I,
180 Value *expandDivRem24Impl(IRBuilder<> &Builder, BinaryOperator &I,
185 Value* expandDivRem32(IRBuilder<> &Builder, BinaryOperator &I,
188 Value *shrinkDivRem64(IRBuilder<> &Builder, BinaryOperator &I,
[all …]
/openbsd-src/gnu/llvm/llvm/lib/Analysis/
H A DPHITransAddr.cpp259 bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap(); in PHITranslateSubExpr()
260 bool isNUW = cast<BinaryOperator>(Inst)->hasNoUnsignedWrap(); in PHITranslateSubExpr()
266 if (BinaryOperator *BOp = dyn_cast<BinaryOperator>(LHS)) in PHITranslateSubExpr()
294 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) in PHITranslateSubExpr()
430 BinaryOperator *Res = BinaryOperator::CreateAdd(OpVal, Inst->getOperand(1), in InsertPHITranslatedSubExpr()
433 Res->setHasNoSignedWrap(cast<BinaryOperator>(Inst)->hasNoSignedWrap()); in InsertPHITranslatedSubExpr()
434 Res->setHasNoUnsignedWrap(cast<BinaryOperator>(Inst)->hasNoUnsignedWrap()); in InsertPHITranslatedSubExpr()
H A DLint.cpp102 void visitXor(BinaryOperator &I);
103 void visitSub(BinaryOperator &I);
104 void visitLShr(BinaryOperator &I);
105 void visitAShr(BinaryOperator &I);
106 void visitShl(BinaryOperator &I);
107 void visitSDiv(BinaryOperator &I);
108 void visitUDiv(BinaryOperator &I);
109 void visitSRem(BinaryOperator &I);
110 void visitURem(BinaryOperator &I);
493 void Lint::visitXor(BinaryOperator &I) { in visitXor()
[all …]
/openbsd-src/gnu/llvm/clang/lib/ARCMigrate/
H A DTransZeroOutPropsInDealloc.cpp90 bool VisitBinaryOperator(BinaryOperator *BOE) { in VisitBinaryOperator()
151 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(E)) in isZeroingPropIvar()
158 bool isZeroingPropIvar(BinaryOperator *BOE) { in isZeroingPropIvar()
191 BinaryOperator *BO = dyn_cast<BinaryOperator>(PO->getSyntacticForm()); in isZeroingPropIvar()

12345678910>>...12