Home
last modified time | relevance | path

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

12345678910>>...12

/llvm-project-15.0.7/llvm/unittests/IR/
H A DConstantsTest.cpp35 EXPECT_EQ(Zero, ConstantExpr::getAdd(One, One)); in TEST()
55 EXPECT_EQ(Zero, ConstantExpr::getSub(One, One)); in TEST()
63 EXPECT_EQ(One, ConstantExpr::getShl(One, Zero)); in TEST()
176 EXPECT_NE(K, ConstantExpr::getAddrSpaceCast( in TEST()
178 EXPECT_NE(K, ConstantExpr::getAddrSpaceCast( in TEST()
261 CHECK(ConstantExpr::getLShr(P0, P0, true), in TEST()
264 CHECK(ConstantExpr::getAShr(P0, P0, true), in TEST()
269 CHECK(ConstantExpr::getFPTrunc(P2, FloatTy), in TEST()
271 CHECK(ConstantExpr::getFPExtend(P1, DoubleTy), in TEST()
274 CHECK(ConstantExpr::getSelect(P3, P0, P4), in TEST()
[all …]
/llvm-project-15.0.7/llvm/include/llvm/IR/
H A DConstantFolder.h48 if (ConstantExpr::isDesirableBinOp(Opc)) in FoldBinOp()
49 return ConstantExpr::get(Opc, LC, RC); in FoldBinOp()
60 if (ConstantExpr::isDesirableBinOp(Opc)) in FoldExactBinOp()
61 return ConstantExpr::get(Opc, LC, RC, in FoldExactBinOp()
73 if (ConstantExpr::isDesirableBinOp(Opc)) { in FoldNoWrapBinOp()
94 return ConstantExpr::get(Opc, C); in FoldUnOpFMF()
102 return ConstantExpr::getCompare(P, LC, RC); in FoldICmp()
126 return ConstantExpr::getSelect(CC, TC, FC); in FoldSelect()
179 return ConstantExpr::getCast(Op, C, DestTy); in CreateCast()
197 return ConstantExpr::getFPCast(C, DestTy); in CreateFPCast()
[all …]
H A DOperator.h45 return cast<ConstantExpr>(this)->getOpcode(); in getOpcode()
53 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) in getOpcode()
82 friend class ConstantExpr; variable
120 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
134 friend class ConstantExpr; variable
161 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
343 (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); in classof()
378 friend class ConstantExpr; variable
516 friend class ConstantExpr; variable
544 friend class ConstantExpr; variable
[all …]
H A DReplaceConstant.h22 class ConstantExpr; variable
34 Instruction *I, ConstantExpr *CE,
46 std::map<Use *, std::vector<std::vector<ConstantExpr *>>> &CEPaths,
54 Instruction *I, ConstantExpr *CE,
55 std::map<Use *, std::vector<std::vector<ConstantExpr *>>> &CEPaths);
/llvm-project-15.0.7/llvm/lib/IR/
H A DReplaceConstant.cpp22 void convertConstantExprsToInstructions(Instruction *I, ConstantExpr *CE, in convertConstantExprsToInstructions()
25 std::map<Use *, std::vector<std::vector<ConstantExpr *>>> CEPaths; in convertConstantExprsToInstructions()
35 std::map<Use *, std::vector<std::vector<ConstantExpr *>>> &CEPaths, in convertConstantExprsToInstructions()
37 ValueMap<ConstantExpr *, Instruction *> Visited; in convertConstantExprsToInstructions()
97 Instruction *I, ConstantExpr *CE, in collectConstantExprPaths()
101 auto *CE2 = dyn_cast<ConstantExpr>(U.get()); in collectConstantExprPaths()
106 std::vector<std::vector<ConstantExpr *>> Paths; in collectConstantExprPaths()
109 std::vector<ConstantExpr *> Path{CE2}; in collectConstantExprPaths()
110 std::vector<std::vector<ConstantExpr *>> Stack{Path}; in collectConstantExprPaths()
112 std::vector<ConstantExpr *> TPath = Stack.back(); in collectConstantExprPaths()
[all …]
H A DConstantsContext.h49 : ConstantExpr(Ty, Opcode, &Op<0>(), 1) { in UnaryConstantExpr()
59 static bool classof(const ConstantExpr *CE) { in classof()
64 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
91 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
117 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
144 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
172 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
182 : ConstantExpr(VectorType::get( in ShuffleVectorConstantExpr()
208 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
241 return isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)); in classof()
[all …]
H A DConstantFold.cpp234 ConstantExpr *CE = dyn_cast<ConstantExpr>(C); in ExtractConstantBytes()
371 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in ConstantFoldCastInstruction()
596 if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) { in ConstantFoldSelectInstruction()
1116 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) in ConstantFoldBinaryInstruction()
1256 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldBinaryInstruction()
1355 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateFCmpRelation()
1499 ConstantExpr *CE1 = cast<ConstantExpr>(V1); in evaluateICmpRelation()
1712 (isa<ConstantExpr>(C1) || isa<ConstantExpr>(C2))) { in ConstantFoldCompareInstruction()
1874 if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(C2)) { in ConstantFoldCompareInstruction()
1885 if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) { in ConstantFoldCompareInstruction()
[all …]
H A DConstants.cpp386 C = ConstantExpr::getIntToPtr(C, PTy); in getIntegerValue()
628 if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(this)) { in getRelocationInfo()
630 ConstantExpr *LHS = dyn_cast<ConstantExpr>(CE->getOperand(0)); in getRelocationInfo()
631 ConstantExpr *RHS = dyn_cast<ConstantExpr>(CE->getOperand(1)); in getRelocationInfo()
1436 bool ConstantExpr::isCast() const { in isCast()
1440 bool ConstantExpr::isCompare() const { in isCompare()
1444 unsigned ConstantExpr::getPredicate() const { in getPredicate()
1462 return const_cast<ConstantExpr*>(this); in getWithOperands()
1488 return ConstantExpr::getFNeg(Ops[0]); in getWithOperands()
1495 return ConstantExpr::getGetElementPtr( in getWithOperands()
[all …]
H A DCore.cpp1532 return wrap(ConstantExpr::getAlignOf(unwrap(Ty))); in LLVMAlignOf()
1536 return wrap(ConstantExpr::getSizeOf(unwrap(Ty))); in LLVMSizeOf()
1617 return wrap(ConstantExpr::getOr(unwrap<Constant>(LHSConstant), in LLVMConstOr()
1628 return wrap(ConstantExpr::getICmp(Predicate, in LLVMConstICmp()
1635 return wrap(ConstantExpr::getFCmp(Predicate, in LLVMConstFCmp()
2791 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetICmpPredicate()
2800 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(unwrap(Inst))) in LLVMGetFCmpPredicate()
3480 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildMalloc()
3481 AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); in LLVMBuildMalloc()
3491 Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); in LLVMBuildArrayMalloc()
[all …]
/llvm-project-15.0.7/llvm/include/llvm/Analysis/
H A DTargetFolder.h59 if (ConstantExpr::isDesirableBinOp(Opc)) in FoldBinOp()
60 return Fold(ConstantExpr::get(Opc, LC, RC)); in FoldBinOp()
71 if (ConstantExpr::isDesirableBinOp(Opc)) in FoldExactBinOp()
72 return Fold(ConstantExpr::get( in FoldExactBinOp()
84 if (ConstantExpr::isDesirableBinOp(Opc)) { in FoldNoWrapBinOp()
106 return Fold(ConstantExpr::getCompare(P, LC, RC)); in FoldICmp()
113 return Fold(ConstantExpr::get(Opc, C)); in FoldUnOpFMF()
136 return Fold(ConstantExpr::getSelect(CC, TC, FC)); in FoldSelect()
192 return Fold(ConstantExpr::getCast(Op, C, DestTy)); in CreateCast()
208 return Fold(ConstantExpr::getFPCast(C, DestTy)); in CreateFPCast()
[all …]
/llvm-project-15.0.7/llvm/include/llvm/Transforms/Scalar/
H A DConstantHoisting.h54 class ConstantExpr; variable
85 ConstantExpr *ConstExpr;
88 ConstantCandidate(ConstantInt *ConstInt, ConstantExpr *ConstExpr=nullptr) :
117 ConstantExpr *BaseExpr;
145 using ConstPtrUnionType = PointerUnion<ConstantInt *, ConstantExpr *>;
179 ConstantExpr *ConstExpr);
/llvm-project-15.0.7/llvm/lib/Transforms/Utils/
H A DSanitizerStats.cpp51 ConstantExpr::getIntToPtr( in create()
61 auto InitAddr = ConstantExpr::getGetElementPtr( in create()
67 B.CreateCall(StatReport, ConstantExpr::getBitCast(InitAddr, Int8PtrTy)); in create()
89 ConstantExpr::getBitCast(NewModuleStatsGV, ModuleStatsGV->getType())); in finish()
102 B.CreateCall(StatInit, ConstantExpr::getBitCast(NewModuleStatsGV, Int8PtrTy)); in finish()
H A DRelLookupTableConverter.cpp114 Constant *Base = llvm::ConstantExpr::getPtrToInt(RelLookupTable, IntPtrTy); in createRelLookupTable()
115 Constant *Target = llvm::ConstantExpr::getPtrToInt(Element, IntPtrTy); in createRelLookupTable()
116 Constant *Sub = llvm::ConstantExpr::getSub(Target, Base); in createRelLookupTable()
118 llvm::ConstantExpr::getTrunc(Sub, Type::getInt32Ty(M.getContext())); in createRelLookupTable()
/llvm-project-15.0.7/llvm/lib/Analysis/
H A DConstantFolding.cpp144 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
195 C = ConstantExpr::getBitCast(C, SrcIVTy); in FoldBitCast()
233 Src = ConstantExpr::getShl(Src, in FoldBitCast()
238 Elt = ConstantExpr::getOr(Elt, Src); in FoldBitCast()
318 auto *CE = dyn_cast<ConstantExpr>(C); in IsConstantOffsetFromGlobal()
870 Ptr = ConstantExpr::getPointerCast( in StripPtrCastKeepAS()
1102 return ConstantExpr::getShuffleVector( in ConstantFoldInstOperandsImpl()
1312 return ConstantExpr::getCompare( in ConstantFoldCompareInstOperands()
1317 } else if (isa<ConstantExpr>(Ops1)) { in ConstantFoldCompareInstOperands()
1336 return ConstantExpr::get(Opcode, Op); in ConstantFoldUnaryOpOperand()
[all …]
H A DTypeMetadataUtils.cpp168 if (auto *C = dyn_cast<ConstantExpr>(I)) { in getPointerAtOffset()
179 auto *CE = dyn_cast<ConstantExpr>(C); in getPointerAtOffset()
204 auto *PtrExpr = dyn_cast<ConstantExpr>(U); in replaceRelativePointerUsersWithZero()
209 auto *SubExpr = dyn_cast<ConstantExpr>(PtrToIntUser); in replaceRelativePointerUsersWithZero()
/llvm-project-15.0.7/llvm/lib/Target/XCore/
H A DXCoreLowerThreadLocal.cpp78 static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) { in replaceConstantExprOp()
99 ConstantExpr *CExpr = dyn_cast<ConstantExpr>(WU); in replaceConstantExprOp()
117 ConstantExpr *CE = dyn_cast<ConstantExpr>(WU); in rewriteNonInstructionUses()
/llvm-project-15.0.7/llvm/lib/Transforms/Scalar/
H A DInferAddressSpaces.cpp419 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { in appendsFlatAddressExpressionToPostorderStack()
434 if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op->getOperand(I))) { in appendsFlatAddressExpressionToPostorderStack()
536 return ConstantExpr::getAddrSpaceCast(C, NewPtrTy); in operandWithNewAddressSpaceOrCreateUndef()
673 ConstantExpr *CE, unsigned NewAddrSpace, in cloneConstantExprWithNewAddressSpace()
687 return ConstantExpr::getBitCast(CE->getOperand(0), TargetType); in cloneConstantExprWithNewAddressSpace()
693 return ConstantExpr::getAddrSpaceCast(CE, TargetType); in cloneConstantExprWithNewAddressSpace()
702 return ConstantExpr::getSelect( in cloneConstantExprWithNewAddressSpace()
704 ConstantExpr::getAddrSpaceCast(Src1, TargetType)); in cloneConstantExprWithNewAddressSpace()
712 return ConstantExpr::getBitCast(Src, TargetType); in cloneConstantExprWithNewAddressSpace()
730 if (auto *CExpr = dyn_cast<ConstantExpr>(Operand)) in cloneConstantExprWithNewAddressSpace()
[all …]
/llvm-project-15.0.7/llvm/lib/Target/AMDGPU/
H A DAMDGPUOpenCLEnqueuedBlockLowering.cpp128 if (!isa<ConstantExpr>(UU)) in runOnModule()
131 auto *BitCast = cast<ConstantExpr>(UU); in runOnModule()
132 auto *NewPtr = ConstantExpr::getPointerCast(GV, BitCast->getType()); in runOnModule()
/llvm-project-15.0.7/llvm/lib/Target/NVPTX/
H A DNVPTXGenericToNVVM.cpp52 Value *remapConstantExpr(Module *M, Function *F, ConstantExpr *C,
138 Constant *BitCastNewGV = ConstantExpr::getPointerCast(NewGV, GV->getType()); in runOnModule()
180 } else if (isa<ConstantExpr>(C)) { in remapConstant()
184 NewValue = remapConstantExpr(M, F, cast<ConstantExpr>(C), Builder); in remapConstant()
230 Value *GenericToNVVM::remapConstantExpr(Module *M, Function *F, ConstantExpr *C, in remapConstantExpr()
/llvm-project-15.0.7/llvm/lib/Target/AMDGPU/Utils/
H A DAMDGPUMemoryUtils.h18 class ConstantExpr; variable
36 void replaceConstantUsesInFunction(ConstantExpr *C, const Function *F);
/llvm-project-15.0.7/clang/lib/CodeGen/
H A DConstantInitBuilder.cpp98 llvm::ConstantExpr::getInBoundsGetElementPtr( in resolveSelfReferences()
141 base = llvm::ConstantExpr::getPtrToInt(base, Builder.CGM.IntPtrTy); in getRelativeOffsetToPosition()
142 target = llvm::ConstantExpr::getPtrToInt(target, Builder.CGM.IntPtrTy); in getRelativeOffsetToPosition()
143 llvm::Constant *offset = llvm::ConstantExpr::getSub(target, base); in getRelativeOffsetToPosition()
147 offset = llvm::ConstantExpr::getTrunc(offset, offsetType); in getRelativeOffsetToPosition()
/llvm-project-15.0.7/clang-tools-extra/clangd/refactor/tweaks/
H A DPopulateSwitch.cpp173 const ConstantExpr *CE = dyn_cast<ConstantExpr>(CS->getLHS()); in REGISTER_TWEAK()
179 if (CE->getResultStorageKind() == ConstantExpr::RSK_None) in REGISTER_TWEAK()
/llvm-project-15.0.7/llvm/lib/Transforms/IPO/
H A DAnnotation2Metadata.cpp50 auto *StrGEP = dyn_cast<ConstantExpr>(OpC->getOperand(1)); in convertAnnotation2Metadata()
60 auto *Bitcast = dyn_cast<ConstantExpr>(OpC->getOperand(0)); in convertAnnotation2Metadata()
/llvm-project-15.0.7/polly/lib/CodeGen/
H A DManagedMemoryRewrite.cpp104 static void expandConstantExpr(ConstantExpr *Cur, PollyIRBuilder &Builder, in expandConstantExpr()
130 if (ConstantExpr *CExprOp = dyn_cast<ConstantExpr>(Op)) in expandConstantExpr()
152 if (ConstantExpr *ValueConstExpr = dyn_cast<ConstantExpr>(Operand)) in rewriteOldValToNew()
/llvm-project-15.0.7/llvm/test/Transforms/InstSimplify/ConstProp/
H A Dbitcast.ll44 … Ensure that an "ordered and equal" fcmp of a ConstantExpr to itself is not folded, since the Cons…
54 …re that an "unordered or not equal" fcmp of a ConstantExpr to itself is not folded, since the Cons…

12345678910>>...12