LLVM  13.0.0git
InstVisitor.h
Go to the documentation of this file.
1 //===- InstVisitor.h - Instruction visitor templates ------------*- 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 
10 #ifndef LLVM_IR_INSTVISITOR_H
11 #define LLVM_IR_INSTVISITOR_H
12 
13 #include "llvm/IR/Function.h"
14 #include "llvm/IR/Instructions.h"
15 #include "llvm/IR/IntrinsicInst.h"
16 #include "llvm/IR/Intrinsics.h"
17 #include "llvm/IR/Module.h"
19 
20 namespace llvm {
21 
22 // We operate on opaque instruction classes, so forward declare all instruction
23 // types now...
24 //
25 #define HANDLE_INST(NUM, OPCODE, CLASS) class CLASS;
26 #include "llvm/IR/Instruction.def"
27 
28 #define DELEGATE(CLASS_TO_VISIT) \
29  return static_cast<SubClass*>(this)-> \
30  visit##CLASS_TO_VISIT(static_cast<CLASS_TO_VISIT&>(I))
31 
32 
33 /// Base class for instruction visitors
34 ///
35 /// Instruction visitors are used when you want to perform different actions
36 /// for different kinds of instructions without having to use lots of casts
37 /// and a big switch statement (in your code, that is).
38 ///
39 /// To define your own visitor, inherit from this class, specifying your
40 /// new type for the 'SubClass' template parameter, and "override" visitXXX
41 /// functions in your class. I say "override" because this class is defined
42 /// in terms of statically resolved overloading, not virtual functions.
43 ///
44 /// For example, here is a visitor that counts the number of malloc
45 /// instructions processed:
46 ///
47 /// /// Declare the class. Note that we derive from InstVisitor instantiated
48 /// /// with _our new subclasses_ type.
49 /// ///
50 /// struct CountAllocaVisitor : public InstVisitor<CountAllocaVisitor> {
51 /// unsigned Count;
52 /// CountAllocaVisitor() : Count(0) {}
53 ///
54 /// void visitAllocaInst(AllocaInst &AI) { ++Count; }
55 /// };
56 ///
57 /// And this class would be used like this:
58 /// CountAllocaVisitor CAV;
59 /// CAV.visit(function);
60 /// NumAllocas = CAV.Count;
61 ///
62 /// The defined has 'visit' methods for Instruction, and also for BasicBlock,
63 /// Function, and Module, which recursively process all contained instructions.
64 ///
65 /// Note that if you don't implement visitXXX for some instruction type,
66 /// the visitXXX method for instruction superclass will be invoked. So
67 /// if instructions are added in the future, they will be automatically
68 /// supported, if you handle one of their superclasses.
69 ///
70 /// The optional second template argument specifies the type that instruction
71 /// visitation functions should return. If you specify this, you *MUST* provide
72 /// an implementation of visitInstruction though!.
73 ///
74 /// Note that this class is specifically designed as a template to avoid
75 /// virtual function call overhead. Defining and using an InstVisitor is just
76 /// as efficient as having your own switch statement over the instruction
77 /// opcode.
78 template<typename SubClass, typename RetTy=void>
79 class InstVisitor {
80  //===--------------------------------------------------------------------===//
81  // Interface code - This is the public interface of the InstVisitor that you
82  // use to visit instructions...
83  //
84 
85 public:
86  // Generic visit method - Allow visitation to all instructions in a range
87  template<class Iterator>
88  void visit(Iterator Start, Iterator End) {
89  while (Start != End)
90  static_cast<SubClass*>(this)->visit(*Start++);
91  }
92 
93  // Define visitors for functions and basic blocks...
94  //
95  void visit(Module &M) {
96  static_cast<SubClass*>(this)->visitModule(M);
97  visit(M.begin(), M.end());
98  }
99  void visit(Function &F) {
100  static_cast<SubClass*>(this)->visitFunction(F);
101  visit(F.begin(), F.end());
102  }
103  void visit(BasicBlock &BB) {
104  static_cast<SubClass*>(this)->visitBasicBlock(BB);
105  visit(BB.begin(), BB.end());
106  }
107 
108  // Forwarding functions so that the user can visit with pointers AND refs.
109  void visit(Module *M) { visit(*M); }
110  void visit(Function *F) { visit(*F); }
111  void visit(BasicBlock *BB) { visit(*BB); }
112  RetTy visit(Instruction *I) { return visit(*I); }
113 
114  // visit - Finally, code to visit an instruction...
115  //
116  RetTy visit(Instruction &I) {
117  static_assert(std::is_base_of<InstVisitor, SubClass>::value,
118  "Must pass the derived type to this template!");
119 
120  switch (I.getOpcode()) {
121  default: llvm_unreachable("Unknown instruction type encountered!");
122  // Build the switch statement using the Instruction.def file...
123 #define HANDLE_INST(NUM, OPCODE, CLASS) \
124  case Instruction::OPCODE: return \
125  static_cast<SubClass*>(this)-> \
126  visit##OPCODE(static_cast<CLASS&>(I));
127 #include "llvm/IR/Instruction.def"
128  }
129  }
130 
131  //===--------------------------------------------------------------------===//
132  // Visitation functions... these functions provide default fallbacks in case
133  // the user does not specify what to do for a particular instruction type.
134  // The default behavior is to generalize the instruction type to its subtype
135  // and try visiting the subtype. All of this should be inlined perfectly,
136  // because there are no virtual functions to get in the way.
137  //
138 
139  // When visiting a module, function or basic block directly, these methods get
140  // called to indicate when transitioning into a new unit.
141  //
142  void visitModule (Module &M) {}
145 
146  // Define instruction specific visitor functions that can be overridden to
147  // handle SPECIFIC instructions. These functions automatically define
148  // visitMul to proxy to visitBinaryOperator for instance in case the user does
149  // not need this generality.
150  //
151  // These functions can also implement fan-out, when a single opcode and
152  // instruction have multiple more specific Instruction subclasses. The Call
153  // instruction currently supports this. We implement that by redirecting that
154  // instruction to a special delegation helper.
155 #define HANDLE_INST(NUM, OPCODE, CLASS) \
156  RetTy visit##OPCODE(CLASS &I) { \
157  if (NUM == Instruction::Call) \
158  return delegateCallInst(I); \
159  else \
160  DELEGATE(CLASS); \
161  }
162 #include "llvm/IR/Instruction.def"
163 
164  // Specific Instruction type classes... note that all of the casts are
165  // necessary because we use the instruction classes as opaque types...
166  //
202 
203  // Handle the special instrinsic instruction classes.
222 
223  // While terminators don't have a distinct type modeling them, we support
224  // intercepting them with dedicated a visitor callback.
226  return static_cast<SubClass *>(this)->visitTerminator(I);
227  }
229  return static_cast<SubClass *>(this)->visitTerminator(I);
230  }
232  return static_cast<SubClass *>(this)->visitTerminator(I);
233  }
235  return static_cast<SubClass *>(this)->visitTerminator(I);
236  }
238  return static_cast<SubClass *>(this)->visitTerminator(I);
239  }
241  return static_cast<SubClass *>(this)->visitTerminator(I);
242  }
244  return static_cast<SubClass *>(this)->visitTerminator(I);
245  }
247  return static_cast<SubClass *>(this)->visitTerminator(I);
248  }
250  return static_cast<SubClass *>(this)->visitTerminator(I);
251  }
253 
254  // Next level propagators: If the user does not overload a specific
255  // instruction type, they can overload one of these to get the whole class
256  // of instructions...
257  //
263 
264  // The next level delegation for `CallBase` is slightly more complex in order
265  // to support visiting cases where the call is also a terminator.
267  if (isa<InvokeInst>(I) || isa<CallBrInst>(I))
268  return static_cast<SubClass *>(this)->visitTerminator(I);
269 
271  }
272 
273  // If the user wants a 'default' case, they can choose to override this
274  // function. If this function is not overloaded in the user's subclass, then
275  // this instruction just gets ignored.
276  //
277  // Note that you MUST override this function if your return type is not void.
278  //
279  void visitInstruction(Instruction &I) {} // Ignore unhandled instructions
280 
281 private:
282  // Special helper function to delegate to CallInst subclass visitors.
283  RetTy delegateCallInst(CallInst &I) {
284  if (const Function *F = I.getCalledFunction()) {
285  switch (F->getIntrinsicID()) {
286  default: DELEGATE(IntrinsicInst);
287  case Intrinsic::dbg_declare: DELEGATE(DbgDeclareInst);
288  case Intrinsic::dbg_value: DELEGATE(DbgValueInst);
289  case Intrinsic::dbg_label: DELEGATE(DbgLabelInst);
291  case Intrinsic::memmove: DELEGATE(MemMoveInst);
292  case Intrinsic::memset: DELEGATE(MemSetInst);
293  case Intrinsic::vastart: DELEGATE(VAStartInst);
294  case Intrinsic::vaend: DELEGATE(VAEndInst);
295  case Intrinsic::vacopy: DELEGATE(VACopyInst);
296  case Intrinsic::not_intrinsic: break;
297  }
298  }
299  DELEGATE(CallInst);
300  }
301 
302  // An overload that will never actually be called, it is used only from dead
303  // code in the dispatching from opcodes to instruction subclasses.
304  RetTy delegateCallInst(Instruction &I) {
305  llvm_unreachable("delegateCallInst called for non-CallInst");
306  }
307 };
308 
309 #undef DELEGATE
310 
311 } // End llvm namespace
312 
313 #endif
llvm::InstVisitor::visitInstruction
void visitInstruction(Instruction &I)
Definition: InstVisitor.h:279
llvm::InstVisitor::visitCastInst
RetTy visitCastInst(CastInst &I)
Definition: InstVisitor.h:258
llvm::InstVisitor::visitPtrToIntInst
RetTy visitPtrToIntInst(PtrToIntInst &I)
Definition: InstVisitor.h:186
llvm::InstVisitor::visitBranchInst
RetTy visitBranchInst(BranchInst &I)
Definition: InstVisitor.h:228
llvm
Definition: AllocatorList.h:23
llvm::InstVisitor::visitCleanupPadInst
RetTy visitCleanupPadInst(CleanupPadInst &I)
Definition: InstVisitor.h:199
llvm::InstVisitor::visitDbgLabelInst
RetTy visitDbgLabelInst(DbgLabelInst &I)
Definition: InstVisitor.h:208
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::InstVisitor::visitInsertValueInst
RetTy visitInsertValueInst(InsertValueInst &I)
Definition: InstVisitor.h:196
llvm::ReturnInst
Return a value (possibly void), from a function.
Definition: Instructions.h:2925
llvm::VAArgInst
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
Definition: Instructions.h:1810
llvm::InstVisitor::visit
void visit(Function &F)
Definition: InstVisitor.h:99
llvm::InstVisitor::visitVAStartInst
RetTy visitVAStartInst(VAStartInst &I)
Definition: InstVisitor.h:215
IntrinsicInst.h
llvm::InstVisitor::visitDbgValueInst
RetTy visitDbgValueInst(DbgValueInst &I)
Definition: InstVisitor.h:205
llvm::ExtractElementInst
This instruction extracts a single (scalar) element from a VectorType value.
Definition: Instructions.h:1850
llvm::MemTransferInst
This class wraps the llvm.memcpy/memmove intrinsics.
Definition: IntrinsicInst.h:871
llvm::Function
Definition: Function.h:61
llvm::InstVisitor::visitDbgVariableIntrinsic
RetTy visitDbgVariableIntrinsic(DbgVariableIntrinsic &I)
Definition: InstVisitor.h:206
llvm::InstVisitor::visitTruncInst
RetTy visitTruncInst(TruncInst &I)
Definition: InstVisitor.h:177
llvm::MemMoveInst
This class wraps the llvm.memmove intrinsic.
Definition: IntrinsicInst.h:902
llvm::BitCastInst
This class represents a no-op cast from one type to another.
Definition: Instructions.h:5138
llvm::LandingPadInst
The landingpad instruction holds all of the information necessary to generate correct exception handl...
Definition: Instructions.h:2824
llvm::InstVisitor::visitCatchSwitchInst
RetTy visitCatchSwitchInst(CatchSwitchInst &I)
Definition: InstVisitor.h:249
llvm::InstVisitor::visitVACopyInst
RetTy visitVACopyInst(VACopyInst &I)
Definition: InstVisitor.h:217
llvm::InstVisitor::visitIntrinsicInst
RetTy visitIntrinsicInst(IntrinsicInst &I)
Definition: InstVisitor.h:218
ErrorHandling.h
llvm::InstVisitor::visitUnaryOperator
RetTy visitUnaryOperator(UnaryOperator &I)
Definition: InstVisitor.h:259
llvm::InstVisitor::visitCallBase
RetTy visitCallBase(CallBase &I)
Definition: InstVisitor.h:266
llvm::InstVisitor::visitFuncletPadInst
RetTy visitFuncletPadInst(FuncletPadInst &I)
Definition: InstVisitor.h:198
llvm::InstVisitor::visitVAArgInst
RetTy visitVAArgInst(VAArgInst &I)
Definition: InstVisitor.h:191
llvm::InstVisitor::visitBitCastInst
RetTy visitBitCastInst(BitCastInst &I)
Definition: InstVisitor.h:188
Module.h
llvm::InstVisitor::visitTerminator
RetTy visitTerminator(Instruction &I)
Definition: InstVisitor.h:252
llvm::MemIntrinsic
This is the common base class for memset/memcpy/memmove.
Definition: IntrinsicInst.h:828
llvm::InstVisitor::visitDbgDeclareInst
RetTy visitDbgDeclareInst(DbgDeclareInst &I)
Definition: InstVisitor.h:204
llvm::FenceInst
An instruction for ordering other memory operations.
Definition: Instructions.h:444
llvm::InstVisitor::visitLandingPadInst
RetTy visitLandingPadInst(LandingPadInst &I)
Definition: InstVisitor.h:197
llvm::Intrinsic::not_intrinsic
@ not_intrinsic
Definition: Intrinsics.h:45
llvm::UnaryOperator
Definition: InstrTypes.h:103
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::InstVisitor::visitFPTruncInst
RetTy visitFPTruncInst(FPTruncInst &I)
Definition: InstVisitor.h:180
llvm::InstVisitor::visitInsertElementInst
RetTy visitInsertElementInst(InsertElementInst &I)
Definition: InstVisitor.h:193
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::VAStartInst
This represents the llvm.va_start intrinsic.
Definition: IntrinsicInst.h:1041
llvm::InstVisitor::visitZExtInst
RetTy visitZExtInst(ZExtInst &I)
Definition: InstVisitor.h:178
llvm::InstVisitor::visitShuffleVectorInst
RetTy visitShuffleVectorInst(ShuffleVectorInst &I)
Definition: InstVisitor.h:194
llvm::AddrSpaceCastInst
This class represents a conversion between pointers from one address space to another.
Definition: Instructions.h:5178
llvm::InstVisitor::visitMemCpyInst
RetTy visitMemCpyInst(MemCpyInst &I)
Definition: InstVisitor.h:211
llvm::DbgValueInst
This represents the llvm.dbg.value instruction.
Definition: IntrinsicInst.h:342
llvm::InstVisitor::visitICmpInst
RetTy visitICmpInst(ICmpInst &I)
Definition: InstVisitor.h:167
llvm::InstVisitor::visitMemIntrinsic
RetTy visitMemIntrinsic(MemIntrinsic &I)
Definition: InstVisitor.h:214
Intrinsics.h
llvm::InstVisitor::visitCatchPadInst
RetTy visitCatchPadInst(CatchPadInst &I)
Definition: InstVisitor.h:200
llvm::InstVisitor::visitIndirectBrInst
RetTy visitIndirectBrInst(IndirectBrInst &I)
Definition: InstVisitor.h:234
llvm::FCmpInst
This instruction compares its operands according to the predicate given to the constructor.
Definition: Instructions.h:1344
llvm::InstVisitor::visitGetElementPtrInst
RetTy visitGetElementPtrInst(GetElementPtrInst &I)
Definition: InstVisitor.h:175
llvm::InstVisitor::visitAtomicCmpXchgInst
RetTy visitAtomicCmpXchgInst(AtomicCmpXchgInst &I)
Definition: InstVisitor.h:172
llvm::InsertElementInst
This instruction inserts a single (scalar) element into a VectorType value.
Definition: Instructions.h:1914
llvm::Instruction
Definition: Instruction.h:45
llvm::InstVisitor::visitFPToSIInst
RetTy visitFPToSIInst(FPToSIInst &I)
Definition: InstVisitor.h:183
llvm::InstVisitor::visitLoadInst
RetTy visitLoadInst(LoadInst &I)
Definition: InstVisitor.h:170
llvm::InstVisitor::visitFPExtInst
RetTy visitFPExtInst(FPExtInst &I)
Definition: InstVisitor.h:181
llvm::InstVisitor::visitPHINode
RetTy visitPHINode(PHINode &I)
Definition: InstVisitor.h:176
llvm::DbgInfoIntrinsic
This is the common base class for debug info intrinsics.
Definition: IntrinsicInst.h:134
llvm::MemSetInst
This class wraps the llvm.memset intrinsic.
Definition: IntrinsicInst.h:859
llvm::UnaryInstruction
Definition: InstrTypes.h:57
llvm::InvokeInst
Invoke instruction.
Definition: Instructions.h:3688
llvm::CmpInst
This class is the base class for the comparison instructions.
Definition: InstrTypes.h:712
llvm::InstVisitor::visitCleanupReturnInst
RetTy visitCleanupReturnInst(CleanupReturnInst &I)
Definition: InstVisitor.h:243
llvm::InstVisitor::visitUnaryInstruction
RetTy visitUnaryInstruction(UnaryInstruction &I)
Definition: InstVisitor.h:262
llvm::DbgVariableIntrinsic
This is the common base class for debug info intrinsics for variables.
Definition: IntrinsicInst.h:148
llvm::CleanupPadInst
Definition: Instructions.h:4371
llvm::InstVisitor::visitSelectInst
RetTy visitSelectInst(SelectInst &I)
Definition: InstVisitor.h:190
llvm::StoreInst
An instruction for storing to memory.
Definition: Instructions.h:303
llvm::ICmpInst
This instruction compares its operands according to the predicate given to the constructor.
Definition: Instructions.h:1178
llvm::InstVisitor::visitSExtInst
RetTy visitSExtInst(SExtInst &I)
Definition: InstVisitor.h:179
llvm::FPToSIInst
This class represents a cast from floating point to signed integer.
Definition: Instructions.h:5005
llvm::CatchReturnInst
Definition: Instructions.h:4463
llvm::DbgDeclareInst
This represents the llvm.dbg.declare instruction.
Definition: IntrinsicInst.h:303
llvm::DbgLabelInst
This represents the llvm.dbg.label instruction.
Definition: IntrinsicInst.h:365
llvm::TruncInst
This class represents a truncation of integer types.
Definition: Instructions.h:4693
llvm::CallBrInst
CallBr instruction, tracking function calls that may not return control but instead transfer it to a ...
Definition: Instructions.h:3897
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::InstVisitor::visit
void visit(Module *M)
Definition: InstVisitor.h:109
llvm::GetElementPtrInst
an instruction for type-safe pointer arithmetic to access elements of arrays and structs
Definition: Instructions.h:905
llvm::InstVisitor::visitFreezeInst
RetTy visitFreezeInst(FreezeInst &I)
Definition: InstVisitor.h:201
llvm::InstVisitor::visit
void visit(Iterator Start, Iterator End)
Definition: InstVisitor.h:88
llvm::InstVisitor::visitUIToFPInst
RetTy visitUIToFPInst(UIToFPInst &I)
Definition: InstVisitor.h:184
llvm::InstVisitor::visitFPToUIInst
RetTy visitFPToUIInst(FPToUIInst &I)
Definition: InstVisitor.h:182
llvm::InstVisitor::visit
void visit(BasicBlock &BB)
Definition: InstVisitor.h:103
memcpy
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
llvm::InstVisitor::visitAddrSpaceCastInst
RetTy visitAddrSpaceCastInst(AddrSpaceCastInst &I)
Definition: InstVisitor.h:189
llvm::InstVisitor::visitFenceInst
RetTy visitFenceInst(FenceInst &I)
Definition: InstVisitor.h:174
llvm::SelectInst
This class represents the LLVM 'select' instruction.
Definition: Instructions.h:1715
llvm::FPToUIInst
This class represents a cast from floating point to unsigned integer.
Definition: Instructions.h:4966
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::InstVisitor::visitFCmpInst
RetTy visitFCmpInst(FCmpInst &I)
Definition: InstVisitor.h:168
llvm::InstVisitor::visitStoreInst
RetTy visitStoreInst(StoreInst &I)
Definition: InstVisitor.h:171
llvm::ZExtInst
This class represents zero extension of integer types.
Definition: Instructions.h:4732
llvm::InstVisitor::visitModule
void visitModule(Module &M)
Definition: InstVisitor.h:142
llvm::InstVisitor::visitReturnInst
RetTy visitReturnInst(ReturnInst &I)
Definition: InstVisitor.h:225
llvm::VAEndInst
This represents the llvm.va_end intrinsic.
Definition: IntrinsicInst.h:1054
llvm::BinaryOperator
Definition: InstrTypes.h:190
llvm::InstVisitor::visitAtomicRMWInst
RetTy visitAtomicRMWInst(AtomicRMWInst &I)
Definition: InstVisitor.h:173
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::PtrToIntInst
This class represents a cast from a pointer to an integer.
Definition: Instructions.h:5087
llvm::InstVisitor
Base class for instruction visitors.
Definition: InstVisitor.h:79
llvm::FPExtInst
This class represents an extension of floating point types.
Definition: Instructions.h:4849
llvm::CastInst
This is the base class for all instructions that perform data casts.
Definition: InstrTypes.h:432
llvm::InstVisitor::visit
void visit(BasicBlock *BB)
Definition: InstVisitor.h:111
llvm::SExtInst
This class represents a sign extension of integer types.
Definition: Instructions.h:4771
llvm::LoadInst
An instruction for reading from memory.
Definition: Instructions.h:174
llvm::InstVisitor::visitAllocaInst
RetTy visitAllocaInst(AllocaInst &I)
Definition: InstVisitor.h:169
llvm::AtomicRMWInst
an instruction that atomically reads a memory location, combines it with another value,...
Definition: Instructions.h:702
llvm::InstVisitor::visitBinaryOperator
RetTy visitBinaryOperator(BinaryOperator &I)
Definition: InstVisitor.h:260
llvm::InstVisitor::visitFunction
void visitFunction(Function &F)
Definition: InstVisitor.h:143
llvm::ResumeInst
Resume the propagation of an exception.
Definition: Instructions.h:4138
llvm::InstVisitor::visitInvokeInst
RetTy visitInvokeInst(InvokeInst &I)
Definition: InstVisitor.h:220
llvm::InstVisitor::visitBasicBlock
void visitBasicBlock(BasicBlock &BB)
Definition: InstVisitor.h:144
DELEGATE
#define DELEGATE(CLASS_TO_VISIT)
Definition: InstVisitor.h:28
llvm::InstVisitor::visitMemSetInst
RetTy visitMemSetInst(MemSetInst &I)
Definition: InstVisitor.h:210
llvm::VACopyInst
This represents the llvm.va_copy intrinsic.
Definition: IntrinsicInst.h:1067
llvm::InstVisitor::visitResumeInst
RetTy visitResumeInst(ResumeInst &I)
Definition: InstVisitor.h:237
llvm::ExtractValueInst
This instruction extracts a struct member or array element value from an aggregate value.
Definition: Instructions.h:2318
llvm::InstVisitor::visit
void visit(Module &M)
Definition: InstVisitor.h:95
llvm::InstVisitor::visitCallBrInst
RetTy visitCallBrInst(CallBrInst &I)
Definition: InstVisitor.h:221
Function.h
llvm::InstVisitor::visit
void visit(Function *F)
Definition: InstVisitor.h:110
llvm::InstVisitor::visitUnreachableInst
RetTy visitUnreachableInst(UnreachableInst &I)
Definition: InstVisitor.h:240
llvm::UIToFPInst
This class represents a cast unsigned integer to floating point.
Definition: Instructions.h:4888
llvm::CleanupReturnInst
Definition: Instructions.h:4544
llvm::IntToPtrInst
This class represents a cast from an integer to a pointer.
Definition: Instructions.h:5044
llvm::IndirectBrInst
Indirect Branch Instruction.
Definition: Instructions.h:3553
llvm::IntrinsicInst
A wrapper class for inspecting calls to intrinsic functions.
Definition: IntrinsicInst.h:45
llvm::InstVisitor::visit
RetTy visit(Instruction *I)
Definition: InstVisitor.h:112
llvm::InstVisitor::visitCmpInst
RetTy visitCmpInst(CmpInst &I)
Definition: InstVisitor.h:261
llvm::CatchPadInst
Definition: Instructions.h:4412
llvm::ShuffleVectorInst
This instruction constructs a fixed permutation of two input vectors.
Definition: Instructions.h:1986
Instructions.h
llvm::MemCpyInst
This class wraps the llvm.memcpy intrinsic.
Definition: IntrinsicInst.h:890
llvm::FuncletPadInst
Definition: InstrTypes.h:2287
llvm::SIToFPInst
This class represents a cast from signed integer to floating point.
Definition: Instructions.h:4927
llvm::FreezeInst
This class represents a freeze function that returns random concrete value if an operand is either a ...
Definition: Instructions.h:5289
llvm::FPTruncInst
This class represents a truncation of floating point types.
Definition: Instructions.h:4810
llvm::InstVisitor::visitCallInst
RetTy visitCallInst(CallInst &I)
Definition: InstVisitor.h:219
llvm::InstVisitor::visitSwitchInst
RetTy visitSwitchInst(SwitchInst &I)
Definition: InstVisitor.h:231
llvm::PHINode
Definition: Instructions.h:2572
llvm::InstVisitor::visitExtractValueInst
RetTy visitExtractValueInst(ExtractValueInst &I)
Definition: InstVisitor.h:195
llvm::CallBase
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1164
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1450
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::UnreachableInst
This function has undefined behavior.
Definition: Instructions.h:4652
llvm::InstVisitor::visitMemTransferInst
RetTy visitMemTransferInst(MemTransferInst &I)
Definition: InstVisitor.h:213
llvm::SwitchInst
Multiway switch.
Definition: Instructions.h:3151
llvm::AllocaInst
an instruction to allocate memory on the stack
Definition: Instructions.h:61
llvm::InstVisitor::visitDbgInfoIntrinsic
RetTy visitDbgInfoIntrinsic(DbgInfoIntrinsic &I)
Definition: InstVisitor.h:209
llvm::BranchInst
Conditional or Unconditional Branch instruction.
Definition: Instructions.h:3007
llvm::InstVisitor::visitSIToFPInst
RetTy visitSIToFPInst(SIToFPInst &I)
Definition: InstVisitor.h:185
llvm::InsertValueInst
This instruction inserts a struct field of array element value into an aggregate value.
Definition: Instructions.h:2429
llvm::CatchSwitchInst
Definition: Instructions.h:4195
llvm::InstVisitor::visit
RetTy visit(Instruction &I)
Definition: InstVisitor.h:116
llvm::InstVisitor::visitVAEndInst
RetTy visitVAEndInst(VAEndInst &I)
Definition: InstVisitor.h:216
llvm::AtomicCmpXchgInst
An instruction that atomically checks whether a specified value is in a memory location,...
Definition: Instructions.h:522
llvm::InstVisitor::visitExtractElementInst
RetTy visitExtractElementInst(ExtractElementInst &I)
Definition: InstVisitor.h:192
llvm::InstVisitor::visitCatchReturnInst
RetTy visitCatchReturnInst(CatchReturnInst &I)
Definition: InstVisitor.h:246
llvm::InstVisitor::visitIntToPtrInst
RetTy visitIntToPtrInst(IntToPtrInst &I)
Definition: InstVisitor.h:187
llvm::InstVisitor::visitMemMoveInst
RetTy visitMemMoveInst(MemMoveInst &I)
Definition: InstVisitor.h:212