FastISel.h revision 3df24e667f04a7003342b534310919abc9c87418
1b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//===-- FastISel.h - Definition of the FastISel class ---------------------===//
2b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//
3b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//                     The LLVM Compiler Infrastructure
4b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//
5b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman// This file is distributed under the University of Illinois Open Source
6b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman// License. See LICENSE.TXT for details.
7b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//
8b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//===----------------------------------------------------------------------===//
9b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//
10b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman// This file defines the FastISel class.
11b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//
12b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman//===----------------------------------------------------------------------===//
13b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
14b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#ifndef LLVM_CODEGEN_FASTISEL_H
15b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#define LLVM_CODEGEN_FASTISEL_H
16b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
17b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#include "llvm/BasicBlock.h"
18b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#include "llvm/ADT/DenseMap.h"
19b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#include "llvm/CodeGen/SelectionDAGNodes.h"
20b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
21b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmannamespace llvm {
22b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
2310df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohmanclass ConstantFP;
24b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanclass MachineBasicBlock;
25b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanclass MachineFunction;
26bb466331e7e50d03497ce40ee344870236fd9c32Dan Gohmanclass MachineRegisterInfo;
2783785c80968165b30fcdd111ceb2c28d38bcff86Evan Chengclass TargetData;
28b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanclass TargetInstrInfo;
2983785c80968165b30fcdd111ceb2c28d38bcff86Evan Chengclass TargetLowering;
3022bb31103de3337f0bb74c7bee16d1817d4dca14Dan Gohmanclass TargetMachine;
31b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanclass TargetRegisterClass;
32b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
3340610241d00e219341ff4b7106c5baff08ad407bDan Gohman/// FastISel - This is a fast-path instruction selection class that
3440610241d00e219341ff4b7106c5baff08ad407bDan Gohman/// generates poor code and doesn't support illegal types or non-trivial
3540610241d00e219341ff4b7106c5baff08ad407bDan Gohman/// lowering, but runs quickly.
36b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanclass FastISel {
3722bb31103de3337f0bb74c7bee16d1817d4dca14Dan Gohmanprotected:
38b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  MachineBasicBlock *MBB;
393df24e667f04a7003342b534310919abc9c87418Dan Gohman  DenseMap<const Value *, unsigned> &ValueMap;
403df24e667f04a7003342b534310919abc9c87418Dan Gohman  DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap;
41bb466331e7e50d03497ce40ee344870236fd9c32Dan Gohman  MachineFunction &MF;
42bb466331e7e50d03497ce40ee344870236fd9c32Dan Gohman  MachineRegisterInfo &MRI;
4322bb31103de3337f0bb74c7bee16d1817d4dca14Dan Gohman  const TargetMachine &TM;
4483785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  const TargetData &TD;
45bb466331e7e50d03497ce40ee344870236fd9c32Dan Gohman  const TargetInstrInfo &TII;
4622bb31103de3337f0bb74c7bee16d1817d4dca14Dan Gohman  const TargetLowering &TLI;
47b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
48b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanpublic:
493df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// setCurrentBlock - Set the current block, to which generated
503df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// machine instructions will be appended.
513df24e667f04a7003342b534310919abc9c87418Dan Gohman  ///
523df24e667f04a7003342b534310919abc9c87418Dan Gohman  void setCurrentBlock(MachineBasicBlock *mbb) {
533df24e667f04a7003342b534310919abc9c87418Dan Gohman    MBB = mbb;
543df24e667f04a7003342b534310919abc9c87418Dan Gohman  }
553df24e667f04a7003342b534310919abc9c87418Dan Gohman
563df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// SelectInstruction - Do "fast" instruction selection for the given
573df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// LLVM IR instruction, and append generated machine instructions to
583df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// the current block. Return true if selection was successful.
593df24e667f04a7003342b534310919abc9c87418Dan Gohman  ///
603df24e667f04a7003342b534310919abc9c87418Dan Gohman  bool SelectInstruction(Instruction *I);
61b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
6299b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  /// TargetSelectInstruction - This method is called by target-independent
6399b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  /// code when the normal FastISel process fails to select an instruction.
6499b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  /// This gives targets a chance to emit code for anything that doesn't
6599b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  /// fit into FastISel's framework. It returns true if it was successful.
6699b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  ///
6799b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman  virtual bool
683df24e667f04a7003342b534310919abc9c87418Dan Gohman  TargetSelectInstruction(Instruction *I) = 0;
693df24e667f04a7003342b534310919abc9c87418Dan Gohman
703df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// getRegForValue - Create a virtual register and arrange for it to
713df24e667f04a7003342b534310919abc9c87418Dan Gohman  /// be assigned the value for the given LLVM value.
723df24e667f04a7003342b534310919abc9c87418Dan Gohman  unsigned getRegForValue(Value *V);
7399b218218c0ca3ebfdd568ddfeafa07842e9d69dDan Gohman
74cc8430f742b0f1e567292c8a776e94fc1c930b2aDan Gohman  virtual ~FastISel();
75cc8430f742b0f1e567292c8a776e94fc1c930b2aDan Gohman
76b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohmanprotected:
773df24e667f04a7003342b534310919abc9c87418Dan Gohman  FastISel(MachineFunction &mf,
783df24e667f04a7003342b534310919abc9c87418Dan Gohman           DenseMap<const Value *, unsigned> &vm,
793df24e667f04a7003342b534310919abc9c87418Dan Gohman           DenseMap<const BasicBlock *, MachineBasicBlock *> &bm);
80e285a74f7cf9dd3ccf4fe758576cf83301f8a43eDan Gohman
81bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// FastEmit_r - This method is called by target-independent code
82bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// to request that an instruction with the given type and opcode
83bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// be emitted.
84b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  virtual unsigned FastEmit_(MVT::SimpleValueType VT,
850f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                             MVT::SimpleValueType RetVT,
86b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                             ISD::NodeType Opcode);
87bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
88bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// FastEmit_r - This method is called by target-independent code
89bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// to request that an instruction with the given type, opcode, and
90bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// register operand be emitted.
91bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  ///
92b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  virtual unsigned FastEmit_r(MVT::SimpleValueType VT,
930f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                              MVT::SimpleValueType RetVT,
94b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                              ISD::NodeType Opcode, unsigned Op0);
95bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
96bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// FastEmit_rr - This method is called by target-independent code
97bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// to request that an instruction with the given type, opcode, and
98bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// register operands be emitted.
99bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  ///
100b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  virtual unsigned FastEmit_rr(MVT::SimpleValueType VT,
1010f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                               MVT::SimpleValueType RetVT,
102b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                               ISD::NodeType Opcode,
103b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                               unsigned Op0, unsigned Op1);
104b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
10583785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// FastEmit_ri - This method is called by target-independent code
10683785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// to request that an instruction with the given type, opcode, and
10783785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// register and immediate operands be emitted.
10883785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  ///
10983785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  virtual unsigned FastEmit_ri(MVT::SimpleValueType VT,
1100f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                               MVT::SimpleValueType RetVT,
11183785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng                               ISD::NodeType Opcode,
112d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                               unsigned Op0, uint64_t Imm);
113d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman
11410df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// FastEmit_rf - This method is called by target-independent code
11510df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// to request that an instruction with the given type, opcode, and
11610df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// register and floating-point immediate operands be emitted.
11710df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  ///
11810df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  virtual unsigned FastEmit_rf(MVT::SimpleValueType VT,
11910df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                               MVT::SimpleValueType RetVT,
12010df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                               ISD::NodeType Opcode,
12110df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                               unsigned Op0, ConstantFP *FPImm);
12210df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman
123d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// FastEmit_rri - This method is called by target-independent code
124d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// to request that an instruction with the given type, opcode, and
125d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// register and immediate operands be emitted.
126d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  ///
127d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  virtual unsigned FastEmit_rri(MVT::SimpleValueType VT,
1280f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                                MVT::SimpleValueType RetVT,
129d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                                ISD::NodeType Opcode,
130d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                                unsigned Op0, unsigned Op1, uint64_t Imm);
13183785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng
13283785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// FastEmit_ri_ - This method is a wrapper of FastEmit_ri. It first tries
13383785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// to emit an instruction with an immediate operand using FastEmit_ri.
13483785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// If that fails, it materializes the immediate into a register and try
13583785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  /// FastEmit_rr instead.
13683785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng  unsigned FastEmit_ri_(MVT::SimpleValueType VT,
13783785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng                        ISD::NodeType Opcode,
13883785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng                        unsigned Op0, uint64_t Imm,
13983785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng                        MVT::SimpleValueType ImmType);
1406d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson
14110df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// FastEmit_rf_ - This method is a wrapper of FastEmit_rf. It first tries
14210df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// to emit an instruction with an immediate operand using FastEmit_rf.
14310df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// If that fails, it materializes the immediate into a register and try
14410df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// FastEmit_rr instead.
14510df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  unsigned FastEmit_rf_(MVT::SimpleValueType VT,
14610df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                        ISD::NodeType Opcode,
14710df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                        unsigned Op0, ConstantFP *FPImm,
14810df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                        MVT::SimpleValueType ImmType);
14910df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman
1506d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  /// FastEmit_i - This method is called by target-independent code
1516d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  /// to request that an instruction with the given type, opcode, and
1526d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  /// immediate operand be emitted.
1536d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  virtual unsigned FastEmit_i(MVT::SimpleValueType VT,
1540f84e4e31009eecf2dfcbe6113b65d0919f30254Owen Anderson                              MVT::SimpleValueType RetVT,
1556d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson                              ISD::NodeType Opcode,
1566d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson                              uint64_t Imm);
15783785c80968165b30fcdd111ceb2c28d38bcff86Evan Cheng
15810df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// FastEmit_f - This method is called by target-independent code
15910df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// to request that an instruction with the given type, opcode, and
16010df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// floating-point immediate operand be emitted.
16110df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  virtual unsigned FastEmit_f(MVT::SimpleValueType VT,
16210df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                              MVT::SimpleValueType RetVT,
16310df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                              ISD::NodeType Opcode,
16410df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                              ConstantFP *FPImm);
16510df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman
166bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// FastEmitInst_ - Emit a MachineInstr with no operands and a
167bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// result register in the given register class.
168bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  ///
169b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  unsigned FastEmitInst_(unsigned MachineInstOpcode,
170b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                         const TargetRegisterClass *RC);
171bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
172d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// FastEmitInst_r - Emit a MachineInstr with one register operand
173bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// and a result register in the given register class.
174bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  ///
175b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  unsigned FastEmitInst_r(unsigned MachineInstOpcode,
176b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                          const TargetRegisterClass *RC,
177b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                          unsigned Op0);
178bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
179d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// FastEmitInst_rr - Emit a MachineInstr with two register operands
180bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  /// and a result register in the given register class.
181bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman  ///
182b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman  unsigned FastEmitInst_rr(unsigned MachineInstOpcode,
183b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                           const TargetRegisterClass *RC,
184b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman                           unsigned Op0, unsigned Op1);
185bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
186d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// FastEmitInst_ri - Emit a MachineInstr with two register operands
187d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// and a result register in the given register class.
188d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  ///
189d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  unsigned FastEmitInst_ri(unsigned MachineInstOpcode,
190d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                           const TargetRegisterClass *RC,
191d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                           unsigned Op0, uint64_t Imm);
192d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman
19310df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// FastEmitInst_rf - Emit a MachineInstr with two register operands
19410df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  /// and a result register in the given register class.
19510df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  ///
19610df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman  unsigned FastEmitInst_rf(unsigned MachineInstOpcode,
19710df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                           const TargetRegisterClass *RC,
19810df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman                           unsigned Op0, ConstantFP *FPImm);
19910df0fa73e396bbc93a8940e8b53827390c54d10Dan Gohman
200d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// FastEmitInst_rri - Emit a MachineInstr with two register operands,
201d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  /// an immediate, and a result register in the given register class.
202d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  ///
203d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman  unsigned FastEmitInst_rri(unsigned MachineInstOpcode,
204d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                            const TargetRegisterClass *RC,
205d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman                            unsigned Op0, unsigned Op1, uint64_t Imm);
2066d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson
2076d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  /// FastEmitInst_i - Emit a MachineInstr with a single immediate
2086d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  /// operand, and a result register in the given register class.
2096d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson  unsigned FastEmitInst_i(unsigned MachineInstrOpcode,
2106d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson                          const TargetRegisterClass *RC,
2116d0c25ec3a7ca822e68f73a4481eee43eb5c9485Owen Anderson                          uint64_t Imm);
212d5fe57d2f980c6bd1a61450f99c254a76d0f1683Dan Gohman
2138970f00deff00ffce1f35cf00883357e1582daa1Owen Anderson  /// FastEmitInst_extractsubreg - Emit a MachineInstr for an extract_subreg
2148970f00deff00ffce1f35cf00883357e1582daa1Owen Anderson  /// from a specified index of a superregister.
21540a468f24909792f000e3ccc1dda7a27b9c34b69Owen Anderson  unsigned FastEmitInst_extractsubreg(unsigned Op0, uint32_t Idx);
2168970f00deff00ffce1f35cf00883357e1582daa1Owen Anderson
2173df24e667f04a7003342b534310919abc9c87418Dan Gohman  void UpdateValueMap(Instruction* I, unsigned Reg);
218ea09f4f4691a0db65772b54fe8163a48c9dce01dEvan Cheng
219c7f72de3b4ef21828ea4780f0693bf0acd04e1c5Dan Gohman  unsigned createResultReg(const TargetRegisterClass *RC);
220c7f72de3b4ef21828ea4780f0693bf0acd04e1c5Dan Gohman
221ea09f4f4691a0db65772b54fe8163a48c9dce01dEvan Chengprivate:
2223df24e667f04a7003342b534310919abc9c87418Dan Gohman  bool SelectBinaryOp(Instruction *I, ISD::NodeType ISDOpcode);
223bdedd4477331b3b0d28d74658baf05f675f2d195Dan Gohman
2243df24e667f04a7003342b534310919abc9c87418Dan Gohman  bool SelectGetElementPtr(Instruction *I);
225763d89343be210eb62a13318ca0cc9321ce46bfbDan Gohman
2263df24e667f04a7003342b534310919abc9c87418Dan Gohman  bool SelectBitCast(Instruction *I);
227d0533c9998d3baf41848ba559a9b2f2c65296d14Owen Anderson
2283df24e667f04a7003342b534310919abc9c87418Dan Gohman  bool SelectCast(Instruction *I, ISD::NodeType Opcode);
229b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman};
230b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
231b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman}
232b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman
233b0cf29c5cfff797284b3660dc233e135feb65d9aDan Gohman#endif
234