LLVM  8.0.1
Legalizer.h
Go to the documentation of this file.
1 //== llvm/CodeGen/GlobalISel/LegalizePass.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 A pass to convert the target-illegal operations created by IR -> MIR
11 /// translation into ones the target expects to be able to select. This may
12 /// occur in multiple phases, for example G_ADD <2 x i8> -> G_ADD <2 x i16> ->
13 /// G_ADD <4 x i16>.
14 ///
15 /// The LegalizeHelper class is where most of the work happens, and is designed
16 /// to be callable from other passes that find themselves with an illegal
17 /// instruction.
18 //
19 //===----------------------------------------------------------------------===//
20 
21 #ifndef LLVM_CODEGEN_GLOBALISEL_LEGALIZEMACHINEIRPASS_H
22 #define LLVM_CODEGEN_GLOBALISEL_LEGALIZEMACHINEIRPASS_H
23 
26 
27 namespace llvm {
28 
29 class MachineRegisterInfo;
30 
32 public:
33  static char ID;
34 
35 private:
36 
37  /// Initialize the field members using \p MF.
38  void init(MachineFunction &MF);
39 
40 public:
41  // Ctor, nothing fancy.
42  Legalizer();
43 
44  StringRef getPassName() const override { return "Legalizer"; }
45 
46  void getAnalysisUsage(AnalysisUsage &AU) const override;
47 
51  }
52 
56  }
57 
59  const TargetInstrInfo &TII);
60 
61  bool runOnMachineFunction(MachineFunction &MF) override;
62 };
63 } // End namespace llvm.
64 
65 #endif
StringRef getPassName() const override
getPassName - Return a nice clean name for a pass.
Definition: Legalizer.h:44
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
TargetInstrInfo - Interface to description of machine instruction set.
unsigned const MachineRegisterInfo * MRI
Represent the analysis usage information of a pass.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
Definition: Legalizer.cpp:127
MachineFunctionProperties getSetProperties() const override
Definition: Legalizer.h:53
This file declares the MachineIRBuilder class.
static char ID
Definition: Legalizer.h:33
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
MachineFunctionProperties & set(Property P)
Representation of each machine instruction.
Definition: MachineInstr.h:64
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition: Legalizer.cpp:57
bool combineExtracts(MachineInstr &MI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII)
MachineFunctionProperties getRequiredProperties() const override
Definition: Legalizer.h:48
IRTranslator LLVM IR MI
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Properties which a MachineFunction may have at a given point in time.