14#ifndef LLVM_ANALYSIS_IVUSERS_H
15#define LLVM_ANALYSIS_IVUSERS_H
40 :
CallbackVH(U), Parent(
P), OperandValToReplace(O) {
56 return OperandValToReplace;
62 OperandValToReplace =
Op;
73 void transformToPostInc(
const Loop *L);
89 void deleted()
override;
148 bool empty()
const {
return IVUses.empty(); }
151 return Processed.count(Inst);
167 std::unique_ptr<IVUsers> IU;
181 void releaseMemory()
override;
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This header provides classes for managing per-loop analyses.
print mir2vec MIR2Vec Vocabulary Printer Pass
Represent the analysis usage information of a pass.
A cache of @llvm.assume calls within a function.
CallbackVH(const CallbackVH &)=default
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
IVStrideUse - Keep track of one use of a strided induction variable.
Instruction * getUser() const
getUser - Return the user instruction for this use.
void setOperandValToReplace(Value *Op)
setOperandValToReplace - Assign a new Value as the operand value to replace.
const PostIncLoopSet & getPostIncLoops() const
getPostIncLoops - Return the set of loops for which the expression has been adjusted to use post-inc ...
Value * getOperandValToReplace() const
getOperandValToReplace - Return the Value of the operand in the user instruction that this IVStrideUs...
IVStrideUse(IVUsers *P, Instruction *U, Value *O)
void setUser(Instruction *NewUser)
setUser - Assign a new user instruction for this use.
Analysis pass that exposes the IVUsers for a loop.
LLVM_ABI IVUsers run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR)
const IVUsers & getIU() const
LLVM_ABI void dump() const
dump - This method is used for debugging.
ilist< IVStrideUse >::const_iterator const_iterator
bool isIVUserOrOperand(Instruction *Inst) const
LLVM_ABI IVStrideUse & AddUser(Instruction *User, Value *Operand)
LLVM_ABI IVUsers(Loop *L, AssumptionCache *AC, LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE)
LLVM_ABI void releaseMemory()
IVUsers & operator=(IVUsers &&)=delete
LLVM_ABI const SCEV * getStride(const IVStrideUse &IU, const Loop *L) const
IVUsers(const IVUsers &)=delete
LLVM_ABI const SCEV * getReplacementExpr(const IVStrideUse &IU) const
getReplacementExpr - Return a SCEV expression which computes the value of the OperandValToReplace of ...
bool isEphemeral(const Value *V) const
LLVM_ABI bool AddUsersIfInteresting(Instruction *I)
AddUsersIfInteresting - Inspect the specified Instruction.
const_iterator end() const
ilist< IVStrideUse >::iterator iterator
const_iterator begin() const
LLVM_ABI const SCEV * getExpr(const IVStrideUse &IU) const
getExpr - Return the expression for the use.
IVUsers & operator=(const IVUsers &)=delete
LLVM_ABI void print(raw_ostream &OS, const Module *=nullptr) const
Represents a single loop in the control flow graph.
A Module instance is used to store all the information related to an LLVM module.
This class represents an analyzed expression in the program.
The main scalar evolution driver.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Value * getValPtr() const
LLVM Value Representation.
Value handle that is nullable, but tries to track the Value.
typename base_list_type::iterator iterator
typename base_list_type::const_iterator const_iterator
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
iplist< T, Options... > ilist
DWARFExpression::Operation Op
LLVM_ABI Pass * createIVUsersPass()
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
SmallPtrSet< const Loop *, 2 > PostIncLoopSet
Implement std::hash so that hash_code can be used in STL containers.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...