/external/llvm/unittests/IR/ |
D | ConstantsTest.cpp | 31 EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); in TEST() 35 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, One)); in TEST() 39 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, NegOne)); in TEST() 43 EXPECT_EQ(Zero, ConstantExpr::getSub(NegOne, One)); in TEST() 47 EXPECT_EQ(Zero, ConstantExpr::getSub(One, NegOne)); in TEST() 51 EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); in TEST() 55 EXPECT_EQ(Undef, ConstantExpr::getShl(One, One)); in TEST() 59 EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); in TEST() 63 EXPECT_EQ(Undef, ConstantExpr::getLShr(One, One)); in TEST() 67 EXPECT_EQ(Undef, ConstantExpr::getAShr(One, One)); in TEST() [all …]
|
/external/llvm/include/llvm/IR/ |
D | ConstantFolder.h | 36 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 …]
|
D | Operator.h | 29 class ConstantExpr; variable 54 return cast<ConstantExpr>(this)->getOpcode(); in getOpcode() 63 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in getOpcode() 69 static inline bool classof(const ConstantExpr *) { return true; } in classof() argument 71 return isa<Instruction>(V) || isa<ConstantExpr>(V); in classof() 88 friend class ConstantExpr; variable 117 static inline bool classof(const ConstantExpr *CE) { in classof() 125 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof() 139 friend class ConstantExpr; variable 157 static inline bool classof(const ConstantExpr *CE) { in classof() [all …]
|
/external/llvm/include/llvm/Analysis/ |
D | TargetFolder.h | 37 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 …]
|
D | ConstantFolding.h | 25 class ConstantExpr; variable 46 Constant *ConstantFoldConstantExpression(const ConstantExpr *CE, 85 Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
|
/external/llvm/lib/IR/ |
D | ConstantFold.cpp | 62 ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i)); in BitCastConstantVector() 63 C = ConstantExpr::getBitCast(C, DstEltTy); in BitCastConstantVector() 77 ConstantExpr *Op, ///< the first cast constant expression in foldConstantCastPair() 133 return ConstantExpr::getInBoundsGetElementPtr(V, IdxList); in FoldBitCast() 155 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast() 218 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes() 236 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes() 250 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes() 320 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes() 322 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes() [all …]
|
D | Constants.cpp | 176 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue() 264 SmallPtrSet<const ConstantExpr *, 4> &NonTrappingOps) { in canTrapImpl() argument 267 const ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in canTrapImpl() 273 if (ConstantExpr *Op = dyn_cast<ConstantExpr>(CE->getOperand(i))) { in canTrapImpl() 299 SmallPtrSet<const ConstantExpr *, 4> NonTrappingOps; in canTrap() 387 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) in getRelocationInfo() 389 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in getRelocationInfo() 390 ConstantExpr *RHS = dyn_cast<ConstantExpr>(CE->getOperand(1)); in getRelocationInfo() 1074 bool ConstantExpr::isCast() const { in isCast() 1078 bool ConstantExpr::isCompare() const { in isCompare() [all …]
|
D | ConstantsContext.h | 37 class UnaryConstantExpr : public ConstantExpr { 46 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) { in UnaryConstantExpr() 54 class BinaryConstantExpr : public ConstantExpr { 64 : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) { in BinaryConstantExpr() 75 class SelectConstantExpr : public ConstantExpr { 84 : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) { in SelectConstantExpr() 96 class ExtractElementConstantExpr : public ConstantExpr { 105 : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(), in ExtractElementConstantExpr() 117 class InsertElementConstantExpr : public ConstantExpr { 126 : ConstantExpr(C1->getType(), Instruction::InsertElement, in InsertElementConstantExpr() [all …]
|
D | Core.cpp | 843 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode() 847 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf() 851 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf() 855 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg() 859 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg() 863 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg() 868 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg() 872 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot() 876 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd() 882 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd() [all …]
|
D | IntrinsicInst.cpp | 35 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) in CastOperand()
|
/external/llvm/lib/Analysis/ |
D | ConstantFolding.cpp | 65 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 …]
|
/external/llvm/lib/Transforms/IPO/ |
D | GlobalOpt.cpp | 230 } 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 = in CleanupConstantGlobalUsers() 321 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP, DL, TLI)); 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() 570 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) { in SRAGlobal() [all …]
|
/external/llvm/lib/Target/XCore/ |
D | XCoreLowerThreadLocal.cpp | 78 createReplacementInstr(ConstantExpr *CE, Instruction *Instr) { in createReplacementInstr() 128 static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) { in replaceConstantExprOp() 149 ConstantExpr *CExpr = dyn_cast<ConstantExpr>(WU); in replaceConstantExprOp() 167 ConstantExpr *CE = dyn_cast<ConstantExpr>(WU); in rewriteNonInstructionUses()
|
/external/llvm/lib/Transforms/InstCombine/ |
D | InstCombineCompares.cpp | 34 return cast<ConstantInt>(ConstantExpr::getExtractElement(V, Idx)); in ExtractElement() 52 Result = ConstantExpr::getAdd(In1, In2); in AddWithOverflow() 87 Result = ConstantExpr::getSub(In1, In2); in SubWithOverflow() 305 Elt = ConstantExpr::getExtractValue(Elt, LaterIndices); in FoldCmpLoadFromIndexedGlobal() 308 if (AndCst) Elt = ConstantExpr::getAnd(Elt, AndCst); in FoldCmpLoadFromIndexedGlobal() 728 (isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) && in FoldGEPICmp() 729 (isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) { in FoldGEPICmp() 767 ConstantExpr::getSub(ConstantInt::getAllOnesValue(CI->getType()), CI); in FoldICmpAddOpCst() 775 return new ICmpInst(ICmpInst::ICMP_ULT, X, ConstantExpr::getNeg(CI)); in FoldICmpAddOpCst() 788 return new ICmpInst(ICmpInst::ICMP_SGT, X, ConstantExpr::getSub(SMax, CI)); in FoldICmpAddOpCst() [all …]
|
D | InstCombineAndOrXor.cpp | 130 Together = ConstantExpr::getAnd(AndRHS, OpRHS); in OptAndOp() 155 Together = ConstantExpr::getXor(AndRHS, Together); in OptAndOp() 265 assert(cast<ConstantInt>(ConstantExpr::getICmp((isSigned ? in InsertRangeTest() 281 Constant *NegLo = ConstantExpr::getNeg(Lo); in InsertRangeTest() 283 Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi); in InsertRangeTest() 300 ConstantInt *NegLo = cast<ConstantInt>(ConstantExpr::getNeg(Lo)); in InsertRangeTest() 302 Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi); in InsertRangeTest() 344 if (ConstantExpr::getAnd(N, Mask) == Mask) { in FoldLogicalPlusAnd() 368 && ConstantExpr::getAnd(N, Mask)->isNullValue()) in FoldLogicalPlusAnd() 461 ConstantExpr::getAnd(ACst, CCst) == CCst) { in getTypeOfMaskedICmp() [all …]
|
D | InstCombineLoadStoreAlloca.cpp | 35 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in pointsToConstantGlobal() 279 = ConstantExpr::getPointerBitCastOrAddrSpaceCast(TheSrc, AI.getType()); in visitAllocaInst() 323 CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs); in InstCombineLoadCast() 421 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op)) in visitLoadInst() 697 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) in visitStoreInst()
|
D | InstCombineMulDivRem.cpp | 144 return BinaryOperator::CreateMul(NewOp, ConstantExpr::getShl(C1, C2)); in visitMul() 399 Constant *F = ConstantExpr::getFMul(C1 ? C1 : C0, C); in foldFMulConst() 407 Constant *F = ConstantExpr::getFMul(C0, C); in foldFMulConst() 413 Constant *F = ConstantExpr::getFDiv(C, C1); in foldFMulConst() 418 Constant *F = ConstantExpr::getFDiv(C1, C); in foldFMulConst() 494 Value *M1 = ConstantExpr::getFMul(C1, C); in visitFMul() 736 ConstantExpr::getMul(RHS, LHSRHS)); in commonIDivTransforms() 792 return ConstantExpr::getTrunc(C, Ty); in dyn_castZExtVal() 924 return BinaryOperator::CreateUDiv(X, ConstantExpr::getShl(C2, C1)); in visitUDiv() 1004 ConstantExpr::getNeg(RHS)); in visitSDiv() [all …]
|
/external/clang/lib/CodeGen/ |
D | CGVTables.cpp | 328 if (llvm::ConstantExpr *CE = dyn_cast<llvm::ConstantExpr>(C)) { in emitThunk() 352 llvm::ConstantExpr::getBitCast(Entry, OldThunkFn->getType()); in emitThunk() 458 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer() 463 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer() 468 Init = llvm::ConstantExpr::getIntToPtr(Init, Int8PtrTy); in CreateVTableInitializer() 471 Init = llvm::ConstantExpr::getBitCast(RTTI, Int8PtrTy); in CreateVTableInitializer() 500 PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn, in CreateVTableInitializer() 511 DeletedVirtualFn = llvm::ConstantExpr::getBitCast(DeletedVirtualFn, in CreateVTableInitializer() 531 Init = llvm::ConstantExpr::getBitCast(Init, Int8PtrTy); in CreateVTableInitializer() 537 Init = llvm::ConstantExpr::getNullValue(Int8PtrTy); in CreateVTableInitializer()
|
D | CGExprConstant.cpp | 637 return llvm::ConstantExpr::getAddrSpaceCast(C, destType); in VisitCastExpr() 905 return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType())); in EmitLValue() 922 return llvm::ConstantExpr::getBitCast(Ptr, ConvertType(E->getType())); in EmitLValue() 1015 C = llvm::ConstantExpr::getZExt(C, BoolTy); in EmitConstantInit() 1040 C = llvm::ConstantExpr::getZExt(C, BoolTy); in EmitConstantExpr() 1071 llvm::Constant *Casted = llvm::ConstantExpr::getBitCast(C, CharPtrTy); in EmitConstantValue() 1072 Casted = llvm::ConstantExpr::getGetElementPtr(Casted, Offset); in EmitConstantValue() 1073 C = llvm::ConstantExpr::getPointerCast(Casted, C->getType()); in EmitConstantValue() 1079 return llvm::ConstantExpr::getPointerCast(C, DestTy); in EmitConstantValue() 1081 return llvm::ConstantExpr::getPtrToInt(C, DestTy); in EmitConstantValue() [all …]
|
D | CGObjCGNU.cpp | 175 return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros); in MakeConstantString() 190 return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros); in ExportUniqueString() 240 return llvm::ConstantExpr::getGetElementPtr( in MakePropertyEncodingString() 1123 return llvm::ConstantExpr::getBitCast(IDEHType, PtrToInt8Ty); in GetEHType() 1138 return llvm::ConstantExpr::getBitCast(typeinfo, PtrToInt8Ty); in GetEHType() 1153 Vtable = llvm::ConstantExpr::getGetElementPtr(Vtable, Two); in GetEHType() 1154 Vtable = llvm::ConstantExpr::getBitCast(Vtable, PtrToInt8Ty); in GetEHType() 1166 return llvm::ConstantExpr::getBitCast(TI, PtrToInt8Ty); in GetEHType() 1192 isa = llvm::ConstantExpr::getBitCast(isa, PtrToIdTy); in GenerateConstantString() 1201 ObjCStr = llvm::ConstantExpr::getBitCast(ObjCStr, PtrToInt8Ty); in GenerateConstantString() [all …]
|
/external/llvm/lib/CodeGen/ |
D | JumpInstrTables.cpp | 72 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in isIndirectCall() 98 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Us)) { in replaceGlobalValueIndirectUse()
|
/external/lldb/source/Expression/ |
D | IRForTarget.cpp | 292 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/llvm/include/llvm/Transforms/Utils/ |
D | Local.h | 37 class ConstantExpr; variable 225 Constant *OC = ConstantExpr::getIntegerCast(OpC, IntPtrTy, true /*SExt*/); 226 Scale = ConstantExpr::getMul(OC, Scale, isInBounds/*NUW*/);
|
/external/llvm/lib/Target/NVPTX/ |
D | NVVMReflect.cpp | 154 assert(isa<ConstantExpr>(Str) && in handleFunction() 156 const ConstantExpr *GEP = cast<ConstantExpr>(Str); in handleFunction()
|
D | NVPTXGenericToNVVM.cpp | 55 Value *remapConstantExpr(Module *M, Function *F, ConstantExpr *C, 144 Constant *BitCastNewGV = ConstantExpr::getPointerCast(NewGV, GV->getType()); in runOnModule() 233 } else if (isa<ConstantExpr>(C)) { in remapConstant() 237 NewValue = remapConstantExpr(M, F, cast<ConstantExpr>(C), Builder); in remapConstant() 283 Value *GenericToNVVM::remapConstantExpr(Module *M, Function *F, ConstantExpr *C, in remapConstantExpr()
|