Home
last modified time | relevance | path

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

1234567891011

/external/llvm/unittests/IR/
DConstantsTest.cpp35 EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); in TEST()
39 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, One)); in TEST()
43 EXPECT_EQ(Zero, ConstantExpr::getAdd(NegOne, NegOne)); in TEST()
47 EXPECT_EQ(Zero, ConstantExpr::getSub(NegOne, One)); in TEST()
51 EXPECT_EQ(Zero, ConstantExpr::getSub(One, NegOne)); in TEST()
55 EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); in TEST()
59 EXPECT_EQ(Undef, ConstantExpr::getShl(One, One)); in TEST()
63 EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); in TEST()
67 EXPECT_EQ(Undef, ConstantExpr::getLShr(One, One)); in TEST()
71 EXPECT_EQ(Undef, ConstantExpr::getAShr(One, One)); in TEST()
[all …]
/external/swiftshader/third_party/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 …]
/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.h28 class ConstantExpr; variable
51 return cast<ConstantExpr>(this)->getOpcode(); in getOpcode()
59 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in getOpcode()
65 static inline bool classof(const ConstantExpr *) { return true; } in classof() argument
67 return isa<Instruction>(V) || isa<ConstantExpr>(V); in classof()
83 friend class ConstantExpr; variable
112 static inline bool classof(const ConstantExpr *CE) { in classof()
120 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
134 friend class ConstantExpr; variable
151 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 …]
/external/swiftshader/third_party/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/swiftshader/third_party/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 …]
/external/llvm/lib/IR/
DConstantFold.cpp62 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(PTy->getElementType(), in FoldBitCast()
156 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
233 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
251 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
265 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
335 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
337 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
[all …]
DConstantsContext.h33 class UnaryConstantExpr : public ConstantExpr {
42 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) { in UnaryConstantExpr()
50 class BinaryConstantExpr : public ConstantExpr {
60 : ConstantExpr(C1->getType(), Opcode, &Op<0>(), 2) { in BinaryConstantExpr()
71 class SelectConstantExpr : public ConstantExpr {
80 : ConstantExpr(C2->getType(), Instruction::Select, &Op<0>(), 3) { in SelectConstantExpr()
92 class ExtractElementConstantExpr : public ConstantExpr {
101 : ConstantExpr(cast<VectorType>(C1->getType())->getElementType(), in ExtractElementConstantExpr()
113 class InsertElementConstantExpr : public ConstantExpr {
122 : ConstantExpr(C1->getType(), Instruction::InsertElement, in InsertElementConstantExpr()
[all …]
DConstants.cpp240 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue()
329 SmallPtrSetImpl<const ConstantExpr *> &NonTrappingOps) { in canTrapImpl()
332 const ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in canTrapImpl()
338 if (ConstantExpr *Op = dyn_cast<ConstantExpr>(CE->getOperand(i))) { in canTrapImpl()
362 SmallPtrSet<const ConstantExpr *, 4> NonTrappingOps; in canTrap()
428 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) in needsRelocation()
430 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in needsRelocation()
431 ConstantExpr *RHS = dyn_cast<ConstantExpr>(CE->getOperand(1)); in needsRelocation()
1064 bool ConstantExpr::isCast() const { in isCast()
1068 bool ConstantExpr::isCompare() const { in isCompare()
[all …]
DCore.cpp1077 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode()
1081 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
1085 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
1089 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
1093 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
1097 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
1102 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg()
1106 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
1110 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
1116 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd()
[all …]
/external/swiftshader/third_party/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); in FoldBitCast()
152 return ConstantExpr::getBitCast(ConstantVector::get(V), DestPTy); in FoldBitCast()
215 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
233 return ConstantExpr::getOr(LHS, RHS); in ExtractConstantBytes()
247 return ConstantExpr::getAnd(LHS, RHS); in ExtractConstantBytes()
317 Res = ConstantExpr::getLShr(Res, in ExtractConstantBytes()
319 return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(), in ExtractConstantBytes()
339 return ConstantExpr::getNUWMul(E, N); in getFoldedSizeOf()
[all …]
DConstants.cpp121 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue()
182 const ConstantExpr *CE = dyn_cast<ConstantExpr>(this); in canTrap()
251 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) in getRelocationInfo()
253 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in getRelocationInfo()
254 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.cpp685 return map_to_llvmopcode(unwrap<ConstantExpr>(ConstantVal)->getOpcode()); in LLVMGetConstOpcode()
689 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
693 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
697 return wrap(ConstantExpr::getNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNeg()
701 return wrap(ConstantExpr::getNSWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNSWNeg()
705 return wrap(ConstantExpr::getNUWNeg(unwrap<Constant>(ConstantVal))); in LLVMConstNUWNeg()
710 return wrap(ConstantExpr::getFNeg(unwrap<Constant>(ConstantVal))); in LLVMConstFNeg()
714 return wrap(ConstantExpr::getNot(unwrap<Constant>(ConstantVal))); in LLVMConstNot()
718 return wrap(ConstantExpr::getAdd(unwrap<Constant>(LHSConstant), in LLVMConstAdd()
724 return wrap(ConstantExpr::getNSWAdd(unwrap<Constant>(LHSConstant), in LLVMConstNSWAdd()
[all …]
/external/swiftshader/third_party/LLVM/lib/Analysis/
DConstantFolding.cpp57 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
69 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
75 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
97 if (!C) return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
100 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
110 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
136 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
139 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
142 Src = ConstantExpr::getShl(Src, in FoldBitCast()
147 Elt = ConstantExpr::getOr(Elt, Src); in FoldBitCast()
[all …]
/external/llvm/lib/Transforms/Utils/
DEvaluator.cpp69 ConstantExpr *CE = cast<ConstantExpr>(C); in isSimpleEnoughValueToCommitHelper()
126 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) { in isSimpleEnoughPointerToCommit()
178 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(P)) in ComputeLoadResult()
206 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) { in EvaluateBlock()
227 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) { in EvaluateBlock()
251 Ptr = ConstantExpr::getGetElementPtr(nullptr, Ptr, IdxList); in EvaluateBlock()
252 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ptr)) in EvaluateBlock()
266 Val = ConstantExpr::getBitCast(Val, NewTy); in EvaluateBlock()
274 InstResult = ConstantExpr::get(BO->getOpcode(), in EvaluateBlock()
280 InstResult = ConstantExpr::getCompare(CI->getPredicate(), in EvaluateBlock()
[all …]
DSanitizerStats.cpp53 ConstantExpr::getIntToPtr( in create()
63 auto InitAddr = ConstantExpr::getGetElementPtr( in create()
69 B.CreateCall(StatReport, ConstantExpr::getBitCast(InitAddr, Int8PtrTy)); in create()
91 ConstantExpr::getBitCast(NewModuleStatsGV, ModuleStatsGV->getType())); in finish()
104 B.CreateCall(StatInit, ConstantExpr::getBitCast(NewModuleStatsGV, Int8PtrTy)); in finish()
/external/llvm/lib/Analysis/
DConstantFolding.cpp67 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
79 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
95 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
107 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
118 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
124 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
148 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
158 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
185 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
188 Src = ConstantExpr::getZExt(Src, Elt->getType()); in FoldBitCast()
[all …]
/external/swiftshader/third_party/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.cpp32 return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1)); in AddOne()
36 return ConstantExpr::getSub(C, ConstantInt::get(C->getType(), 1)); in SubOne()
40 return cast<ConstantInt>(ConstantExpr::getExtractElement(V, Idx)); in ExtractElement()
58 Result = ConstantExpr::getAdd(In1, In2); in AddWithOverflow()
93 Result = ConstantExpr::getSub(In1, In2); in SubWithOverflow()
280 Elt = ConstantExpr::getExtractValue(Elt, LaterIndices); in FoldCmpLoadFromIndexedGlobal()
283 if (AndCst) Elt = ConstantExpr::getAnd(Elt, AndCst); in FoldCmpLoadFromIndexedGlobal()
668 (isa<ConstantExpr>(GEPLHS) || GEPLHS->hasOneUse()) && in FoldGEPICmp()
669 (isa<ConstantExpr>(GEPRHS) || GEPRHS->hasOneUse())) { in FoldGEPICmp()
708 ConstantExpr::getSub(ConstantInt::getAllOnesValue(CI->getType()), CI); in FoldICmpAddOpCst()
[all …]
/external/swiftshader/third_party/LLVM/include/llvm/Analysis/
DConstantFolding.h25 class ConstantExpr; variable
43 Constant *ConstantFoldConstantExpression(const ConstantExpr *CE,
78 Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
/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/swiftshader/third_party/LLVM/lib/Transforms/IPO/
DGlobalOpt.cpp180 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in AnalyzeGlobal()
326 } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U)) { in CleanupConstantGlobalUsers()
347 if (!isa<ConstantExpr>(GEP->getOperand(0))) { in CleanupConstantGlobalUsers()
348 ConstantExpr *CE = in CleanupConstantGlobalUsers()
349 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP)); in CleanupConstantGlobalUsers()
418 (!isa<ConstantExpr>(U) || in IsUserOfGlobalSafeForSRA()
419 cast<ConstantExpr>(U)->getOpcode() != Instruction::GetElementPtr)) in IsUserOfGlobalSafeForSRA()
582 assert(((isa<ConstantExpr>(GEP) && in SRAGlobal()
583 cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)|| in SRAGlobal()
596 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(GEP)) { in SRAGlobal()
[all …]

1234567891011