LLVM  17.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 #include "DXILResource.h"
14 #include "llvm/IR/PassManager.h"
15 #include "llvm/Pass.h"
16 #include <memory>
17 
18 namespace llvm {
19 /// Analysis pass that exposes the \c DXILResource for a module.
20 class DXILResourceAnalysis : public AnalysisInfoMixin<DXILResourceAnalysis> {
22  static AnalysisKey Key;
23 
24 public:
27 };
28 
29 /// Printer pass for the \c DXILResourceAnalysis results.
30 class DXILResourcePrinterPass : public PassInfoMixin<DXILResourcePrinterPass> {
31  raw_ostream &OS;
32 
33 public:
34  explicit DXILResourcePrinterPass(raw_ostream &OS) : OS(OS) {}
36 };
37 
38 /// The legacy pass manager's analysis pass to compute DXIL resource
39 /// information.
41  dxil::Resources Resources;
42 
43 public:
44  static char ID; // Pass identification, replacement for typeid
45 
47 
48  dxil::Resources &getDXILResource() { return Resources; }
49  const dxil::Resources &getDXILResource() const { return Resources; }
50 
51  /// Calculate the DXILResource for the module.
52  bool runOnModule(Module &M) override;
53 
54  void print(raw_ostream &O, const Module *M = nullptr) const override;
55 };
56 } // namespace llvm
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::ModulePass
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:248
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
Pass.h
llvm::DXILResourceWrapper
The legacy pass manager's analysis pass to compute DXIL resource information.
Definition: DXILResourceAnalysis.h:40
llvm::DXILResourceAnalysis::Result
dxil::Resources Result
Definition: DXILResourceAnalysis.h:25
llvm::DXILResourcePrinterPass
Printer pass for the DXILResourceAnalysis results.
Definition: DXILResourceAnalysis.h:30
llvm::DXILResourceWrapper::runOnModule
bool runOnModule(Module &M) override
Calculate the DXILResource for the module.
Definition: DXILResourceAnalysis.cpp:43
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
llvm::DXILResourceWrapper::getDXILResource
const dxil::Resources & getDXILResource() const
Definition: DXILResourceAnalysis.h:49
llvm::DXILResourceWrapper::DXILResourceWrapper
DXILResourceWrapper()
Definition: DXILResourceAnalysis.cpp:48
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:274
llvm::AnalysisKey
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: PassManager.h:69
llvm::DXILResourceWrapper::ID
static char ID
Definition: DXILResourceAnalysis.h:44
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::AnalysisInfoMixin
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:394
llvm::dxil::Resources
Definition: DXILResource.h:136
llvm::DXILResourceAnalysis
Analysis pass that exposes the DXILResource for a module.
Definition: DXILResourceAnalysis.h:20
llvm::DXILResourceWrapper::print
void print(raw_ostream &O, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
Definition: DXILResourceAnalysis.cpp:50
PassManager.h
llvm::DXILResourcePrinterPass::DXILResourcePrinterPass
DXILResourcePrinterPass(raw_ostream &OS)
Definition: DXILResourceAnalysis.h:34
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::DXILResourceAnalysis::run
dxil::Resources run(Module &M, ModuleAnalysisManager &AM)
Definition: DXILResourceAnalysis.cpp:21
llvm::DXILResourceWrapper::getDXILResource
dxil::Resources & getDXILResource()
Definition: DXILResourceAnalysis.h:48
llvm::DXILResourcePrinterPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: DXILResourceAnalysis.cpp:30
DXILResource.h