[SampleProfileLoader] Fix integer overflow in generateMDProfMetadata (#90217)
[llvm-project.git] / llvm / lib / Target / SPIRV / SPIRVLegalizerInfo.h
blobf18b15b7f16964b62ee92d0791a54fe02f24ad21
1 //===- SPIRVLegalizerInfo.h --- SPIR-V Legalization Rules --------*- 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 // This file declares the targeting of the MachineLegalizer class for SPIR-V.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H
14 #define LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H
16 #include "SPIRVGlobalRegistry.h"
17 #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
19 bool isTypeFoldingSupported(unsigned Opcode);
21 namespace llvm {
23 class LLVMContext;
24 class SPIRVSubtarget;
26 // This class provides the information for legalizing SPIR-V instructions.
27 class SPIRVLegalizerInfo : public LegalizerInfo {
28 const SPIRVSubtarget *ST;
29 SPIRVGlobalRegistry *GR;
31 public:
32 bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI,
33 LostDebugLocObserver &LocObserver) const override;
34 SPIRVLegalizerInfo(const SPIRVSubtarget &ST);
36 } // namespace llvm
37 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H