Home
last modified time | relevance | path

Searched refs:ConstantExpr (Results 1 – 25 of 107) sorted by relevance

12345

/external/llvm/include/llvm/Support/
DConstantFolder.h36 return ConstantExpr::getAdd(LHS, RHS, HasNUW, HasNSW);
39 return ConstantExpr::getFAdd(LHS, RHS); in CreateFAdd()
43 return ConstantExpr::getSub(LHS, RHS, HasNUW, HasNSW);
46 return ConstantExpr::getFSub(LHS, RHS); in CreateFSub()
50 return ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW);
53 return ConstantExpr::getFMul(LHS, RHS); in CreateFMul()
57 return ConstantExpr::getUDiv(LHS, RHS, isExact);
61 return ConstantExpr::getSDiv(LHS, RHS, isExact);
64 return ConstantExpr::getFDiv(LHS, RHS); in CreateFDiv()
67 return ConstantExpr::getURem(LHS, RHS); in CreateURem()
[all …]
DTargetFolder.h37 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) in Fold()
52 return Fold(ConstantExpr::getAdd(LHS, RHS, HasNUW, HasNSW));
55 return Fold(ConstantExpr::getFAdd(LHS, RHS)); in CreateFAdd()
59 return Fold(ConstantExpr::getSub(LHS, RHS, HasNUW, HasNSW));
62 return Fold(ConstantExpr::getFSub(LHS, RHS)); in CreateFSub()
66 return Fold(ConstantExpr::getMul(LHS, RHS, HasNUW, HasNSW));
69 return Fold(ConstantExpr::getFMul(LHS, RHS)); in CreateFMul()
72 return Fold(ConstantExpr::getUDiv(LHS, RHS, isExact));
75 return Fold(ConstantExpr::getSDiv(LHS, RHS, isExact));
78 return Fold(ConstantExpr::getFDiv(LHS, RHS)); in CreateFDiv()
[all …]
DPatternMatch.h283 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
415 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
534 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
591 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
621 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
650 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in match()
/external/llvm/unittests/VMCore/
DConstantsTest.cpp28 EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); in TEST()
32 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, One)); in TEST()
36 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, NegOne)); in TEST()
40 EXPECT_EQ(Zero, ConstantExpr::getSub(NegOne, One)); in TEST()
44 EXPECT_EQ(Zero, ConstantExpr::getSub(One, NegOne)); in TEST()
48 EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); in TEST()
52 EXPECT_EQ(Undef, ConstantExpr::getShl(One, One)); in TEST()
56 EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); in TEST()
60 EXPECT_EQ(Undef, ConstantExpr::getLShr(One, One)); in TEST()
64 EXPECT_EQ(Undef, ConstantExpr::getAShr(One, One)); in TEST()
[all …]
/external/llvm/include/llvm/
DOperator.h25 class ConstantExpr; variable
45 return cast<ConstantExpr>(this)->getOpcode(); in getOpcode()
54 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in getOpcode()
61 static inline bool classof(const ConstantExpr *) { return true; } in classof() argument
63 return isa<Instruction>(V) || isa<ConstantExpr>(V); in classof()
82 friend class ConstantExpr; variable
112 static inline bool classof(const ConstantExpr *CE) { in classof()
120 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
133 friend class ConstantExpr; variable
153 static inline bool classof(const ConstantExpr *CE) { in classof()
[all …]
DConstants.h588 class ConstantExpr : public Constant {
589 friend struct ConstantCreator<ConstantExpr,Type,
591 friend struct ConvertConstantType<ConstantExpr, Type>;
594 ConstantExpr(Type *ty, unsigned Opcode, Use *Ops, unsigned NumOps)
854 static inline bool classof(const ConstantExpr *) { return true; }
868 struct OperandTraits<ConstantExpr> :
869 public VariadicOperandTraits<ConstantExpr, 1> {
872 DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantExpr, Constant)
/external/llvm/lib/VMCore/
DConstantFold.cpp68 Result.push_back(ConstantExpr::getBitCast(CV->getOperand(i), in BitCastConstantVector()
80 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
130 return ConstantExpr::getInBoundsGetElementPtr(V, &IdxList[0], in FoldBitCast()
153 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
216 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
234 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
248 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
318 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
320 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
340 return ConstantExpr::getNUWMul(E, N); in getFoldedSizeOf()
[all …]
DConstants.cpp106 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue()
167 const ConstantExpr *CE = dyn_cast<ConstantExpr>(this); in canTrap()
236 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) in getRelocationInfo()
238 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in getRelocationInfo()
239 ConstantExpr *RHS = dyn_cast<ConstantExpr>(CE->getOperand(1)); in getRelocationInfo()
741 bool ConstantExpr::isCast() const { in isCast()
745 bool ConstantExpr::isCompare() const { in isCompare()
749 bool ConstantExpr::isGEPWithNoNotionalOverIndexing() const { in isGEPWithNoNotionalOverIndexing()
774 bool ConstantExpr::hasIndices() const { in hasIndices()
779 ArrayRef<unsigned> ConstantExpr::getIndices() const { in getIndices()
[all …]
DConstantsContext.h32 class UnaryConstantExpr : public ConstantExpr {
40 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) { in UnaryConstantExpr()
48 class BinaryConstantExpr : public ConstantExpr {
57 : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) { in BinaryConstantExpr()
68 class SelectConstantExpr : public ConstantExpr {
76 : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) { in SelectConstantExpr()
88 class ExtractElementConstantExpr : public ConstantExpr {
96 : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(), in ExtractElementConstantExpr()
108 class InsertElementConstantExpr : public ConstantExpr {
116 : ConstantExpr(C1->getType(), Instruction::InsertElement, in InsertElementConstantExpr()
[all …]
DCore.cpp615 return (LLVMOpcode)unwrap<ConstantExpr>(ConstantVal)->getOpcode(); in LLVMGetConstOpcode()
619 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
623 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
627 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
631 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
635 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
640 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg()
644 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
648 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
654 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd()
[all …]
DIntrinsicInst.cpp35 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) in CastOperand()
/external/llvm/lib/Analysis/
DConstantFolding.cpp52 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
64 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
70 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
92 if (!C) return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
95 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
105 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
131 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
134 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
137 Src = ConstantExpr::getShl(Src, in FoldBitCast()
142 Elt = ConstantExpr::getOr(Elt, Src); in FoldBitCast()
[all …]
/external/llvm/lib/Transforms/InstCombine/
DInstCombineAddSub.cpp24 return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1)); in AddOne()
183 return BinaryOperator::CreateMul(X, ConstantExpr::getAdd(C1, C2)); in visitAdd()
293 ConstantExpr::getTrunc(RHSC, LHSConv->getOperand(0)->getType()); in visitAdd()
295 ConstantExpr::getSExt(CI, I.getType()) == RHSC && in visitAdd()
366 ConstantExpr::getFPToSI(CFP, LHSConv->getOperand(0)->getType()); in visitFAdd()
368 ConstantExpr::getSIToFP(CI, I.getType()) == CFP && in visitFAdd()
434 ConstantExpr::getIntegerCast(OpC, IntPtrTy, true /*SExt*/); in EmitGEPOffset()
435 Scale = ConstantExpr::getMul(OC, Scale, isInBounds/*NUW*/); in EmitGEPOffset()
470 ConstantExpr *CstGEP = 0; in OptimizePointerDifference()
480 } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(RHS)) { in OptimizePointerDifference()
[all …]
DInstCombineCompares.cpp31 return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1)); in AddOne()
35 return ConstantExpr::getSub(C, ConstantInt::get(C->getType(), 1)); in SubOne()
39 return cast<ConstantInt>(ConstantExpr::getExtractElement(V, Idx)); in ExtractElement()
57 Result = ConstantExpr::getAdd(In1, In2); in AddWithOverflow()
92 Result = ConstantExpr::getSub(In1, In2); in SubWithOverflow()
279 Elt = ConstantExpr::getExtractValue(Elt, LaterIndices); in FoldCmpLoadFromIndexedGlobal()
282 if (AndCst) Elt = ConstantExpr::getAnd(Elt, AndCst); in FoldCmpLoadFromIndexedGlobal()
667 (isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) && in FoldGEPICmp()
668 (isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) { in FoldGEPICmp()
707 ConstantExpr::getSub(ConstantInt::getAllOnesValue(CI->getType()), CI); in FoldICmpAddOpCst()
[all …]
DInstCombineAndOrXor.cpp25 return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1)); in AddOne()
201 Together = ConstantExpr::getAnd(AndRHS, OpRHS); in OptAndOp()
226 Together = ConstantExpr::getXor(AndRHS, Together); in OptAndOp()
340 assert(cast<ConstantInt>(ConstantExpr::getICmp((isSigned ? in InsertRangeTest()
356 Constant *NegLo = ConstantExpr::getNeg(Lo); in InsertRangeTest()
358 Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi); in InsertRangeTest()
375 ConstantInt *NegLo = cast<ConstantInt>(ConstantExpr::getNeg(Lo)); in InsertRangeTest()
377 Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi); in InsertRangeTest()
419 if (ConstantExpr::getAnd(N, Mask) == Mask) { in FoldLogicalPlusAnd()
443 && ConstantExpr::getAnd(N, Mask)->isNullValue()) in FoldLogicalPlusAnd()
[all …]
DInstructionCombining.cpp242 Constant *Folded = ConstantExpr::get(Opcode, C1, C2); in SimplifyAssociativeOrCommutative()
442 return ConstantExpr::getNeg(C); in dyn_castNegVal()
446 return ConstantExpr::getNeg(C); in dyn_castNegVal()
461 return ConstantExpr::getFNeg(C); in dyn_castFNegVal()
465 return ConstantExpr::getFNeg(C); in dyn_castFNegVal()
482 return ConstantExpr::get(I.getOpcode(), SOC, ConstOperand); in FoldOperationIntoSelectOperand()
483 return ConstantExpr::get(I.getOpcode(), ConstOperand, SOC); in FoldOperationIntoSelectOperand()
571 if (isa<Constant>(InVal) && !isa<ConstantExpr>(InVal)) in FoldOpIntoPhi()
635 InV = ConstantExpr::getCompare(CI->getPredicate(), InC, C); in FoldOpIntoPhi()
649 InV = ConstantExpr::get(I.getOpcode(), InC, C); in FoldOpIntoPhi()
[all …]
/external/llvm/include/llvm/Analysis/
DConstantFolding.h25 class ConstantExpr; variable
43 Constant *ConstantFoldConstantExpression(const ConstantExpr *CE,
72 Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
/external/clang/lib/CodeGen/
DCGExprConstant.cpp517 LHS = llvm::ConstantExpr::getPtrToInt(LHS, ResultType); in VisitBinSub()
518 RHS = llvm::ConstantExpr::getPtrToInt(RHS, ResultType); in VisitBinSub()
522 return llvm::ConstantExpr::getSub(LHS, RHS); in VisitBinSub()
579 return llvm::ConstantExpr::getBitCast(C, destType); in VisitCastExpr()
620 return llvm::ConstantExpr::getPtrToInt(C, destType); in VisitCastExpr()
624 return llvm::ConstantExpr::getICmp(llvm::CmpInst::ICMP_EQ, C, in VisitCastExpr()
632 return llvm::ConstantExpr::getIntegerCast(C, destType, isSigned); in VisitCastExpr()
637 C = llvm::ConstantExpr::getIntegerCast(C, CGM.IntPtrTy, isSigned); in VisitCastExpr()
638 return llvm::ConstantExpr::getIntToPtr(C, destType); in VisitCastExpr()
642 return llvm::ConstantExpr::getICmp(llvm::CmpInst::ICMP_EQ, C, in VisitCastExpr()
[all …]
DCGObjCGNU.cpp174 return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros, 2); in MakeConstantString()
189 return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros, 2); in ExportUniqueString()
893 return llvm::ConstantExpr::getBitCast(IDEHType, PtrToInt8Ty); in GetEHType()
921 Vtable = llvm::ConstantExpr::getGetElementPtr(Vtable, &Two, 1); in GetEHType()
922 Vtable = llvm::ConstantExpr::getBitCast(Vtable, PtrToInt8Ty); in GetEHType()
934 return llvm::ConstantExpr::getBitCast(TI, PtrToInt8Ty); in GetEHType()
954 ObjCStr = llvm::ConstantExpr::getBitCast(ObjCStr, PtrToInt8Ty); in GenerateConstantString()
1229 Method = llvm::ConstantExpr::getBitCast(Method, in GenerateMethodList()
1346 Elements.push_back(llvm::ConstantExpr::getBitCast(MetaClass, PtrToInt8Ty)); in GenerateClassStructure()
1364 Elements.push_back(llvm::ConstantExpr::getBitCast(Protocols, PtrTy)); in GenerateClassStructure()
[all …]
DCodeGenModule.cpp370 S.push_back(llvm::ConstantExpr::getBitCast(I->first, CtorPFTy)); in EmitCtorList()
580 llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(&*LLVMUsed[i]), in EmitLLVMUsed()
678 llvm::ConstantExpr::getBitCast(GV, SBP), in EmitAnnotateAttr()
679 llvm::ConstantExpr::getBitCast(annoGV, SBP), in EmitAnnotateAttr()
680 llvm::ConstantExpr::getBitCast(unitGV, SBP), in EmitAnnotateAttr()
873 return llvm::ConstantExpr::getBitCast(Entry, Ty->getPointerTo()); in GetOrCreateLLVMFunction()
944 return llvm::ConstantExpr::getBitCast(F, PTy); in GetOrCreateLLVMFunction()
1016 return llvm::ConstantExpr::getBitCast(Entry, Ty); in GetOrCreateLLVMGlobal()
1093 llvm::ConstantExpr::getBitCast(GV, OldGV->getType()); in CreateOrReplaceCXXRuntimeVariable()
1273 if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(Entry)) { in EmitGlobalVarDefinition()
[all …]
/external/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp180 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in AnalyzeGlobal()
324 } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in CleanupConstantGlobalUsers()
345 if (!isa<ConstantExpr>(GEP->getOperand(0))) { in CleanupConstantGlobalUsers()
346 ConstantExpr *CE = in CleanupConstantGlobalUsers()
347 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP)); in CleanupConstantGlobalUsers()
416 (!isa<ConstantExpr>(U) || in IsUserOfGlobalSafeForSRA()
417 cast<ConstantExpr>(U)->getOpcode() != Instruction::GetElementPtr)) in IsUserOfGlobalSafeForSRA()
580 assert(((isa<ConstantExpr>(GEP) && in SRAGlobal()
581 cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)|| in SRAGlobal()
594 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) { in SRAGlobal()
[all …]
DInlineSimple.cpp107 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(Elt)) in doInitialization()
/external/llvm/bindings/ocaml/llvm/
Dllvm.mli644 more readable. See the method [llvm::ConstantExpr::getAlignOf]. *)
650 See the method [llvm::ConstantExpr::getSizeOf]. *)
654 See the method [llvm::ConstantExpr::getNeg]. *)
659 See the method [llvm::ConstantExpr::getNSWNeg]. *)
664 See the method [llvm::ConstantExpr::getNUWNeg]. *)
668 See the method [llvm::ConstantExpr::getFNeg]. *)
672 See the method [llvm::ConstantExpr::getNot]. *)
676 See the method [llvm::ConstantExpr::getAdd]. *)
681 See the method [llvm::ConstantExpr::getNSWAdd]. *)
686 See the method [llvm::ConstantExpr::getNSWAdd]. *)
[all …]
/external/llvm/lib/Transforms/Instrumentation/
DProfilingUtils.cpp54 Args[2] = ConstantExpr::getGetElementPtr(Array, &GEPIndices[0], in InsertProfilingInitCall()
123 ConstantExpr::getGetElementPtr(CounterArray, &Indices[0], Indices.size()); in IncrementCounterInBlock()
146 ConstantExpr::getBitCast(Callee, GlobalDtorElems[1]) in InsertProfilingShutdownCall()
/external/llvm/lib/Linker/
DLinkModules.cpp594 ValueMap[SrcGV] = ConstantExpr::getBitCast(NG, TypeMap.get(SrcGV->getType())); in linkAppendingVarProto()
596 DstGV->replaceAllUsesWith(ConstantExpr::getBitCast(NG, DstGV->getType())); in linkAppendingVarProto()
634 ValueMap[SGV] = ConstantExpr::getBitCast(DGV,TypeMap.get(SGV->getType())); in linkGlobalProto()
658 DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDGV, DGV->getType())); in linkGlobalProto()
683 ValueMap[SF] = ConstantExpr::getBitCast(DGV, TypeMap.get(SF->getType())); in linkFunctionProto()
699 DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDF, DGV->getType())); in linkFunctionProto()
723 ValueMap[SGA] = ConstantExpr::getBitCast(DGV,TypeMap.get(SGA->getType())); in linkAliasProto()
740 DGV->replaceAllUsesWith(ConstantExpr::getBitCast(NewDA, DGV->getType())); in linkAliasProto()

12345