LLVM 20.0.0git
Public Member Functions | List of all members
llvm::MemorySSA::CachingWalker Class Referencefinal

A MemorySSAWalker that does AA walks to disambiguate accesses. More...

Inheritance diagram for llvm::MemorySSA::CachingWalker:
Inheritance graph
[legend]

Public Member Functions

 CachingWalker (MemorySSA *M, ClobberWalkerBase *W)
 
 ~CachingWalker () override=default
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, BatchAAResults &BAA, unsigned &UWL)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, const MemoryLocation &Loc, BatchAAResults &BAA, unsigned &UWL)
 
MemoryAccessgetClobberingMemoryAccessWithoutInvariantGroup (MemoryAccess *MA, BatchAAResults &BAA, unsigned &UWL)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, BatchAAResults &BAA) override
 Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, const MemoryLocation &Loc, BatchAAResults &BAA) override
 Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).
 
void invalidateInfo (MemoryAccess *MA) override
 Given a memory access, invalidate anything this walker knows about that access.
 
MemoryAccessgetClobberingMemoryAccess (const Instruction *I, BatchAAResults &AA)
 Given a memory Mod/Ref/ModRef'ing instruction, calling this will give you the nearest dominating MemoryAccess that Mod's the location the instruction accesses (by skipping any def which AA can prove does not alias the location(s) accessed by the instruction given).
 
virtual MemoryAccessgetClobberingMemoryAccess (MemoryAccess *, BatchAAResults &AA)=0
 Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.
 
virtual MemoryAccessgetClobberingMemoryAccess (MemoryAccess *, const MemoryLocation &, BatchAAResults &AA)=0
 Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).
 
MemoryAccessgetClobberingMemoryAccess (const Instruction *I)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, const MemoryLocation &Loc)
 
- Public Member Functions inherited from llvm::MemorySSAWalker
 MemorySSAWalker (MemorySSA *)
 
virtual ~MemorySSAWalker ()=default
 
MemoryAccessgetClobberingMemoryAccess (const Instruction *I, BatchAAResults &AA)
 Given a memory Mod/Ref/ModRef'ing instruction, calling this will give you the nearest dominating MemoryAccess that Mod's the location the instruction accesses (by skipping any def which AA can prove does not alias the location(s) accessed by the instruction given).
 
virtual MemoryAccessgetClobberingMemoryAccess (MemoryAccess *, BatchAAResults &AA)=0
 Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.
 
virtual MemoryAccessgetClobberingMemoryAccess (MemoryAccess *, const MemoryLocation &, BatchAAResults &AA)=0
 Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).
 
MemoryAccessgetClobberingMemoryAccess (const Instruction *I)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA)
 
MemoryAccessgetClobberingMemoryAccess (MemoryAccess *MA, const MemoryLocation &Loc)
 
virtual void invalidateInfo (MemoryAccess *)
 Given a memory access, invalidate anything this walker knows about that access.
 

Additional Inherited Members

- Public Types inherited from llvm::MemorySSAWalker
using MemoryAccessSet = SmallVector< MemoryAccess *, 8 >
 
- Protected Attributes inherited from llvm::MemorySSAWalker
MemorySSAMSSA
 

Detailed Description

A MemorySSAWalker that does AA walks to disambiguate accesses.

It no longer does caching on its own, but the name has been retained for the moment.

Definition at line 1012 of file MemorySSA.cpp.

Constructor & Destructor Documentation

◆ CachingWalker()

llvm::MemorySSA::CachingWalker::CachingWalker ( MemorySSA M,
ClobberWalkerBase W 
)
inline

Definition at line 1016 of file MemorySSA.cpp.

◆ ~CachingWalker()

llvm::MemorySSA::CachingWalker::~CachingWalker ( )
overridedefault

Member Function Documentation

◆ getClobberingMemoryAccess() [1/10]

MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( const Instruction I)
inline

Definition at line 1068 of file MemorySSA.h.

◆ getClobberingMemoryAccess() [2/10]

MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( const Instruction I,
BatchAAResults AA 
)
inline

Given a memory Mod/Ref/ModRef'ing instruction, calling this will give you the nearest dominating MemoryAccess that Mod's the location the instruction accesses (by skipping any def which AA can prove does not alias the location(s) accessed by the instruction given).

