LLVM  13.0.0git
GVN.h
Go to the documentation of this file.
1 //===- GVN.h - Eliminate redundant values and loads -------------*- 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 /// \file
9 /// This file provides the interface for LLVM's Global Value Numbering pass
10 /// which eliminates fully redundant instructions. It also does somewhat Ad-Hoc
11 /// PRE and dead load elimination.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_TRANSFORMS_SCALAR_GVN_H
16 #define LLVM_TRANSFORMS_SCALAR_GVN_H
17 
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/MapVector.h"
21 #include "llvm/ADT/SetVector.h"
22 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/IR/Dominators.h"
25 #include "llvm/IR/InstrTypes.h"
26 #include "llvm/IR/PassManager.h"
27 #include "llvm/IR/ValueHandle.h"
28 #include "llvm/Support/Allocator.h"
29 #include "llvm/Support/Compiler.h"
30 #include <cstdint>
31 #include <utility>
32 #include <vector>
33 
34 namespace llvm {
35 
36 class AAResults;
37 class AssumeInst;
38 class AssumptionCache;
39 class BasicBlock;
40 class BranchInst;
41 class CallInst;
42 class Constant;
43 class ExtractValueInst;
44 class Function;
45 class FunctionPass;
46 class IntrinsicInst;
47 class LoadInst;
48 class LoopInfo;
49 class MemDepResult;
50 class MemoryDependenceResults;
51 class MemorySSA;
52 class MemorySSAUpdater;
53 class NonLocalDepResult;
54 class OptimizationRemarkEmitter;
55 class PHINode;
56 class TargetLibraryInfo;
57 class Value;
58 /// A private "module" namespace for types and utilities used by GVN. These
59 /// are implementation details and should not be used by clients.
60 namespace gvn LLVM_LIBRARY_VISIBILITY {
61 
62 struct AvailableValue;
63 struct AvailableValueInBlock;
64 class GVNLegacyPass;
65 
66 } // end namespace gvn
67 
68 /// A set of parameters to control various transforms performed by GVN pass.
69 // Each of the optional boolean parameters can be set to:
70 /// true - enabling the transformation.
71 /// false - disabling the transformation.
72 /// None - relying on a global default.
73 /// Intended use is to create a default object, modify parameters with
74 /// additional setters and then pass it to GVN.
75 struct GVNOptions {
81 
82  GVNOptions() = default;
83 
84  /// Enables or disables PRE in GVN.
85  GVNOptions &setPRE(bool PRE) {
86  AllowPRE = PRE;
87  return *this;
88  }
89 
90  /// Enables or disables PRE of loads in GVN.
91  GVNOptions &setLoadPRE(bool LoadPRE) {
92  AllowLoadPRE = LoadPRE;
93  return *this;
94  }
95 
96  GVNOptions &setLoadInLoopPRE(bool LoadInLoopPRE) {
97  AllowLoadInLoopPRE = LoadInLoopPRE;
98  return *this;
99  }
100 
101  /// Enables or disables PRE of loads in GVN.
102  GVNOptions &setLoadPRESplitBackedge(bool LoadPRESplitBackedge) {
103  AllowLoadPRESplitBackedge = LoadPRESplitBackedge;
104  return *this;
105  }
106 
107  /// Enables or disables use of MemDepAnalysis.
108  GVNOptions &setMemDep(bool MemDep) {
109  AllowMemDep = MemDep;
110  return *this;
111  }
112 };
113 
114 /// The core GVN pass object.
115 ///
116 /// FIXME: We should have a good summary of the GVN algorithm implemented by
117 /// this particular pass here.
118 class GVN : public PassInfoMixin<GVN> {
119  GVNOptions Options;
120 
121 public:
122  struct Expression;
123 
125 
126  /// Run the pass over the function.
127  PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
128 
129  /// This removes the specified instruction from
130  /// our various maps and marks it for deletion.
132  VN.erase(I);
133  InstrsToErase.push_back(I);
134  }
135 
136  DominatorTree &getDominatorTree() const { return *DT; }
137  AAResults *getAliasAnalysis() const { return VN.getAliasAnalysis(); }
138  MemoryDependenceResults &getMemDep() const { return *MD; }
139 
140  bool isPREEnabled() const;
141  bool isLoadPREEnabled() const;
142  bool isLoadInLoopPREEnabled() const;
143  bool isLoadPRESplitBackedgeEnabled() const;
144  bool isMemDepEnabled() const;
145 
146  /// This class holds the mapping between values and value numbers. It is used
147  /// as an efficient mechanism to determine the expression-wise equivalence of
148  /// two values.
149  class ValueTable {
150  DenseMap<Value *, uint32_t> valueNumbering;
151  DenseMap<Expression, uint32_t> expressionNumbering;
152 
153  // Expressions is the vector of Expression. ExprIdx is the mapping from
154  // value number to the index of Expression in Expressions. We use it
155  // instead of a DenseMap because filling such mapping is faster than
156  // filling a DenseMap and the compile time is a little better.
157  uint32_t nextExprNumber = 0;
158 
159  std::vector<Expression> Expressions;
160  std::vector<uint32_t> ExprIdx;
161 
162  // Value number to PHINode mapping. Used for phi-translate in scalarpre.
163  DenseMap<uint32_t, PHINode *> NumberingPhi;
164 
165  // Cache for phi-translate in scalarpre.
166  using PhiTranslateMap =
168  PhiTranslateMap PhiTranslateTable;
169 
170  AAResults *AA = nullptr;
171  MemoryDependenceResults *MD = nullptr;
172  DominatorTree *DT = nullptr;
173 
174  uint32_t nextValueNumber = 1;
175 
176  Expression createExpr(Instruction *I);
177  Expression createCmpExpr(unsigned Opcode, CmpInst::Predicate Predicate,
178  Value *LHS, Value *RHS);
179  Expression createExtractvalueExpr(ExtractValueInst *EI);
180  uint32_t lookupOrAddCall(CallInst *C);
181  uint32_t phiTranslateImpl(const BasicBlock *BB, const BasicBlock *PhiBlock,
182  uint32_t Num, GVN &Gvn);
183  bool areCallValsEqual(uint32_t Num, uint32_t NewNum, const BasicBlock *Pred,
184  const BasicBlock *PhiBlock, GVN &Gvn);
185  std::pair<uint32_t, bool> assignExpNewValueNum(Expression &exp);
186  bool areAllValsInBB(uint32_t num, const BasicBlock *BB, GVN &Gvn);
187 
188  public:
189  ValueTable();
190  ValueTable(const ValueTable &Arg);
192  ~ValueTable();
194 
196  uint32_t lookup(Value *V, bool Verify = true) const;
197  uint32_t lookupOrAddCmp(unsigned Opcode, CmpInst::Predicate Pred,
198  Value *LHS, Value *RHS);
199  uint32_t phiTranslate(const BasicBlock *BB, const BasicBlock *PhiBlock,
200  uint32_t Num, GVN &Gvn);
201  void eraseTranslateCacheEntry(uint32_t Num, const BasicBlock &CurrBlock);
202  bool exists(Value *V) const;
203  void add(Value *V, uint32_t num);
204  void clear();
205  void erase(Value *v);
206  void setAliasAnalysis(AAResults *A) { AA = A; }
207  AAResults *getAliasAnalysis() const { return AA; }
209  void setDomTree(DominatorTree *D) { DT = D; }
210  uint32_t getNextUnusedValueNumber() { return nextValueNumber; }
211  void verifyRemoved(const Value *) const;
212  };
213 
214 private:
215  friend class gvn::GVNLegacyPass;
216  friend struct DenseMapInfo<Expression>;
217 
218  MemoryDependenceResults *MD = nullptr;
219  DominatorTree *DT = nullptr;
220  const TargetLibraryInfo *TLI = nullptr;
221  AssumptionCache *AC = nullptr;
222  SetVector<BasicBlock *> DeadBlocks;
223  OptimizationRemarkEmitter *ORE = nullptr;
224  ImplicitControlFlowTracking *ICF = nullptr;
225  LoopInfo *LI = nullptr;
226  MemorySSAUpdater *MSSAU = nullptr;
227 
228  ValueTable VN;
229 
230  /// A mapping from value numbers to lists of Value*'s that
231  /// have that value number. Use findLeader to query it.
232  struct LeaderTableEntry {
233  Value *Val;
234  const BasicBlock *BB;
235  LeaderTableEntry *Next;
236  };
238  BumpPtrAllocator TableAllocator;
239 
240  // Block-local map of equivalent values to their leader, does not
241  // propagate to any successors. Entries added mid-block are applied
242  // to the remaining instructions in the block.
243  SmallMapVector<Value *, Value *, 4> ReplaceOperandsWithMap;
244  SmallVector<Instruction *, 8> InstrsToErase;
245 
246  // Map the block to reversed postorder traversal number. It is used to
247  // find back edge easily.
249 
250  // This is set 'true' initially and also when new blocks have been added to
251  // the function being analyzed. This boolean is used to control the updating
252  // of BlockRPONumber prior to accessing the contents of BlockRPONumber.
253  bool InvalidBlockRPONumbers = true;
254 
255  using LoadDepVect = SmallVector<NonLocalDepResult, 64>;
256  using AvailValInBlkVect = SmallVector<gvn::AvailableValueInBlock, 64>;
257  using UnavailBlkVect = SmallVector<BasicBlock *, 64>;
258 
259  bool runImpl(Function &F, AssumptionCache &RunAC, DominatorTree &RunDT,
260  const TargetLibraryInfo &RunTLI, AAResults &RunAA,
261  MemoryDependenceResults *RunMD, LoopInfo *LI,
262  OptimizationRemarkEmitter *ORE, MemorySSA *MSSA = nullptr);
263 
264  /// Push a new Value to the LeaderTable onto the list for its value number.
265  void addToLeaderTable(uint32_t N, Value *V, const BasicBlock *BB) {
266  LeaderTableEntry &Curr = LeaderTable[N];
267  if (!Curr.Val) {
268  Curr.Val = V;
269  Curr.BB = BB;
270  return;
271  }
272 
273  LeaderTableEntry *Node = TableAllocator.Allocate<LeaderTableEntry>();
274  Node->Val = V;
275  Node->BB = BB;
276  Node->Next = Curr.Next;
277  Curr.Next = Node;
278  }
279 
280  /// Scan the list of values corresponding to a given
281  /// value number, and remove the given instruction if encountered.
282  void removeFromLeaderTable(uint32_t N, Instruction *I, BasicBlock *BB) {
283  LeaderTableEntry *Prev = nullptr;
284  LeaderTableEntry *Curr = &LeaderTable[N];
285 
286  while (Curr && (Curr->Val != I || Curr->BB != BB)) {
287  Prev = Curr;
288  Curr = Curr->Next;
289  }
290 
291  if (!Curr)
292  return;
293 
294  if (Prev) {
295  Prev->Next = Curr->Next;
296  } else {
297  if (!Curr->Next) {
298  Curr->Val = nullptr;
299  Curr->BB = nullptr;
300  } else {
301  LeaderTableEntry *Next = Curr->Next;
302  Curr->Val = Next->Val;
303  Curr->BB = Next->BB;
304  Curr->Next = Next->Next;
305  }
306  }
307  }
308 
309  // List of critical edges to be split between iterations.
310  SmallVector<std::pair<Instruction *, unsigned>, 4> toSplit;
311 
312  // Helper functions of redundant load elimination
313  bool processLoad(LoadInst *L);
314  bool processNonLocalLoad(LoadInst *L);
315  bool processAssumeIntrinsic(AssumeInst *II);
316 
317  /// Given a local dependency (Def or Clobber) determine if a value is
318  /// available for the load. Returns true if an value is known to be
319  /// available and populates Res. Returns false otherwise.
320  bool AnalyzeLoadAvailability(LoadInst *Load, MemDepResult DepInfo,
321  Value *Address, gvn::AvailableValue &Res);
322 
323  /// Given a list of non-local dependencies, determine if a value is
324  /// available for the load in each specified block. If it is, add it to
325  /// ValuesPerBlock. If not, add it to UnavailableBlocks.
326  void AnalyzeLoadAvailability(LoadInst *Load, LoadDepVect &Deps,
327  AvailValInBlkVect &ValuesPerBlock,
328  UnavailBlkVect &UnavailableBlocks);
329 
330  bool PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
331  UnavailBlkVect &UnavailableBlocks);
332 
333  /// Try to replace a load which executes on each loop iteraiton with Phi
334  /// translation of load in preheader and load(s) in conditionally executed
335  /// paths.
336  bool performLoopLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
337  UnavailBlkVect &UnavailableBlocks);
338 
339  /// Eliminates partially redundant \p Load, replacing it with \p
340  /// AvailableLoads (connected by Phis if needed).
341  void eliminatePartiallyRedundantLoad(
342  LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
343  MapVector<BasicBlock *, Value *> &AvailableLoads);
344 
345  // Other helper routines
346  bool processInstruction(Instruction *I);
347  bool processBlock(BasicBlock *BB);
348  void dump(DenseMap<uint32_t, Value *> &d) const;
349  bool iterateOnFunction(Function &F);
350  bool performPRE(Function &F);
351  bool performScalarPRE(Instruction *I);
352  bool performScalarPREInsertion(Instruction *Instr, BasicBlock *Pred,
353  BasicBlock *Curr, unsigned int ValNo);
354  Value *findLeader(const BasicBlock *BB, uint32_t num);
355  void cleanupGlobalSets();
356  void verifyRemoved(const Instruction *I) const;
357  bool splitCriticalEdges();
358  BasicBlock *splitCriticalEdges(BasicBlock *Pred, BasicBlock *Succ);
359  bool replaceOperandsForInBlockEquality(Instruction *I) const;
360  bool propagateEquality(Value *LHS, Value *RHS, const BasicBlockEdge &Root,
361  bool DominatesByEdge);
362  bool processFoldableCondBr(BranchInst *BI);
363  void addDeadBlock(BasicBlock *BB);
364  void assignValNumForDeadCode();
365  void assignBlockRPONumber(Function &F);
366 };
367 
368 /// Create a legacy GVN pass. This also allows parameterizing whether or not
369 /// MemDep is enabled.
370 FunctionPass *createGVNPass(bool NoMemDepAnalysis = false);
371 
372 /// A simple and fast domtree-based GVN pass to hoist common expressions
373 /// from sibling branches.
374 struct GVNHoistPass : PassInfoMixin<GVNHoistPass> {
375  /// Run the pass over the function.
377 };
378 
379 /// Uses an "inverted" value numbering to decide the similarity of
380 /// expressions and sinks similar expressions into successors.
381 struct GVNSinkPass : PassInfoMixin<GVNSinkPass> {
382  /// Run the pass over the function.
384 };
385 
386 } // end namespace llvm
387 
388 #endif // LLVM_TRANSFORMS_SCALAR_GVN_H
llvm::GVNOptions
A set of parameters to control various transforms performed by GVN pass.
Definition: GVN.h:75
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm::GVN::ValueTable::setAliasAnalysis
void setAliasAnalysis(AAResults *A)
Definition: GVN.h:206
llvm::ImplicitControlFlowTracking
This class allows to keep track on instructions with implicit control flow.
Definition: InstructionPrecedenceTracking.h:99
llvm
Definition: AllocatorList.h:23
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::CmpInst::Predicate
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:722
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::GVNHoistPass
A simple and fast domtree-based GVN pass to hoist common expressions from sibling branches.
Definition: GVN.h:374
llvm::Function
Definition: Function.h:61
llvm::GVN::getAliasAnalysis
AAResults * getAliasAnalysis() const
Definition: GVN.h:137
llvm::GVN::ValueTable::getAliasAnalysis
AAResults * getAliasAnalysis() const
Definition: GVN.h:207
llvm::GVN::ValueTable::verifyRemoved
void verifyRemoved(const Value *) const
verifyRemoved - Verify that the value is removed from all internal data structures.
Definition: GVN.cpp:628
llvm::SmallVector< Instruction *, 8 >
llvm::GVNOptions::AllowLoadInLoopPRE
Optional< bool > AllowLoadInLoopPRE
Definition: GVN.h:78
MapVector.h
Allocator.h
llvm::GVN::ValueTable::setMemDep
void setMemDep(MemoryDependenceResults *M)
Definition: GVN.h:208
llvm::DominatorTree
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition: Dominators.h:151
llvm::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
DenseMap.h
llvm::GVNOptions::setLoadInLoopPRE
GVNOptions & setLoadInLoopPRE(bool LoadInLoopPRE)
Definition: GVN.h:96
llvm::GVN::isMemDepEnabled
bool isMemDepEnabled() const
Definition: GVN.cpp:656
llvm::Optional< bool >
llvm::GVN::ValueTable
This class holds the mapping between values and value numbers.
Definition: GVN.h:149
llvm::createGVNPass
FunctionPass * createGVNPass(bool NoMemDepAnalysis=false)
Create a legacy GVN pass.
Definition: GVN.cpp:3098
llvm::GVN::ValueTable::lookupOrAddCmp
uint32_t lookupOrAddCmp(unsigned Opcode, CmpInst::Predicate Pred, Value *LHS, Value *RHS)
Returns the value number of the given comparison, assigning it a new number if it did not have one be...
Definition: GVN.cpp:598
llvm::GVN::ValueTable::setDomTree
void setDomTree(DominatorTree *D)
Definition: GVN.h:209
llvm::gvn::GVNLegacyPass
Definition: GVN.cpp:3036
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:206
llvm::DenseMapInfo
Definition: APInt.h:34
llvm::BumpPtrAllocatorImpl::Allocate
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
Definition: Allocator.h:145
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:69
llvm::AAResults
Definition: AliasAnalysis.h:456
llvm::GVNOptions::setLoadPRESplitBackedge
GVNOptions & setLoadPRESplitBackedge(bool LoadPRESplitBackedge)
Enables or disables PRE of loads in GVN.
Definition: GVN.h:102
llvm::GVN::ValueTable::phiTranslate
uint32_t phiTranslate(const BasicBlock *BB, const BasicBlock *PhiBlock, uint32_t Num, GVN &Gvn)
Wrap phiTranslateImpl to provide caching functionality.
Definition: GVN.cpp:1964
llvm::GVN::Expression
Definition: GVN.cpp:130
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::GVNOptions::setMemDep
GVNOptions & setMemDep(bool MemDep)
Enables or disables use of MemDepAnalysis.
Definition: GVN.h:108
InstrTypes.h
llvm::GVN::isLoadInLoopPREEnabled
bool isLoadInLoopPREEnabled() const
Definition: GVN.cpp:647
llvm::GVN::ValueTable::lookup
uint32_t lookup(Value *V, bool Verify=true) const
Returns the value number of the specified value.
Definition: GVN.cpp:585
llvm::GVNSinkPass
Uses an "inverted" value numbering to decide the similarity of expressions and sinks similar expressi...
Definition: GVN.h:381
llvm::Instruction
Definition: Instruction.h:45
Options
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
Definition: PassBuilderBindings.cpp:48
llvm::GVN::getDominatorTree
DominatorTree & getDominatorTree() const
Definition: GVN.h:136
llvm::None
const NoneType None
Definition: None.h:23
llvm::GVN::GVN
GVN(GVNOptions Options={})
Definition: GVN.h:124
llvm::SmallMapVector
A MapVector that performs no allocations if smaller than a certain size.
Definition: MapVector.h:232
llvm::PPC::Predicate
Predicate
Predicate - These are "(BI << 5) | BO" for various predicates.
Definition: PPCPredicates.h:26
Verify
ppc ctr loops PowerPC CTR Loops Verify
Definition: PPCCTRLoops.cpp:77
llvm::GVN
The core GVN pass object.
Definition: GVN.h:118
llvm::GVN::ValueTable::add
void add(Value *V, uint32_t num)
add - Insert a value into the table with a specified value number.
Definition: GVN.cpp:393
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::MemorySSAUpdater
Definition: MemorySSAUpdater.h:56
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
llvm::DenseMap
Definition: DenseMap.h:714
llvm::MemorySSA
Encapsulates MemorySSA, including all data associated with memory accesses.
Definition: MemorySSA.h:704
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::GVN::ValueTable::eraseTranslateCacheEntry
void eraseTranslateCacheEntry(uint32_t Num, const BasicBlock &CurrBlock)
Erase stale entry from phiTranslate cache so phiTranslate can be computed again.
Definition: GVN.cpp:2067
llvm::GVN::isPREEnabled
bool isPREEnabled() const
Definition: GVN.cpp:639
llvm::GVN::ValueTable::operator=
ValueTable & operator=(const ValueTable &Arg)
llvm::GVN::markInstructionForDeletion
void markInstructionForDeletion(Instruction *I)
This removes the specified instruction from our various maps and marks it for deletion.
Definition: GVN.h:131
llvm::GVN::ValueTable::exists
bool exists(Value *V) const
Returns true if a value number exists for the specified value.
Definition: GVN.cpp:504
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:64
llvm::GVN::ValueTable::ValueTable
ValueTable()
llvm::GVN::isLoadPREEnabled
bool isLoadPREEnabled() const
Definition: GVN.cpp:643
llvm::LoopInfo
Definition: LoopInfo.h:1080
llvm::OptimizationRemarkEmitter
The optimization diagnostic interface.
Definition: OptimizationRemarkEmitter.h:33
llvm::AssumptionCache
A cache of @llvm.assume calls within a function.
Definition: AssumptionCache.h:41
llvm::GVN::ValueTable::erase
void erase(Value *v)
Remove a value from the value numbering.
Definition: GVN.cpp:618
llvm::GVNOptions::AllowPRE
Optional< bool > AllowPRE
Definition: GVN.h:76
uint32_t
Compiler.h
llvm::GVNOptions::AllowLoadPRE
Optional< bool > AllowLoadPRE
Definition: GVN.h:77
LLVM_LIBRARY_VISIBILITY
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library,...
Definition: Compiler.h:131
Node
Definition: ItaniumDemangle.h:114
ValueHandle.h
llvm::GVN::ValueTable::~ValueTable
~ValueTable()
llvm::MemoryDependenceResults
Provides a lazy, caching interface for making common memory aliasing information queries,...
Definition: MemoryDependenceAnalysis.h:264
llvm::ExtractValueInst
This instruction extracts a struct member or array element value from an aggregate value.
Definition: Instructions.h:2346
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
PassManager.h
llvm::TargetLibraryInfo
Provides information about what library functions are available for the current target.
Definition: TargetLibraryInfo.h:219
llvm::GVNOptions::setLoadPRE
GVNOptions & setLoadPRE(bool LoadPRE)
Enables or disables PRE of loads in GVN.
Definition: GVN.h:91
llvm::GVNSinkPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
Definition: GVNSink.cpp:911
llvm::GVNOptions::AllowLoadPRESplitBackedge
Optional< bool > AllowLoadPRESplitBackedge
Definition: GVN.h:79
llvm::GVNOptions::setPRE
GVNOptions & setPRE(bool PRE)
Enables or disables PRE in GVN.
Definition: GVN.h:85
InstructionPrecedenceTracking.h
llvm::GVNOptions::AllowMemDep
Optional< bool > AllowMemDep
Definition: GVN.h:80
llvm::GVN::getMemDep
MemoryDependenceResults & getMemDep() const
Definition: GVN.h:138
PostOrderIterator.h
llvm::GVN::isLoadPRESplitBackedgeEnabled
bool isLoadPRESplitBackedgeEnabled() const
Definition: GVN.cpp:651
SmallVector.h
llvm::GVN::ValueTable::getNextUnusedValueNumber
uint32_t getNextUnusedValueNumber()
Definition: GVN.h:210
llvm::GVN::ValueTable::lookupOrAdd
uint32_t lookupOrAdd(Value *V)
lookup_or_add - Returns the value number for the specified value, assigning it a new number if it did...
Definition: GVN.cpp:508
llvm::FunctionAnalysisManager
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
Definition: PassManager.h:907
Dominators.h
N
#define N
llvm::GVNHoistPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
Definition: GVNHoist.cpp:1233
llvm::GVN::ValueTable::clear
void clear()
Remove all entries from the ValueTable.
Definition: GVN.cpp:606
llvm::GVNOptions::GVNOptions
GVNOptions()=default
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::GVN::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
Definition: GVN.cpp:660
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1478
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
d
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int int d
Definition: README.txt:418
llvm::SetVector
A vector that has set insertion semantics.
Definition: SetVector.h:40
MemorySSA
early cse Early CSE w MemorySSA
Definition: EarlyCSE.cpp:1735
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::codeview::PublicSymFlags::Function
@ Function
SetVector.h