David Greene | 2c17c4d | 2007-09-06 16:18:45 +0000 | [diff] [blame] | 1 | //===- RegisterCoalescer.cpp - Generic Register Coalescing Interface -------==// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the generic RegisterCoalescer interface which |
| 11 | // is used as the common interface used by all clients and |
| 12 | // implementations of register coalescing. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "llvm/CodeGen/RegisterCoalescer.h" |
| 17 | #include "llvm/CodeGen/LiveIntervalAnalysis.h" |
| 18 | #include "llvm/CodeGen/MachineInstr.h" |
| 19 | #include "llvm/Target/MRegisterInfo.h" |
| 20 | #include "llvm/Pass.h" |
| 21 | |
| 22 | using namespace llvm; |
| 23 | |
| 24 | // Register the RegisterCoalescer interface, providing a nice name to refer to. |
| 25 | namespace { |
| 26 | RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer"); |
| 27 | } |
| 28 | char RegisterCoalescer::ID = 0; |
| 29 | |
| 30 | // RegisterCoalescer destructor: DO NOT move this to the header file |
| 31 | // for RegisterCoalescer or else clients of the RegisterCoalescer |
| 32 | // class may not depend on the RegisterCoalescer.o file in the current |
| 33 | // .a file, causing alias analysis support to not be included in the |
| 34 | // tool correctly! |
| 35 | // |
| 36 | RegisterCoalescer::~RegisterCoalescer() {} |
| 37 | |
| 38 | // Because of the way .a files work, we must force the SimpleRC |
| 39 | // implementation to be pulled in if the RegisterCoalescer classes are |
| 40 | // pulled in. Otherwise we run the risk of RegisterCoalescer being |
| 41 | // used, but the default implementation not being linked into the tool |
| 42 | // that uses it. |
| 43 | DEFINING_FILE_FOR(RegisterCoalescer) |