Path: blob/main/contrib/llvm-project/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.h
35294 views
//===-- RISCVLegalizerInfo.h ------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7/// \file8/// This file declares the targeting of the Machinelegalizer class for RISC-V.9/// \todo This should be generated by TableGen.10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_RISCV_RISCVMACHINELEGALIZER_H13#define LLVM_LIB_TARGET_RISCV_RISCVMACHINELEGALIZER_H1415#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"16#include "llvm/CodeGen/Register.h"1718namespace llvm {1920class GISelChangeObserver;21class MachineIRBuilder;22class RISCVSubtarget;2324class RISCVLegalizerInfo : public LegalizerInfo {25const RISCVSubtarget &STI;26const unsigned XLen;27const LLT sXLen;2829public:30RISCVLegalizerInfo(const RISCVSubtarget &ST);3132bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI,33LostDebugLocObserver &LocObserver) const override;3435bool legalizeIntrinsic(LegalizerHelper &Helper,36MachineInstr &MI) const override;3738private:39bool shouldBeInConstantPool(APInt APImm, bool ShouldOptForSize) const;40bool legalizeShlAshrLshr(MachineInstr &MI, MachineIRBuilder &MIRBuilder,41GISelChangeObserver &Observer) const;4243bool legalizeVAStart(MachineInstr &MI, MachineIRBuilder &MIRBuilder) const;44bool legalizeVScale(MachineInstr &MI, MachineIRBuilder &MIB) const;45bool legalizeExt(MachineInstr &MI, MachineIRBuilder &MIRBuilder) const;46bool legalizeSplatVector(MachineInstr &MI, MachineIRBuilder &MIB) const;47};48} // end namespace llvm49#endif505152