LLVM 20.0.0git
DXILResourceAnalysis.h
Go to the documentation of this file.
1//===- DXILResourceAnalysis.h - DXIL Resource analysis-------------------===//
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/// \file This file contains Analysis for information about DXIL resources.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
14#define LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
15
16#include "DXILResource.h"
17#include "llvm/IR/PassManager.h"
18#include "llvm/Pass.h"
19#include <memory>
20
21namespace llvm {
22/// Analysis pass that exposes the \c DXILResource for a module.
24 : public AnalysisInfoMixin<DXILResourceMDAnalysis> {
26 static AnalysisKey Key;
27
28public:
31};
32
33/// The legacy pass manager's analysis pass to compute DXIL resource
34/// information.
36 dxil::Resources Resources;
37
38public:
39 static char ID; // Pass identification, replacement for typeid
40
42
43 dxil::Resources &getDXILResource() { return Resources; }
44 const dxil::Resources &getDXILResource() const { return Resources; }
45
46 /// Calculate the DXILResource for the module.
47 bool runOnModule(Module &M) override;
48
49 void getAnalysisUsage(AnalysisUsage &AU) const override {
50 AU.setPreservesAll();
51 }
52};
53} // namespace llvm
54
55#endif // LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
Analysis pass that exposes the DXILResource for a module.
dxil::Resources run(Module &M, ModuleAnalysisManager &AM)
The legacy pass manager's analysis pass to compute DXIL resource information.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
dxil::Resources & getDXILResource()
const dxil::Resources & getDXILResource() const
bool runOnModule(Module &M) override
Calculate the DXILResource for the module.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:251
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:92
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:28