Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / AMDGPU / AMDGPUSplitModule.h
blobd814dedd6f0c40f968c26c286c0a42d9f902ede0
1 //===- AMDGPUSplitModule.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 //
9 //===----------------------------------------------------------------------===//
11 #ifndef LLVM_TARGET_AMDGPUSPLITMODULE_H
12 #define LLVM_TARGET_AMDGPUSPLITMODULE_H
14 #include "llvm/ADT/STLFunctionalExtras.h"
15 #include "llvm/IR/PassManager.h"
16 #include <memory>
18 namespace llvm {
20 /// Splits the module M into N linkable partitions. The function ModuleCallback
21 /// is called N times passing each individual partition as the MPart argument.
22 class AMDGPUSplitModulePass : public PassInfoMixin<AMDGPUSplitModulePass> {
23 public:
24 using ModuleCreationCallback =
25 function_ref<void(std::unique_ptr<Module> MPart)>;
27 AMDGPUSplitModulePass(unsigned N, ModuleCreationCallback ModuleCallback)
28 : N(N), ModuleCallback(ModuleCallback) {}
30 PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
32 private:
33 unsigned N;
34 ModuleCreationCallback ModuleCallback;
37 } // end namespace llvm
39 #endif // LLVM_TARGET_AMDGPUSPLITMODULE_H