Home
last modified time | relevance | path

Searched refs:Constant (Results 1 – 25 of 1274) sorted by relevance

12345678910>>...51

/llvm-project/llvm/include/llvm/Analysis/
H A DConstantFolding.h33 class Constant; variable
47 bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, APInt &Offset,
56 Constant *ConstantFoldInstruction(Instruction *I, const DataLayout &DL,
62 Constant *ConstantFoldConstant(const Constant *C, const DataLayout &DL,
77 Constant *ConstantFoldInstOperands(Instruction *I, ArrayRef<Constant *> Ops,
86 Constant *ConstantFoldCompareInstOperands(
87 unsigned Predicate, Constant *LHS, Constant *RHS, const DataLayout &DL,
92 Constant *ConstantFoldUnaryOpOperand(unsigned Opcode, Constant *Op,
97 Constant *ConstantFoldBinaryOpOperands(unsigned Opcode, Constant *LHS,
98 Constant *RHS, const DataLayout &DL);
[all …]
H A DTargetFolder.h29 class Constant; variable
38 Constant *Fold(Constant *C) const { in Fold()
56 auto *LC = dyn_cast<Constant>(LHS); in FoldBinOp()
57 auto *RC = dyn_cast<Constant>(RHS); in FoldBinOp()
68 auto *LC = dyn_cast<Constant>(LHS); in FoldExactBinOp()
69 auto *RC = dyn_cast<Constant>(RHS); in FoldExactBinOp()
81 auto *LC = dyn_cast<Constant>(LHS); in FoldNoWrapBinOp()
82 auto *RC = dyn_cast<Constant>(RHS); in FoldNoWrapBinOp()
103 auto *LC = dyn_cast<Constant>(LHS); in FoldCmp()
104 auto *RC = dyn_cast<Constant>(RHS); in FoldCmp()
[all …]
/llvm-project/llvm/include/llvm/IR/
H A DConstants.h1 //===-- llvm/Constants.h - Constant class subclass definitions --*- C++ -*-===//
10 /// This file contains the declarations for the subclasses of Constant,
28 #include "llvm/IR/Constant.h"
53 class ConstantData : public Constant {
56 friend class Constant; in handleOperandChangeImpl()
59 llvm_unreachable("Constant data does not have operands!");
63 explicit ConstantData(Type *Ty, ValueTy VT) : Constant(Ty, VT, AllocMarker) {} in new()
84 friend class Constant;
105 static Constant *getTrue(Type *Ty);
106 static Constant *getFals
54 friend class Constant; global() variable
82 friend class Constant; global() variable
270 friend class Constant; global() variable
352 friend class Constant; global() variable
[all...]
H A DConstantFold.h30 class Constant; variable
34 Constant *ConstantFoldCastInstruction(
36 Constant *V, ///< The source constant
39 Constant *ConstantFoldSelectInstruction(Constant *Cond,
40 Constant *V1, Constant *V2);
41 Constant *ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx);
42 Constant *ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt,
43 Constant *Idx);
44 Constant *ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
46 Constant *ConstantFoldExtractValueInstruction(Constant *Agg,
[all …]
H A DConstant.h1 //===-- llvm/Constant.h - Constant class definition -------------*- C++ -*-===//
9 // This file contains the declaration of the Constant class.
41 /// LLVM Constant Representation
42 class Constant : public User {
44 Constant(Type *ty, ValueTy vty, AllocInfo AllocInfo) in Constant() function
47 ~Constant() = default;
50 void operator=(const Constant &) = delete;
51 Constant(const Constant
[all...]
H A DConstantFolder.h45 auto *LC = dyn_cast<Constant>(LHS); in FoldBinOp()
46 auto *RC = dyn_cast<Constant>(RHS); in FoldBinOp()
57 auto *LC = dyn_cast<Constant>(LHS); in FoldExactBinOp()
58 auto *RC = dyn_cast<Constant>(RHS); in FoldExactBinOp()
70 auto *LC = dyn_cast<Constant>(LHS); in FoldNoWrapBinOp()
71 auto *RC = dyn_cast<Constant>(RHS); in FoldNoWrapBinOp()
93 if (Constant *C = dyn_cast<Constant>(V)) in FoldUnOpFMF()
99 auto *LC = dyn_cast<Constant>(LHS); in FoldCmp()
100 auto *RC = dyn_cast<Constant>(RHS); in FoldCmp()
111 if (auto *PC = dyn_cast<Constant>(Ptr)) { in FoldGEP()
[all …]
/llvm-project/mlir/test/Target/SPIRV/
H A Dconstant.mlir6 // CHECK: spirv.Constant true
7 %0 = spirv.Constant true
8 // CHECK: spirv.Constant false
9 %1 = spirv.Constant false
18 // CHECK: spirv.Constant 0 : i32
19 %0 = spirv.Constant 0 : i32
20 // CHECK: spirv.Constant 10 : i32
21 %1 = spirv.Constant 10 : i32
22 // CHECK: spirv.Constant -5 : i32
23 %2 = spirv.Constant -5 : i32
[all …]
H A Dphi.mlir7 // CHECK: %[[CST:.*]] = spirv.Constant 0
8 %zero = spirv.Constant 0 : i32
28 // CHECK: %[[ZERO:.*]] = spirv.Constant 0
29 %zero = spirv.Constant 0 : i32
30 // CHECK-NEXT: %[[ONE:.*]] = spirv.Constant 1
31 %one = spirv.Constant 1.0 : f32
52 // CHECK: %[[CST0:.*]] = spirv.Constant 0
53 %zero = spirv.Constant 0 : i32
61 // CHECK-NEXT: %[[CST1:.*]] = spirv.Constant 0
86 // CHECK-NEXT: %[[ZERO:.*]] = spirv.Constant 0
[all …]
/llvm-project/mlir/test/Dialect/SPIRV/Transforms/
H A Dcanonicalize.mlir8 // CHECK: %[[INDEX:.*]] = spirv.Constant 0
12 %c0 = spirv.Constant 0: i32
23 // CHECK: %[[INDEX:.*]] = spirv.Constant 0
29 %c0 = spirv.Constant 0: i32
42 // CHECK: %[[INDEX:.*]] = spirv.Constant 1
49 %c1 = spirv.Constant 1: i32
119 // CHECK-DAG: spirv.Constant 6 : i32
120 // CHECK-DAG: spirv.Constant -33 : i32
121 // CHECK-DAG: spirv.Constant 42 : i32
122 %0 = spirv.Constant dens
[all...]
/llvm-project/clang/lib/CodeGen/
H A DConstantEmitter.h47 llvm::SmallVector<std::pair<llvm::Constant *, llvm::GlobalVariable*>, 4>
75 llvm::Constant *tryEmitForInitializer(const VarDecl &D);
76 llvm::Constant *tryEmitForInitializer(const Expr *E, LangAS destAddrSpace,
78 llvm::Constant *emitForInitializer(const APValue &value, LangAS destAddrSpace,
99 llvm::Constant *tryEmitAbstractForInitializer(const VarDecl &D);
105 llvm::Constant *emitAbstract(const Expr *E, QualType T);
106 llvm::Constant *
111 llvm::Constant *tryEmitAbstract(const Expr *E, QualType T);
112 llvm::Constant *tryEmitAbstractForMemory(const Expr *E, QualType T);
114 llvm::Constant *tryEmitAbstrac
[all...]
H A DCGExprConstant.cpp1 //===--- CGExprConstant.cpp - Emit LLVM Code from Constant Expressions ----===//
9 // This contains code to emit Constant Expr nodes as LLVM code.
45 llvm::Constant *getPadding(const CodeGenModule &CGM, CharUnits PadSize) {
50 return llvm::Constant::getNullValue(Ty); in getAlignment()
60 CharUnits getAlignment(const llvm::Constant *C) const { in getSize()
69 CharUnits getSize(const llvm::Constant *C) const { in getZeroes()
73 llvm::Constant *getPadding(CharUnits PadSize) const {
77 llvm::Constant *getZeroes(CharUnits ZeroSize) const {
83 /// Incremental builder for an llvm::Constant* holding a struct or array
94 llvm::SmallVector<llvm::Constant*, 3
[all...]
H A DCodeGenModule.h45 class Constant;
297 llvm::Constant *CopyHelper;
298 llvm::Constant *DisposeHelper;
334 Structor(int Priority, unsigned LexOrder, llvm::Constant *Initializer,
335 llvm::Constant *AssociatedData)
340 llvm::Constant *Initializer;
341 llvm::Constant *AssociatedData;
438 llvm::MapVector<StringRef, llvm::TrackingVH<llvm::Constant>> Replacements;
443 llvm::SmallVector<std::pair<llvm::GlobalValue *, llvm::Constant *>, 8>
480 std::vector<llvm::Constant*> Annotation
44 class Constant; global() variable
[all...]
/llvm-project/llvm/include/llvm/Transforms/Utils/
H A DEvaluator.h33 /// This class evaluates LLVM IR, producing the Constant representing each SSA
40 /// The evaluator represents values either as a Constant*, or as a
42 /// without creating a new interned Constant.
44 PointerUnion<Constant *, MutableAggregate *> Val;
49 MutableValue(Constant *C) { Val = C; } in MutableValue()
58 if (auto *C = dyn_cast_if_present<Constant *>(Val)) in getType()
63 Constant *toConstant() const { in toConstant()
64 if (auto *C = dyn_cast_if_present<Constant *>(Val)) in toConstant()
69 Constant *read(Type *Ty, APInt Offset, const DataLayout &DL) const;
70 bool write(Constant *
[all...]
/llvm-project/llvm/unittests/IR/
H A DConstantsTest.cpp27 Constant *One = ConstantInt::get(Int1, 1, true); in TEST()
28 Constant *Zero = ConstantInt::get(Int1, 0); in TEST()
29 Constant *NegOne = ConstantInt::get(Int1, static_cast<uint64_t>(-1), true); in TEST()
31 Constant *Poison = PoisonValue::get(Int1); in TEST()
121 Constant::getNullValue(Int64Ty), in TEST()
122 ConstantExpr::getPointerCast(Constant::getNullValue(PtrTy), Int64Ty)); in TEST()
125 EXPECT_EQ(Constant::getNullValue(PtrTy), in TEST()
126 ConstantExpr::getPointerCast(Constant::getNullValue(PtrTy), PtrTy)); in TEST()
129 EXPECT_EQ(Constant::getNullValue(Int64VecTy), in TEST()
130 ConstantExpr::getPointerCast(Constant in TEST()
[all...]
/llvm-project/llvm/lib/IR/
H A DConstants.cpp1 //===-- Constants.cpp - Implement Constant nodes --------------------------===//
9 // This file implements the Constant* classes.
53 // Constant Class
56 bool Constant::isNegativeZeroValue() const { in isNegativeZeroValue()
76 bool Constant::isZeroValue() const { in isZeroValue()
90 bool Constant::isNullValue() const { in isNullValue()
107 bool Constant::isAllOnesValue() const { in isAllOnesValue()
124 bool Constant::isOneValue() const { in isOneValue()
141 bool Constant::isNotOneValue() const { in isNotOneValue()
153 Constant *El in isNotOneValue()
[all...]
H A DConstantFold.cpp69 static Constant *FoldBitCast(Constant *V, Type *DestTy) {
75 return Constant::getAllOnesValue(DestTy); in FoldBitCast()
124 static Constant *foldMaybeUndesirableCast(unsigned opc, Constant *V, in foldMaybeUndesirableCast()
131 Constant *llvm::ConstantFoldCastInstruction(unsigned opc, Constant *V, in ConstantFoldCastInstruction()
142 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
148 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
170 if (Constant *Spla in ConstantFoldCastInstruction()
[all...]
/llvm-project/flang/include/flang/Evaluate/
H A Dconstant.h33 // This Constant<> template class should be instantiated only for
35 // Constant<SomeType> since there is no way to constrain each
38 // Expr<SomeType>) to wrap the appropriate instantiation of Constant<>.
40 template <typename> class Constant; variable
69 Constant<SubscriptInteger> SHAPE() const;
102 // Constant<> is specialized for Character kinds and SomeDerived.
141 template <typename T> class Constant : public ConstantBase<T> {
148 CLASS_BOILERPLATE(Constant) in CLASS_BOILERPLATE()
162 Constant Reshape(ConstantSubscripts &&) const;
163 std::size_t CopyFrom(const Constant
147 CLASS_BOILERPLATE(Constant) CLASS_BOILERPLATE() argument
[all...]
/llvm-project/flang/lib/Evaluate/
H A Dconstant.cpp55 Constant<SubscriptInteger> ConstantBounds::SHAPE() const { in SHAPE()
194 auto Constant<T>::At(const ConstantSubscripts &index) const -> Element { in At()
199 auto Constant<T>::Reshape(ConstantSubscripts &&dims) const -> Constant { in Reshape()
204 std::size_t Constant<T>::CopyFrom(const Constant<T> &source, std::size_t count, in CopyFrom()
211 Constant<Type<TypeCategory::Character, KIND>>::Constant( in Constant() function in Fortran::evaluate::Constant::Character
216 Constant<Type<TypeCategory::Character, KIND>>::Constant(Scalar<Result> &&str) in Constant() function in Fortran::evaluate::Constant::Character
221 Constant<Type<TypeCategory::Character, KIND>>::Constant(ConstantSubscript len, in Constant() function in Fortran::evaluate::Constant::Character
242 Constant<Type<TypeCategory::Character, KIND>>::~Constant() {} in ~Constant()
245 bool Constant<Type<TypeCategory::Character, KIND>>::empty() const { in empty()
250 std::size_t Constant<Type<TypeCategory::Character, KIND>>::size() const { in size()
[all …]
H A Dfold-reduction.h20 using Element = typename Constant<T>::Element; in FoldDotProduct()
24 Constant<T> *va{folder.Folding(args[0])}; in FoldDotProduct()
25 Constant<T> *vb{folder.Folding(args[1])}; in FoldDotProduct()
41 Constant<T> conjgA{ in FoldDotProduct()
44 context, Expr<T>{std::move(conjgA)} * Expr<T>{Constant<T>{*vb}})}; in FoldDotProduct()
45 Constant<T> &cProducts{DEREF(UnwrapConstantValue<T>(products))}; in FoldDotProduct()
67 Expr<T>{Constant<T>{*va}}, Expr<T>{Constant<T>{*vb}}}})}; in FoldDotProduct()
68 Constant<T> &cConjunctions{DEREF(UnwrapConstantValue<T>(conjunctions))}; in FoldDotProduct()
77 Fold(context, Expr<T>{Constant< in FoldDotProduct()
[all...]
/llvm-project/llvm/include/llvm/Transforms/IPO/
H A DFunctionSpecialization.h13 // the Inter-Procedural Sparse Conditional Constant Propagation (IPSCCP) pass.
105 using ConstMap = DenseMap<Value *, Constant *>;
153 class InstCostVisitor : public InstVisitor<InstCostVisitor, Constant *> { in Bonus()
183 Cost getCodeSizeSavingsForArg(Argument *A, Constant *C);
190 friend class InstVisitor<InstCostVisitor, Constant *>;
192 Constant *findConstantFor(Value *V) const;
197 Constant *C = nullptr); in InstCostVisitor()
216 bool discoverTransitivelyIncomingValues(Constant *Const, PHINode *Root,
219 Constant *visitInstruction(Instruction &I) { return nullptr; }
220 Constant *visitPHINod
[all...]
/llvm-project/mlir/test/Conversion/SPIRVToLLVM/
H A Dconstant-op-to-llvm.mlir4 // spirv.Constant
10 %0 = spirv.Constant true
12 %1 = spirv.Constant false
19 %0 = spirv.Constant dense<[true, false]> : vector<2xi1>
21 %1 = spirv.Constant dense<false> : vector<3xi1>
28 %0 = spirv.Constant 0 : i8
30 %1 = spirv.Constant -5 : si64
32 %2 = spirv.Constant 10 : ui16
39 %0 = spirv.Constant dense<[2, 3]> : vector<2xi32>
41 %1 = spirv.Constant dense<-4> : vector<2xsi32>
[all …]
/llvm-project/llvm/lib/Transforms/Utils/
H A DEvaluator.cpp20 #include "llvm/IR/Constant.h"
44 isSimpleEnoughValueToCommit(Constant *C,
45 SmallPtrSetImpl<Constant *> &SimpleConstants,
57 isSimpleEnoughValueToCommitHelper(Constant *C,
58 SmallPtrSetImpl<Constant *> &SimpleConstants, in isSimpleEnoughValueToCommitHelper()
72 if (!isSimpleEnoughValueToCommit(cast<Constant>(Op), SimpleConstants, DL)) in isSimpleEnoughValueToCommitHelper()
112 isSimpleEnoughValueToCommit(Constant *C,
113 SmallPtrSetImpl<Constant *> &SimpleConstants, in isSimpleEnoughValueToCommit()
128 Constant *Evaluator::MutableValue::read(Type *Ty, APInt Offset,
142 return ConstantFoldLoadFromConst(cast<Constant *>( in read()
[all...]
/llvm-project/llvm/lib/Analysis/
H A DConstantFolding.cpp32 #include "llvm/IR/Constant.h"
70 // Constant Folding internal helper functions
73 static Constant *foldConstVectorToAPInt(APInt &Result, Type *DestTy, in foldConstVectorToAPInt()
74 Constant *C, Type *SrcEltTy, in foldConstVectorToAPInt()
81 Constant *Element; in foldConstVectorToAPInt()
103 /// Constant fold bitcast, symbolically evaluating it with DataLayout.
106 Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) { in FoldBitCast()
111 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL)) in FoldBitCast()
131 if (Constant *C in FoldBitCast()
1077 ConstantFoldConstantImpl(const Constant * C,const DataLayout & DL,const TargetLibraryInfo * TLI,SmallDenseMap<Constant *,Constant * > & FoldedOps) ConstantFoldConstantImpl() argument
[all...]
/llvm-project/mlir/test/Conversion/MemRefToSPIRV/
H A Dbitwidth-emulation.mlir14 // CHECK: %[[ZERO:.+]] = spirv.Constant 0 : i32
17 // CHECK: %[[MASK:.+]] = spirv.Constant 255 : i32
19 // CHECK: %[[T2:.+]] = spirv.Constant 24 : i32
23 // CHECK: %[[ONE:.+]] = spirv.Constant 1 : i32
33 // CHECK: %[[ZERO:.+]] = spirv.Constant 0 : i32
36 // CHECK: %[[MASK:.+]] = spirv.Constant 255 : i32
38 // CHECK: %[[T2:.+]] = spirv.Constant 24 : i32
43 // INDEX64: %[[ZERO:.+]] = spirv.Constant 0 : i64
46 // INDEX64: %[[MASK:.+]] = spirv.Constant 255 : i32
48 // INDEX64: %[[T2:.+]] = spirv.Constant 24 : i32
[all …]
/llvm-project/mlir/test/Dialect/SPIRV/IR/
H A Dasm-op-interface.mlir5 %0 = spirv.Constant true
7 %1 = spirv.Constant false
10 %2 = spirv.Constant 42 : i32
12 %-2 = spirv.Constant -42 : i32
14 %3 = spirv.Constant 43 : i64
17 %9 = spirv.Constant 6 : ui8
20 %4 = spirv.Constant 0.5 : f32
22 %5 = spirv.Constant 0.5 : f64
25 %6 = spirv.Constant dense<[1, 2, 3]> : vector<3xi32>
28 %8 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>

12345678910>>...51