LLVM 19.0.0git
NVPTXAliasAnalysis.h
Go to the documentation of this file.
1//===-------------------- NVPTXAliasAnalysis.h ------------------*- 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 is the NVPTX address space based alias analysis pass.
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXALIASANALYSIS_H
13#define LLVM_LIB_TARGET_NVPTX_NVPTXALIASANALYSIS_H
14
16
17namespace llvm {
18
19class MemoryLocation;
20
22public:
25
26 /// Handle invalidation events from the new pass manager.
27 ///
28 /// By definition, this result is stateless and so remains valid.
31 return false;
32 }
33
34 AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB,
35 AAQueryInfo &AAQI, const Instruction *CtxI = nullptr);
36
38 bool IgnoreLocals);
39};
40
41/// Analysis pass providing a never-invalidated alias analysis result.
42class NVPTXAA : public AnalysisInfoMixin<NVPTXAA> {
44
45 static AnalysisKey Key;
46
47public:
49
51 return NVPTXAAResult();
52 }
53};
54
55/// Legacy wrapper pass to provide the NVPTXAAResult object.
57 std::unique_ptr<NVPTXAAResult> Result;
58
59public:
60 static char ID;
61
63
64 NVPTXAAResult &getResult() { return *Result; }
65 const NVPTXAAResult &getResult() const { return *Result; }
66
67 bool doInitialization(Module &M) override {
68 Result.reset(new NVPTXAAResult());
69 return false;
70 }
71
72 bool doFinalization(Module &M) override {
73 Result.reset();
74 return false;
75 }
76
77 void getAnalysisUsage(AnalysisUsage &AU) const override;
78};
79
80// Wrapper around ExternalAAWrapperPass so that the default
81// constructor gets the callback.
83public:
84 static char ID;
85
88 if (auto *WrapperPass =
89 P.getAnalysisIfAvailable<NVPTXAAWrapperPass>())
90 AAR.addAAResult(WrapperPass->getResult());
91 }) {}
92};
93
94ImmutablePass *createNVPTXAAWrapperPass();
98
99} // end namespace llvm
100
101#endif // LLVM_LIB_TARGET_NVPTX_NVPTXALIASANALYSIS_H
#define F(x, y, z)
Definition: MD5.cpp:55
#define P(N)
This class stores info we want to provide to or retain within an alias query.
A base class to help implement the function alias analysis results concept.
The possible results of an alias query.
Definition: AliasAnalysis.h:81
API to communicate dependencies between analyses during invalidation.
Definition: PassManager.h:387
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:348
Represent the analysis usage information of a pass.
ImmutablePass class - This class is used to provide information that does not need to be run.
Definition: Pass.h:282
Representation for a specific memory location.
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
NVPTXAAResult(NVPTXAAResult &&Arg)
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI=nullptr)
bool invalidate(Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation events from the new pass manager.
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
Legacy wrapper pass to provide the NVPTXAAResult object.
NVPTXAAResult & getResult()
const NVPTXAAResult & getResult() const
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
Analysis pass providing a never-invalidated alias analysis result.
NVPTXAAResult run(Function &F, AnalysisManager< Function > &AM)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
Definition: PassRegistry.h:37
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:94
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void initializeNVPTXExternalAAWrapperPass(PassRegistry &)
ImmutablePass * createNVPTXExternalAAWrapperPass()
void initializeNVPTXAAWrapperPassPass(PassRegistry &)
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
Definition: ModRef.h:27
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1858
ImmutablePass * createNVPTXAAWrapperPass()
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:114
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:26
A wrapper pass for external alias analyses.