181ad6265SDimitry Andric //===- SPIRVLegalizerInfo.h --- SPIR-V Legalization Rules --------*- C++ -*-==// 281ad6265SDimitry Andric // 381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 681ad6265SDimitry Andric // 781ad6265SDimitry Andric //===----------------------------------------------------------------------===// 881ad6265SDimitry Andric // 981ad6265SDimitry Andric // This file declares the targeting of the MachineLegalizer class for SPIR-V. 1081ad6265SDimitry Andric // 1181ad6265SDimitry Andric //===----------------------------------------------------------------------===// 1281ad6265SDimitry Andric 1381ad6265SDimitry Andric #ifndef LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H 1481ad6265SDimitry Andric #define LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H 1581ad6265SDimitry Andric 1681ad6265SDimitry Andric #include "SPIRVGlobalRegistry.h" 1781ad6265SDimitry Andric #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h" 1881ad6265SDimitry Andric 1981ad6265SDimitry Andric bool isTypeFoldingSupported(unsigned Opcode); 2081ad6265SDimitry Andric 2181ad6265SDimitry Andric namespace llvm { 2281ad6265SDimitry Andric 2381ad6265SDimitry Andric class LLVMContext; 2481ad6265SDimitry Andric class SPIRVSubtarget; 2581ad6265SDimitry Andric 2681ad6265SDimitry Andric // This class provides the information for legalizing SPIR-V instructions. 2781ad6265SDimitry Andric class SPIRVLegalizerInfo : public LegalizerInfo { 2881ad6265SDimitry Andric const SPIRVSubtarget *ST; 2981ad6265SDimitry Andric SPIRVGlobalRegistry *GR; 3081ad6265SDimitry Andric 3181ad6265SDimitry Andric public: 32*1db9f3b2SDimitry Andric bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI, 33*1db9f3b2SDimitry Andric LostDebugLocObserver &LocObserver) const override; 3481ad6265SDimitry Andric SPIRVLegalizerInfo(const SPIRVSubtarget &ST); 3581ad6265SDimitry Andric }; 3681ad6265SDimitry Andric } // namespace llvm 3781ad6265SDimitry Andric #endif // LLVM_LIB_TARGET_SPIRV_SPIRVMACHINELEGALIZER_H 38