LLVM  13.0.0git
NoFolder.h
Go to the documentation of this file.
1 //===- NoFolder.h - Constant folding helper ---------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the NoFolder class, a helper for IRBuilder. It provides
10 // IRBuilder with a set of methods for creating unfolded constants. This is
11 // useful for learners trying to understand how LLVM IR works, and who don't
12 // want details to be hidden by the constant folder. For general constant
13 // creation and folding, use ConstantExpr and the routines in
14 // llvm/Analysis/ConstantFolding.h.
15 //
16 // Note: since it is not actually possible to create unfolded constants, this
17 // class returns instructions rather than constants.
18 //
19 //===----------------------------------------------------------------------===//
20 
21 #ifndef LLVM_IR_NOFOLDER_H
22 #define LLVM_IR_NOFOLDER_H
23 
24 #include "llvm/ADT/ArrayRef.h"
25 #include "llvm/IR/Constants.h"
26 #include "llvm/IR/InstrTypes.h"
27 #include "llvm/IR/Instruction.h"
28 #include "llvm/IR/Instructions.h"
30 
31 namespace llvm {
32 
33 /// NoFolder - Create "constants" (actually, instructions) with no folding.
34 class NoFolder final : public IRBuilderFolder {
35  virtual void anchor();
36 
37 public:
38  explicit NoFolder() = default;
39 
40  //===--------------------------------------------------------------------===//
41  // Binary Operators
42  //===--------------------------------------------------------------------===//
43 
45  bool HasNUW = false,
46  bool HasNSW = false) const override {
48  if (HasNUW) BO->setHasNoUnsignedWrap();
49  if (HasNSW) BO->setHasNoSignedWrap();
50  return BO;
51  }
52 
53  Instruction *CreateFAdd(Constant *LHS, Constant *RHS) const override {
54  return BinaryOperator::CreateFAdd(LHS, RHS);
55  }
56 
58  bool HasNUW = false,
59  bool HasNSW = false) const override {
60  BinaryOperator *BO = BinaryOperator::CreateSub(LHS, RHS);
61  if (HasNUW) BO->setHasNoUnsignedWrap();
62  if (HasNSW) BO->setHasNoSignedWrap();
63  return BO;
64  }
65 
66  Instruction *CreateFSub(Constant *LHS, Constant *RHS) const override {
67  return BinaryOperator::CreateFSub(LHS, RHS);
68  }
69 
71  bool HasNUW = false,
72  bool HasNSW = false) const override {
74  if (HasNUW) BO->setHasNoUnsignedWrap();
75  if (HasNSW) BO->setHasNoSignedWrap();
76  return BO;
77  }
78 
79  Instruction *CreateFMul(Constant *LHS, Constant *RHS) const override {
80  return BinaryOperator::CreateFMul(LHS, RHS);
81  }
82 
84  bool isExact = false) const override {
85  if (!isExact)
86  return BinaryOperator::CreateUDiv(LHS, RHS);
87  return BinaryOperator::CreateExactUDiv(LHS, RHS);
88  }
89 
91  bool isExact = false) const override {
92  if (!isExact)
93  return BinaryOperator::CreateSDiv(LHS, RHS);
94  return BinaryOperator::CreateExactSDiv(LHS, RHS);
95  }
96 
97  Instruction *CreateFDiv(Constant *LHS, Constant *RHS) const override {
98  return BinaryOperator::CreateFDiv(LHS, RHS);
99  }
100 
101  Instruction *CreateURem(Constant *LHS, Constant *RHS) const override {
102  return BinaryOperator::CreateURem(LHS, RHS);
103  }
104 
105  Instruction *CreateSRem(Constant *LHS, Constant *RHS) const override {
106  return BinaryOperator::CreateSRem(LHS, RHS);
107  }
108 
109  Instruction *CreateFRem(Constant *LHS, Constant *RHS) const override {
110  return BinaryOperator::CreateFRem(LHS, RHS);
111  }
112 
113  Instruction *CreateShl(Constant *LHS, Constant *RHS, bool HasNUW = false,
114  bool HasNSW = false) const override {
115  BinaryOperator *BO = BinaryOperator::CreateShl(LHS, RHS);
116  if (HasNUW) BO->setHasNoUnsignedWrap();
117  if (HasNSW) BO->setHasNoSignedWrap();
118  return BO;
119  }
120 
122  bool isExact = false) const override {
123  if (!isExact)
124  return BinaryOperator::CreateLShr(LHS, RHS);
125  return BinaryOperator::CreateExactLShr(LHS, RHS);
126  }
127 
129  bool isExact = false) const override {
130  if (!isExact)
131  return BinaryOperator::CreateAShr(LHS, RHS);
132  return BinaryOperator::CreateExactAShr(LHS, RHS);
133  }
134 
135  Instruction *CreateAnd(Constant *LHS, Constant *RHS) const override {
136  return BinaryOperator::CreateAnd(LHS, RHS);
137  }
138 
139  Instruction *CreateOr(Constant *LHS, Constant *RHS) const override {
140  return BinaryOperator::CreateOr(LHS, RHS);
141  }
142 
143  Instruction *CreateXor(Constant *LHS, Constant *RHS) const override {
144  return BinaryOperator::CreateXor(LHS, RHS);
145  }
146 
148  Constant *LHS, Constant *RHS) const override {
149  return BinaryOperator::Create(Opc, LHS, RHS);
150  }
151 
152  //===--------------------------------------------------------------------===//
153  // Unary Operators
154  //===--------------------------------------------------------------------===//
155 
157  bool HasNUW = false,
158  bool HasNSW = false) const override {
160  if (HasNUW) BO->setHasNoUnsignedWrap();
161  if (HasNSW) BO->setHasNoSignedWrap();
162  return BO;
163  }
164 
165  Instruction *CreateFNeg(Constant *C) const override {
166  return UnaryOperator::CreateFNeg(C);
167  }
168 
169  Instruction *CreateNot(Constant *C) const override {
171  }
172 
174  Constant *C) const override {
175  return UnaryOperator::Create(Opc, C);
176  }
177 
178  //===--------------------------------------------------------------------===//
179  // Memory Instructions
180  //===--------------------------------------------------------------------===//
181 
183  ArrayRef<Constant *> IdxList) const override {
184  return ConstantExpr::getGetElementPtr(Ty, C, IdxList);
185  }
186 
188  Constant *Idx) const override {
189  // This form of the function only exists to avoid ambiguous overload
190  // warnings about whether to convert Idx to ArrayRef<Constant *> or
191  // ArrayRef<Value *>.
192  return ConstantExpr::getGetElementPtr(Ty, C, Idx);
193  }
194 
196  ArrayRef<Value *> IdxList) const override {
197  return GetElementPtrInst::Create(Ty, C, IdxList);
198  }
199 
201  Type *Ty, Constant *C, ArrayRef<Constant *> IdxList) const override {
202  return ConstantExpr::getInBoundsGetElementPtr(Ty, C, IdxList);
203  }
204 
206  Constant *Idx) const override {
207  // This form of the function only exists to avoid ambiguous overload
208  // warnings about whether to convert Idx to ArrayRef<Constant *> or
209  // ArrayRef<Value *>.
210  return ConstantExpr::getInBoundsGetElementPtr(Ty, C, Idx);
211  }
212 
214  Type *Ty, Constant *C, ArrayRef<Value *> IdxList) const override {
215  return GetElementPtrInst::CreateInBounds(Ty, C, IdxList);
216  }
217 
218  //===--------------------------------------------------------------------===//
219  // Cast/Conversion Operators
220  //===--------------------------------------------------------------------===//
221 
223  Type *DestTy) const override {
224  return CastInst::Create(Op, C, DestTy);
225  }
226 
227  Instruction *CreatePointerCast(Constant *C, Type *DestTy) const override {
228  return CastInst::CreatePointerCast(C, DestTy);
229  }
230 
232  Constant *C, Type *DestTy) const override {
234  }
235 
237  bool isSigned) const override {
238  return CastInst::CreateIntegerCast(C, DestTy, isSigned);
239  }
240 
241  Instruction *CreateFPCast(Constant *C, Type *DestTy) const override {
242  return CastInst::CreateFPCast(C, DestTy);
243  }
244 
245  Instruction *CreateBitCast(Constant *C, Type *DestTy) const override {
246  return CreateCast(Instruction::BitCast, C, DestTy);
247  }
248 
249  Instruction *CreateIntToPtr(Constant *C, Type *DestTy) const override {
250  return CreateCast(Instruction::IntToPtr, C, DestTy);
251  }
252 
253  Instruction *CreatePtrToInt(Constant *C, Type *DestTy) const override {
254  return CreateCast(Instruction::PtrToInt, C, DestTy);
255  }
256 
257  Instruction *CreateZExtOrBitCast(Constant *C, Type *DestTy) const override {
258  return CastInst::CreateZExtOrBitCast(C, DestTy);
259  }
260 
261  Instruction *CreateSExtOrBitCast(Constant *C, Type *DestTy) const override {
262  return CastInst::CreateSExtOrBitCast(C, DestTy);
263  }
264 
265  Instruction *CreateTruncOrBitCast(Constant *C, Type *DestTy) const override {
266  return CastInst::CreateTruncOrBitCast(C, DestTy);
267  }
268 
269  //===--------------------------------------------------------------------===//
270  // Compare Instructions
271  //===--------------------------------------------------------------------===//
272 
274  Constant *LHS, Constant *RHS) const override {
275  return new ICmpInst(P, LHS, RHS);
276  }
277 
279  Constant *LHS, Constant *RHS) const override {
280  return new FCmpInst(P, LHS, RHS);
281  }
282 
283  //===--------------------------------------------------------------------===//
284  // Other Instructions
285  //===--------------------------------------------------------------------===//
286 
288  Constant *True, Constant *False) const override {
289  return SelectInst::Create(C, True, False);
290  }
291 
293  Constant *Idx) const override {
294  return ExtractElementInst::Create(Vec, Idx);
295  }
296 
298  Constant *Idx) const override {
299  return InsertElementInst::Create(Vec, NewElt, Idx);
300  }
301 
303  ArrayRef<int> Mask) const override {
304  return new ShuffleVectorInst(V1, V2, Mask);
305  }
306 
308  ArrayRef<unsigned> IdxList) const override {
309  return ExtractValueInst::Create(Agg, IdxList);
310  }
311 
313  ArrayRef<unsigned> IdxList) const override {
314  return InsertValueInst::Create(Agg, Val, IdxList);
315  }
316 };
317 
318 } // end namespace llvm
319 
320 #endif // LLVM_IR_NOFOLDER_H
llvm::NoFolder::CreateAnd
Instruction * CreateAnd(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:135
llvm::NoFolder::CreateIntCast
Instruction * CreateIntCast(Constant *C, Type *DestTy, bool isSigned) const override
Definition: NoFolder.h:236
llvm
Definition: AllocatorList.h:23
llvm::CastInst::CreatePointerBitCastOrAddrSpaceCast
static CastInst * CreatePointerBitCastOrAddrSpaceCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast or an AddrSpaceCast cast instruction.
Definition: Instructions.cpp:3071
llvm::Instruction::UnaryOps
UnaryOps
Definition: Instruction.h:761
llvm::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:722
llvm::NoFolder::CreateSExtOrBitCast
Instruction * CreateSExtOrBitCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:261
llvm::NoFolder::CreateSDiv
Instruction * CreateSDiv(Constant *LHS, Constant *RHS, bool isExact=false) const override
Definition: NoFolder.h:90
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::BinaryOperator::CreateNot
static BinaryOperator * CreateNot(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Definition: Instructions.cpp:2602
llvm::NoFolder::CreateSRem
Instruction * CreateSRem(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:105
llvm::IRBuilderFolder
IRBuilderFolder - Interface for constant folding in IRBuilder.
Definition: IRBuilderFolder.h:24
llvm::NoFolder::CreateTruncOrBitCast
Instruction * CreateTruncOrBitCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:265
llvm::InsertValueInst::Create
static InsertValueInst * Create(Value *Agg, Value *Val, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Definition: Instructions.h:2469
llvm::CastInst::Create
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
Definition: Instructions.cpp:2942
llvm::NoFolder::CreateCast
Instruction * CreateCast(Instruction::CastOps Op, Constant *C, Type *DestTy) const override
Definition: NoFolder.h:222
llvm::InsertElementInst::Create
static InsertElementInst * Create(Value *Vec, Value *NewElt, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Definition: Instructions.h:1928
llvm::ExtractElementInst::Create
static ExtractElementInst * Create(Value *Vec, Value *Idx, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Definition: Instructions.h:1863
llvm::NoFolder::CreateFPCast
Instruction * CreateFPCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:241
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::GetElementPtrInst::CreateInBounds
static GetElementPtrInst * CreateInBounds(Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Create an "inbounds" getelementptr.
Definition: Instructions.h:965
llvm::Instruction::setHasNoUnsignedWrap
void setHasNoUnsignedWrap(bool b=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag.
Definition: Instruction.cpp:120
llvm::NoFolder::CreateOr
Instruction * CreateOr(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:139
llvm::NoFolder::CreateInBoundsGetElementPtr
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList) const override
Definition: NoFolder.h:200
llvm::NoFolder::CreateFRem
Instruction * CreateFRem(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:109
llvm::NoFolder::CreateInsertValue
Instruction * CreateInsertValue(Constant *Agg, Constant *Val, ArrayRef< unsigned > IdxList) const override
Definition: NoFolder.h:312
llvm::NoFolder::CreateBinOp
Instruction * CreateBinOp(Instruction::BinaryOps Opc, Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:147
llvm::NoFolder::CreateAdd
Instruction * CreateAdd(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
Definition: NoFolder.h:44
llvm::ConstantExpr::getInBoundsGetElementPtr
static Constant * getInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList)
Create an "inbounds" getelementptr.
Definition: Constants.h:1232
llvm::CastInst::CreateIntegerCast
static CastInst * CreateIntegerCast(Value *S, Type *Ty, bool isSigned, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt, BitCast, or Trunc for int -> int casts.
Definition: Instructions.cpp:3108
llvm::NoFolder::CreatePtrToInt
Instruction * CreatePtrToInt(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:253
llvm::NoFolder::CreateIntToPtr
Instruction * CreateIntToPtr(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:249
llvm::BinaryOperator::CreateNeg
NUW NUW NUW NUW Exact static Exact BinaryOperator * CreateNeg(Value *Op, const Twine &Name="", Instruction *InsertBefore=nullptr)
Helper functions to construct and inspect unary operations (NEG and NOT) via binary operators SUB and...
Definition: Instructions.cpp:2562
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
llvm::NoFolder::CreateZExtOrBitCast
Instruction * CreateZExtOrBitCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:257
llvm::NoFolder::CreateMul
Instruction * CreateMul(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
Definition: NoFolder.h:70
llvm::NoFolder::CreateLShr
Instruction * CreateLShr(Constant *LHS, Constant *RHS, bool isExact=false) const override
Definition: NoFolder.h:121
llvm::NoFolder::CreateFSub
Instruction * CreateFSub(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:66
Instruction.h
llvm::SelectInst::Create
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr, Instruction *MDFrom=nullptr)
Definition: Instructions.h:1746
llvm::NoFolder::CreateFNeg
Instruction * CreateFNeg(Constant *C) const override
Definition: NoFolder.h:165
Constants.h
llvm::NoFolder::CreateFCmp
Instruction * CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:278
llvm::Instruction::setHasNoSignedWrap
void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag.
Definition: Instruction.cpp:124
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::NoFolder::CreateSub
Instruction * CreateSub(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
Definition: NoFolder.h:57
InstrTypes.h
llvm::FCmpInst
This instruction compares its operands according to the predicate given to the constructor.
Definition: Instructions.h:1344
llvm::CastInst::CreateFPCast
static CastInst * CreateFPCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts.
Definition: Instructions.cpp:3136
llvm::NoFolder::CreateBitCast
Instruction * CreateBitCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:245
llvm::Instruction::CastOps
CastOps
Definition: Instruction.h:782
llvm::NoFolder::CreateFDiv
Instruction * CreateFDiv(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:97
llvm::Instruction
Definition: Instruction.h:45
llvm::CastInst::CreateSExtOrBitCast
static CastInst * CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a SExt or BitCast cast instruction.
Definition: Instructions.cpp:3002
llvm::NoFolder::CreateInBoundsGetElementPtr
Instruction * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value * > IdxList) const override
Definition: NoFolder.h:213
llvm::CastInst::CreateTruncOrBitCast
static CastInst * CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a Trunc or BitCast cast instruction.
Definition: Instructions.cpp:3018
llvm::NoFolder::CreateNeg
Instruction * CreateNeg(Constant *C, bool HasNUW=false, bool HasNSW=false) const override
Definition: NoFolder.h:156
llvm::NoFolder
NoFolder - Create "constants" (actually, instructions) with no folding.
Definition: NoFolder.h:34
llvm::NoFolder::CreateShl
Instruction * CreateShl(Constant *LHS, Constant *RHS, bool HasNUW=false, bool HasNSW=false) const override
Definition: NoFolder.h:113
llvm::NoFolder::CreateXor
Instruction * CreateXor(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:143
llvm::NoFolder::CreateUDiv
Instruction * CreateUDiv(Constant *LHS, Constant *RHS, bool isExact=false) const override
Definition: NoFolder.h:83
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::NoFolder::CreatePointerBitCastOrAddrSpaceCast
Instruction * CreatePointerBitCastOrAddrSpaceCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:231
llvm::ICmpInst
This instruction compares its operands according to the predicate given to the constructor.
Definition: Instructions.h:1178
llvm::ExtractValueInst::Create
static ExtractValueInst * Create(Value *Agg, ArrayRef< unsigned > Idxs, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Definition: Instructions.h:2344
ArrayRef.h
IRBuilderFolder.h
llvm::NoFolder::CreatePointerCast
Instruction * CreatePointerCast(Constant *C, Type *DestTy) const override
Definition: NoFolder.h:227
llvm::GetElementPtrInst::Create
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value * > IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Definition: Instructions.h:931
llvm::NoFolder::CreateExtractValue
Instruction * CreateExtractValue(Constant *Agg, ArrayRef< unsigned > IdxList) const override
Definition: NoFolder.h:307
llvm::NoFolder::CreateGetElementPtr
Instruction * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Value * > IdxList) const override
Definition: NoFolder.h:195
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::BinaryOperator
Definition: InstrTypes.h:190
llvm::NoFolder::CreateInBoundsGetElementPtr
Constant * CreateInBoundsGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const override
Definition: NoFolder.h:205
llvm::NoFolder::CreateFMul
Instruction * CreateFMul(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:79
llvm::NoFolder::CreateAShr
Instruction * CreateAShr(Constant *LHS, Constant *RHS, bool isExact=false) const override
Definition: NoFolder.h:128
llvm::NoFolder::NoFolder
NoFolder()=default
llvm::NVPTX::PTXLdStInstCode::V2
@ V2
Definition: NVPTX.h:123
llvm::NoFolder::CreateICmp
Instruction * CreateICmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:273
llvm::NoFolder::CreateGetElementPtr
Constant * CreateGetElementPtr(Type *Ty, Constant *C, Constant *Idx) const override
Definition: NoFolder.h:187
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::NoFolder::CreateSelect
Instruction * CreateSelect(Constant *C, Constant *True, Constant *False) const override
Definition: NoFolder.h:287
llvm::NoFolder::CreateGetElementPtr
Constant * CreateGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList) const override
Definition: NoFolder.h:182
llvm::ConstantExpr::getGetElementPtr
static Constant * getGetElementPtr(Type *Ty, Constant *C, ArrayRef< Constant * > IdxList, bool InBounds=false, Optional< unsigned > InRangeIndex=None, Type *OnlyIfReducedTy=nullptr)
Getelementptr form.
Definition: Constants.h:1205
llvm::NoFolder::CreateFAdd
Instruction * CreateFAdd(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:53
llvm::Instruction::BinaryOps
BinaryOps
Definition: Instruction.h:768
llvm::ShuffleVectorInst
This instruction constructs a fixed permutation of two input vectors.
Definition: Instructions.h:1986
llvm::NoFolder::CreateExtractElement
Instruction * CreateExtractElement(Constant *Vec, Constant *Idx) const override
Definition: NoFolder.h:292
llvm::UnaryOperator::Create
static UnaryOperator * Create(UnaryOps Op, Value *S, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a unary instruction, given the opcode and an operand.
Definition: Instructions.cpp:2417
Instructions.h
CreateMul
static BinaryOperator * CreateMul(Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
Definition: Reassociate.cpp:246
llvm::NoFolder::CreateShuffleVector
Instruction * CreateShuffleVector(Constant *V1, Constant *V2, ArrayRef< int > Mask) const override
Definition: NoFolder.h:302
llvm::CastInst::CreatePointerCast
static CastInst * CreatePointerCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast AddrSpaceCast, or a PtrToInt cast instruction.
Definition: Instructions.cpp:3034
CreateAdd
static BinaryOperator * CreateAdd(Value *S1, Value *S2, const Twine &Name, Instruction *InsertBefore, Value *FlagsOp)
Definition: Reassociate.cpp:234
llvm::CastInst::CreateZExtOrBitCast
static CastInst * CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt or BitCast cast instruction.
Definition: Instructions.cpp:2986
llvm::NoFolder::CreateInsertElement
Instruction * CreateInsertElement(Constant *Vec, Constant *NewElt, Constant *Idx) const override
Definition: NoFolder.h:297
llvm::BinaryOperator::Create
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
Definition: Instructions.cpp:2546
llvm::NoFolder::CreateUnOp
Instruction * CreateUnOp(Instruction::UnaryOps Opc, Constant *C) const override
Definition: NoFolder.h:173
llvm::NoFolder::CreateURem
Instruction * CreateURem(Constant *LHS, Constant *RHS) const override
Definition: NoFolder.h:101
llvm::NoFolder::CreateNot
Instruction * CreateNot(Constant *C) const override
Definition: NoFolder.h:169