Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / DirectX / DXILResourceAnalysis.cpp
blob0b2f0d827ebbc9de3fee694c2d79667f735625d7
1 //===- DXILResourceAnalysis.cpp - 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 //===----------------------------------------------------------------------===//
13 #include "DXILResourceAnalysis.h"
14 #include "DirectX.h"
15 #include "llvm/IR/PassManager.h"
17 using namespace llvm;
19 #define DEBUG_TYPE "dxil-resource-analysis"
21 dxil::Resources DXILResourceAnalysis::run(Module &M,
22 ModuleAnalysisManager &AM) {
23 dxil::Resources R;
24 R.collect(M);
25 return R;
28 AnalysisKey DXILResourceAnalysis::Key;
30 PreservedAnalyses DXILResourcePrinterPass::run(Module &M,
31 ModuleAnalysisManager &AM) {
32 dxil::Resources Res = AM.getResult<DXILResourceAnalysis>(M);
33 Res.print(OS);
34 return PreservedAnalyses::all();
37 char DXILResourceWrapper::ID = 0;
38 INITIALIZE_PASS_BEGIN(DXILResourceWrapper, DEBUG_TYPE,
39 "DXIL resource Information", true, true)
40 INITIALIZE_PASS_END(DXILResourceWrapper, DEBUG_TYPE,
41 "DXIL resource Information", true, true)
43 bool DXILResourceWrapper::runOnModule(Module &M) {
44 Resources.collect(M);
45 return false;
48 DXILResourceWrapper::DXILResourceWrapper() : ModulePass(ID) {}
50 void DXILResourceWrapper::print(raw_ostream &OS, const Module *) const {
51 Resources.print(OS);