LLVM  4.0.0
Utils.h
Go to the documentation of this file.
1 //==-- llvm/CodeGen/GlobalISel/Utils.h ---------------------------*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file This file declares the API of helper functions used throughout the
11 /// GlobalISel pipeline.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CODEGEN_GLOBALISEL_UTILS_H
16 #define LLVM_CODEGEN_GLOBALISEL_UTILS_H
17 
18 namespace llvm {
19 
20 class MachineFunction;
21 class MachineInstr;
22 class MachineRegisterInfo;
23 class MCInstrDesc;
24 class RegisterBankInfo;
25 class TargetInstrInfo;
26 class TargetRegisterInfo;
27 
28 /// Try to constrain Reg so that it is usable by argument OpIdx of the
29 /// provided MCInstrDesc \p II. If this fails, create a new virtual
30 /// register in the correct class and insert a COPY before \p InsertPt.
31 /// The debug location of \p InsertPt is used for the new copy.
32 ///
33 /// \return The virtual register constrained to the right register class.
34 unsigned constrainOperandRegClass(const MachineFunction &MF,
35  const TargetRegisterInfo &TRI,
36  MachineRegisterInfo &MRI,
37  const TargetInstrInfo &TII,
38  const RegisterBankInfo &RBI,
39  MachineInstr &InsertPt, const MCInstrDesc &II,
40  unsigned Reg, unsigned OpIdx);
41 
42 } // End namespace llvm.
43 #endif
unsigned constrainOperandRegClass(const MachineFunction &MF, const TargetRegisterInfo &TRI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, const MCInstrDesc &II, unsigned Reg, unsigned OpIdx)
Try to constrain Reg so that it is usable by argument OpIdx of the provided MCInstrDesc II...
const HexagonInstrInfo * TII
Reg
All possible values of the reg field in the ModR/M byte.
unsigned const MachineRegisterInfo * MRI
RegisterBankInfo(RegisterBank **RegBanks, unsigned NumRegBanks)
Create a RegisterBankInfo that can accomodate up to NumRegBanks RegisterBank instances.