2beddc1b3e44154777eb3a6c9c8912a8e11acd4a
[oota-llvm.git] / include / llvm / CodeGen / MachineInstrBundle.h
1 //===-- CodeGen/MachineInstBundle.h - MI bundle utilities -------*- 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 // This file provide utility functions to manipulate machine instruction
11 // bundles.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CODEGEN_MACHINEINSTRBUNDLE_H
16 #define LLVM_CODEGEN_MACHINEINSTRBUNDLE_H
17
18 #include "llvm/CodeGen/MachineBasicBlock.h"
19
20 namespace llvm {
21
22 /// finalizeBundle - Finalize a machine instruction bundle which includes
23 /// a sequence of instructions starting from FirstMI to LastMI (exclusive).
24 /// This routine adds a BUNDLE instruction to represent the bundle, it adds
25 /// IsInternalRead markers to MachineOperands which are defined inside the
26 /// bundle, and it copies externally visible defs and uses to the BUNDLE
27 /// instruction.
28 void finalizeBundle(MachineBasicBlock &MBB,
29                     MachineBasicBlock::instr_iterator FirstMI,
30                     MachineBasicBlock::instr_iterator LastMI);
31   
32 /// finalizeBundle - Same functionality as the previous finalizeBundle except
33 /// the last instruction in the bundle is not provided as an input. This is
34 /// used in cases where bundles are pre-determined by marking instructions
35 /// with 'InsideBundle' marker. It returns the MBB instruction iterator that
36 /// points to the end of the bundle.
37 MachineBasicBlock::instr_iterator finalizeBundle(MachineBasicBlock &MBB,
38                     MachineBasicBlock::instr_iterator FirstMI);
39
40 } // End llvm namespace
41
42 #endif