Note that this will return a single access, and it must dominate the Instruction, so if an operand of a MemoryPhi node Mod's the instruction, this will return the MemoryPhi, not the operand. This means that given: if (a) { 1 = MemoryDef(liveOnEntry) store a } else { 2 = MemoryDef(liveOnEntry) store b } 3 = MemoryPhi(2, 1) MemoryUse(3) load a

calling this API on load(a) will return the MemoryPhi, not the MemoryDef in the if (a) branch.

Definition at line 1041 of file MemorySSA.h.

◆ getClobberingMemoryAccess() [3/10]

virtual MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( MemoryAccess ,
BatchAAResults AA 
)
virtual

Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.

Implements llvm::MemorySSAWalker.

◆ getClobberingMemoryAccess() [4/10]

virtual MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( MemoryAccess ,
const MemoryLocation ,
BatchAAResults AA 
)
virtual

Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).

This version of the function is mainly used to disambiguate phi translated pointers, where the value of a pointer may have changed from the initial memory access. Note that this expects to be handed either a MemoryUse, or an already potentially clobbering access. Unlike the above API, if given a MemoryDef that clobbers the pointer as the starting access, it will return that MemoryDef, whereas the above would return the clobber starting from the use side of the memory def.

Implements llvm::MemorySSAWalker.

◆ getClobberingMemoryAccess() [5/10]

MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( MemoryAccess MA)
inline

Definition at line 1073 of file MemorySSA.h.

◆ getClobberingMemoryAccess() [6/10]

MemoryAccess * llvm::MemorySSA::CachingWalker::getClobberingMemoryAccess ( MemoryAccess ,
BatchAAResults AA 
)
inlineoverridevirtual

Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.

Implements llvm::MemorySSAWalker.

Definition at line 1037 of file MemorySSA.cpp.

References getClobberingMemoryAccess(), and MaxCheckLimit().

◆ getClobberingMemoryAccess() [7/10]

MemoryAccess * llvm::MemorySSA::CachingWalker::getClobberingMemoryAccess ( MemoryAccess MA,
BatchAAResults BAA,
unsigned UWL 
)
inline

Definition at line 1022 of file MemorySSA.cpp.

Referenced by getClobberingMemoryAccess().

◆ getClobberingMemoryAccess() [8/10]

MemoryAccess * llvm::MemorySSAWalker::getClobberingMemoryAccess ( MemoryAccess MA,
const MemoryLocation Loc 
)
inline

Definition at line 1078 of file MemorySSA.h.

◆ getClobberingMemoryAccess() [9/10]

MemoryAccess * llvm::MemorySSA::CachingWalker::getClobberingMemoryAccess ( MemoryAccess ,
const MemoryLocation ,
BatchAAResults AA 
)
inlineoverridevirtual

Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).

This version of the function is mainly used to disambiguate phi translated pointers, where the value of a pointer may have changed from the initial memory access. Note that this expects to be handed either a MemoryUse, or an already potentially clobbering access. Unlike the above API, if given a MemoryDef that clobbers the pointer as the starting access, it will return that MemoryDef, whereas the above would return the clobber starting from the use side of the memory def.

Implements llvm::MemorySSAWalker.

Definition at line 1042 of file MemorySSA.cpp.

References getClobberingMemoryAccess(), and MaxCheckLimit().

◆ getClobberingMemoryAccess() [10/10]

MemoryAccess * llvm::MemorySSA::CachingWalker::getClobberingMemoryAccess ( MemoryAccess MA,
const MemoryLocation Loc,
BatchAAResults BAA,
unsigned UWL 
)
inline

Definition at line 1026 of file MemorySSA.cpp.

◆ getClobberingMemoryAccessWithoutInvariantGroup()

MemoryAccess * llvm::MemorySSA::CachingWalker::getClobberingMemoryAccessWithoutInvariantGroup ( MemoryAccess MA,
BatchAAResults BAA,
unsigned UWL 
)
inline

Definition at line 1032 of file MemorySSA.cpp.

◆ invalidateInfo()

void llvm::MemorySSA::CachingWalker::invalidateInfo ( MemoryAccess )
inlineoverridevirtual

Given a memory access, invalidate anything this walker knows about that access.

This API is used by walkers that store information to perform basic cache invalidation. This will be called by MemorySSA at appropriate times for the walker it uses or returns.

Reimplemented from llvm::MemorySSAWalker.

Definition at line 1049 of file MemorySSA.cpp.


The documentation for this class was generated from the following file: