Home
last modified time | relevance | path

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

123456

/external/llvm/unittests/IR/
DConstantsTest.cpp33 EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); in TEST()
37 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, One)); in TEST()
41 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, NegOne)); in TEST()
45 EXPECT_EQ(Zero, ConstantExpr::getSub(NegOne, One)); in TEST()
49 EXPECT_EQ(Zero, ConstantExpr::getSub(One, NegOne)); in TEST()
53 EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); in TEST()
57 EXPECT_EQ(Undef, ConstantExpr::getShl(One, One)); in TEST()
61 EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); in TEST()
65 EXPECT_EQ(Undef, ConstantExpr::getLShr(One, One)); in TEST()
69 EXPECT_EQ(Undef, ConstantExpr::getAShr(One, One)); in TEST()
[all …]
/external/llvm/include/llvm/IR/
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 …]
DOperator.h29 class ConstantExpr; variable
52 return cast<ConstantExpr>(this)->getOpcode(); in getOpcode()
60 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in getOpcode()
66 static inline bool classof(const ConstantExpr *) { return true; } in classof() argument
68 return isa<Instruction>(V) || isa<ConstantExpr>(V); in classof()
84 friend class ConstantExpr; variable
113 static inline bool classof(const ConstantExpr *CE) { in classof()
121 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
135 friend class ConstantExpr; variable
152 static inline bool classof(const ConstantExpr *CE) { in classof()
[all …]
/external/llvm/include/llvm/Analysis/
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 …]
DConstantFolding.h25 class ConstantExpr; variable
46 ConstantFoldConstantExpression(const ConstantExpr *CE, const DataLayout &DL,
83 Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
/external/llvm/lib/IR/
DConstantFold.cpp64 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector()
65 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector()
79 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair()
135 return ConstantExpr::getInBoundsGetElementPtr(PTy->getElementType(), in FoldBitCast()
158 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
232 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
250 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
264 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
334 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
336 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
[all …]
DConstantsContext.h35 class UnaryConstantExpr : public ConstantExpr {
44 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) { in UnaryConstantExpr()
52 class BinaryConstantExpr : public ConstantExpr {
62 : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) { in BinaryConstantExpr()
73 class SelectConstantExpr : public ConstantExpr {
82 : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) { in SelectConstantExpr()
94 class ExtractElementConstantExpr : public ConstantExpr {
103 : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(), in ExtractElementConstantExpr()
115 class InsertElementConstantExpr : public ConstantExpr {
124 : ConstantExpr(C1->getType(), Instruction::InsertElement, in InsertElementConstantExpr()
[all …]
DConstants.cpp221 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue()
309 SmallPtrSetImpl<const ConstantExpr *> &NonTrappingOps) { in canTrapImpl()
312 const ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in canTrapImpl()
318 if (ConstantExpr *Op = dyn_cast<ConstantExpr>(CE->getOperand(i))) { in canTrapImpl()
344 SmallPtrSet<const ConstantExpr *, 4> NonTrappingOps; in canTrap()
432 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) in getRelocationInfo()
434 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in getRelocationInfo()
435 ConstantExpr *RHS = dyn_cast<ConstantExpr>(CE->getOperand(1)); in getRelocationInfo()
1145 bool ConstantExpr::isCast() const { in isCast()
1149 bool ConstantExpr::isCompare() const { in isCompare()
[all …]
DCore.cpp974 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode()
978 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
982 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
986 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
990 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
994 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
999 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg()
1003 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
1007 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
1013 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.cpp65 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
77 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
82 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
102 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
113 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
119 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
143 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
153 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
180 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
183 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
[all …]
DCFLAliasAnalysis.cpp757 static void constexprToEdges(CFLAliasAnalysis &, ConstantExpr &,
863 ConstantExpr &CExprToCollapse, in constexprToEdges()
865 SmallVector<ConstantExpr *, 4> Worklist; in constexprToEdges()
881 else if (auto *Nested = dyn_cast<ConstantExpr>(Edge.From)) in constexprToEdges()
886 else if (auto *Nested = dyn_cast<ConstantExpr>(Edge.To)) in constexprToEdges()
937 SmallVector<ConstantExpr *, 4> ConstantExprs; in addInstructionToGraph()
940 if (auto *Constexpr = dyn_cast<ConstantExpr>(E.To)) in addInstructionToGraph()
942 if (auto *Constexpr = dyn_cast<ConstantExpr>(E.From)) in addInstructionToGraph()
946 for (ConstantExpr *CE : ConstantExprs) { in addInstructionToGraph()
980 isa<GlobalValue>(Val) || isa<ConstantExpr>(Val) || Container; in canSkipAddingToSets()
/external/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp230 } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in CleanupPointerRootUsers()
297 } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in CleanupConstantGlobalUsers()
319 if (!isa<ConstantExpr>(GEP->getOperand(0))) { in CleanupConstantGlobalUsers()
320 ConstantExpr *CE = dyn_cast_or_null<ConstantExpr>( in CleanupConstantGlobalUsers()
394 (!isa<ConstantExpr>(U) || in IsUserOfGlobalSafeForSRA()
395 cast<ConstantExpr>(U)->getOpcode() != Instruction::GetElementPtr)) in IsUserOfGlobalSafeForSRA()
556 assert(((isa<ConstantExpr>(GEP) && in SRAGlobal()
557 cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)|| in SRAGlobal()
571 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) { in SRAGlobal()
577 ConstantExpr::getGetElementPtr(NewTy, cast<Constant>(NewPtr), Idxs); in SRAGlobal()
[all …]
/external/llvm/lib/Target/XCore/
DXCoreLowerThreadLocal.cpp78 createReplacementInstr(ConstantExpr *CE, Instruction *Instr) { in createReplacementInstr()
129 static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) { in replaceConstantExprOp()
150 ConstantExpr *CExpr = dyn_cast<ConstantExpr>(WU); in replaceConstantExprOp()
168 ConstantExpr *CE = dyn_cast<ConstantExpr>(WU); in rewriteNonInstructionUses()
/external/llvm/lib/ExecutionEngine/Orc/
DExecutionUtils.cpp58 } else if (ConstantExpr *CE = dyn_cast_or_null<ConstantExpr>(FuncC)) { in operator *()
60 FuncC = dyn_cast_or_null<ConstantExpr>(CE->getOperand(0)); in operator *()
/external/llvm/lib/Transforms/InstCombine/
DInstCombineCompares.cpp44 return cast<ConstantInt>(ConstantExpr::getExtractElement(V, Idx)); in ExtractElement()
62 Result = ConstantExpr::getAdd(In1, In2); in AddWithOverflow()
97 Result = ConstantExpr::getSub(In1, In2); in SubWithOverflow()
310 Elt = ConstantExpr::getExtractValue(Elt, LaterIndices); in FoldCmpLoadFromIndexedGlobal()
313 if (AndCst) Elt = ConstantExpr::getAnd(Elt, AndCst); in FoldCmpLoadFromIndexedGlobal()
729 if (GEPsInBounds && (isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) && in FoldGEPICmp()
730 (isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) { in FoldGEPICmp()
753 ConstantExpr::getSub(ConstantInt::getAllOnesValue(CI->getType()), CI); in FoldICmpAddOpCst()
761 return new ICmpInst(ICmpInst::ICMP_ULT, X, ConstantExpr::getNeg(CI)); in FoldICmpAddOpCst()
774 return new ICmpInst(ICmpInst::ICMP_SGT, X, ConstantExpr::getSub(SMax, CI)); in FoldICmpAddOpCst()
[all …]
/external/lldb/source/Expression/
DIRForTarget.cpp292 return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty); in BuildFunctionPointer()
789 m_CFStringCreateWithBytes = ConstantExpr::getIntToPtr(CFSCWB_addr_int, CFSCWB_ptr_ty); in RewriteObjCConstString()
798 …Constant *bytes_arg = cstr ? ConstantExpr::getBitCast(cstr, i8_ptr_ty) : Constant::getNull… in RewriteObjCConstString()
924 ConstantExpr *nsstring_expr = dyn_cast<ConstantExpr>(nsstring_member); in RewriteObjCConstStrings()
1094 ConstantExpr *osr_initializer_expr = dyn_cast<ConstantExpr>(osr_initializer); in RewriteObjCSelector()
1156 m_sel_registerName = ConstantExpr::getIntToPtr(srN_addr_int, srN_ptr_ty); in RewriteObjCSelector()
1161 …Constant *omvn_pointer = ConstantExpr::getBitCast(_objc_meth_var_name_, Type::getInt8PtrTy(m_modul… in RewriteObjCSelector()
1478 if (ConstantExpr *constant_expr = dyn_cast<ConstantExpr>(llvm_value_ptr)) in MaybeHandleVariable()
1607 Value *symbol_addr_ptr = ConstantExpr::getIntToPtr(symbol_addr_int, symbol_type); in HandleSymbol()
1691 … Constant *class_bitcast = ConstantExpr::getIntToPtr(class_addr, load_instruction->getType()); in HandleObjCClass()
[all …]
/external/clang/lib/CodeGen/
DCGExprConstant.cpp658 return llvm::ConstantExpr::getAddrSpaceCast(C, destType); in VisitCastExpr()
932 return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType())); in EmitLValue()
949 return llvm::ConstantExpr::getBitCast(Ptr, ConvertType(E->getType())); in EmitLValue()
1042 C = llvm::ConstantExpr::getZExt(C, BoolTy); in EmitConstantInit()
1067 C = llvm::ConstantExpr::getZExt(C, BoolTy); in EmitConstantExpr()
1117 llvm::Constant *Casted = llvm::ConstantExpr::getBitCast(C, CharPtrTy); in EmitConstantValue()
1118 Casted = llvm::ConstantExpr::getGetElementPtr(Int8Ty, Casted, Offset); in EmitConstantValue()
1119 C = llvm::ConstantExpr::getPointerCast(Casted, C->getType()); in EmitConstantValue()
1125 return llvm::ConstantExpr::getPointerCast(C, DestTy); in EmitConstantValue()
1127 return llvm::ConstantExpr::getPtrToInt(C, DestTy); in EmitConstantValue()
[all …]
DCGVTables.cpp398 if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(C)) { in emitThunk()
422 llvm::ConstantExpr::getBitCast(Entry, OldThunkFn->getType()); in emitThunk()
528 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer()
533 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer()
538 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer()
541 Init = llvm::ConstantExpr::getBitCast(RTTI, Int8PtrTy); in CreateVTableInitializer()
570 PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn, in CreateVTableInitializer()
581 DeletedVirtualFn = llvm::ConstantExpr::getBitCast(DeletedVirtualFn, in CreateVTableInitializer()
601 Init = llvm::ConstantExpr::getBitCast(Init, Int8PtrTy); in CreateVTableInitializer()
607 Init = llvm::ConstantExpr::getNullValue(Int8PtrTy); in CreateVTableInitializer()
DCGObjCGNU.cpp175 return llvm::ConstantExpr::getGetElementPtr(ConstStr->getValueType(), in MakeConstantString()
191 return llvm::ConstantExpr::getGetElementPtr(ConstStr->getValueType(), in ExportUniqueString()
243 return llvm::ConstantExpr::getGetElementPtr(ConstStr->getValueType(), in MakePropertyEncodingString()
1127 return llvm::ConstantExpr::getBitCast(IDEHType, PtrToInt8Ty); in GetEHType()
1142 return llvm::ConstantExpr::getBitCast(typeinfo, PtrToInt8Ty); in GetEHType()
1157 auto *BVtable = llvm::ConstantExpr::getBitCast( in GetEHType()
1158 llvm::ConstantExpr::getGetElementPtr(Vtable->getValueType(), Vtable, Two), in GetEHType()
1171 return llvm::ConstantExpr::getBitCast(TI, PtrToInt8Ty); in GetEHType()
1197 isa = llvm::ConstantExpr::getBitCast(isa, PtrToIdTy); in GenerateConstantString()
1206 ObjCStr = llvm::ConstantExpr::getBitCast(ObjCStr, PtrToInt8Ty); in GenerateConstantString()
[all …]
/external/llvm/lib/Target/NVPTX/
DNVVMReflect.cpp175 assert(isa<ConstantExpr>(Str) && in handleFunction()
177 const ConstantExpr *GEP = cast<ConstantExpr>(Str); in handleFunction()
DNVPTXGenericToNVVM.cpp56 Value *remapConstantExpr(Module *M, Function *F, ConstantExpr *C,
155 Constant *BitCastNewGV = ConstantExpr::getPointerCast(NewGV, GV->getType()); in runOnModule()
241 } else if (isa<ConstantExpr>(C)) { in remapConstant()
245 NewValue = remapConstantExpr(M, F, cast<ConstantExpr>(C), Builder); in remapConstant()
291 Value *GenericToNVVM::remapConstantExpr(Module *M, Function *F, ConstantExpr *C, in remapConstantExpr()
DNVPTXFavorNonGenericAddrSpaces.cpp134 Constant *NewGEPCE = ConstantExpr::getGetElementPtr( in hoistAddrSpaceCastFromGEP()
138 ConstantExpr::getAddrSpaceCast(NewGEPCE, GEP->getType())); in hoistAddrSpaceCastFromGEP()
/external/llvm/include/llvm/Transforms/Utils/
DLocal.h37 class ConstantExpr; variable
230 Constant *OC = ConstantExpr::getIntegerCast(OpC, IntPtrTy, true /*SExt*/);
231 Scale = ConstantExpr::getMul(OC, Scale, isInBounds/*NUW*/);
/external/llvm/bindings/ocaml/llvm/
Dllvm.mli342 | ConstantExpr Constructor
933 more readable. See the method [llvm::ConstantExpr::getAlignOf]. *)
939 See the method [llvm::ConstantExpr::getSizeOf]. *)
943 See the method [llvm::ConstantExpr::getNeg]. *)
948 See the method [llvm::ConstantExpr::getNSWNeg]. *)
953 See the method [llvm::ConstantExpr::getNUWNeg]. *)
957 See the method [llvm::ConstantExpr::getFNeg]. *)
961 See the method [llvm::ConstantExpr::getNot]. *)
965 See the method [llvm::ConstantExpr::getAdd]. *)
970 See the method [llvm::ConstantExpr::getNSWAdd]. *)
[all …]

123456