summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2007-09-06 16:18:45 +0000
committerDavid Greene <greened@obbligato.org>2007-09-06 16:18:45 +0000
commit65d2a697dc488246db46416ce2f3d7f6c2a672e0 (patch)
tree9334e372f6b16d2f0b9e224042c2642fc418fb52 /llvm/lib/CodeGen/RegisterCoalescer.cpp
parente80505643dcfe77faa6cd192bf165ce1e4d016a0 (diff)
downloadbcm5719-llvm-65d2a697dc488246db46416ce2f3d7f6c2a672e0.tar.gz
bcm5719-llvm-65d2a697dc488246db46416ce2f3d7f6c2a672e0.zip
Pluggable coalescers inplementation.
llvm-svn: 41743
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
new file mode 100644
index 00000000000..cffc2e01cc0
--- /dev/null
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -0,0 +1,43 @@
+//===- RegisterCoalescer.cpp - Generic Register Coalescing Interface -------==//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the generic RegisterCoalescer interface which
+// is used as the common interface used by all clients and
+// implementations of register coalescing.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CodeGen/RegisterCoalescer.h"
+#include "llvm/CodeGen/LiveIntervalAnalysis.h"
+#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/Target/MRegisterInfo.h"
+#include "llvm/Pass.h"
+
+using namespace llvm;
+
+// Register the RegisterCoalescer interface, providing a nice name to refer to.
+namespace {
+ RegisterAnalysisGroup<RegisterCoalescer> Z("Register Coalescer");
+}
+char RegisterCoalescer::ID = 0;
+
+// RegisterCoalescer destructor: DO NOT move this to the header file
+// for RegisterCoalescer or else clients of the RegisterCoalescer
+// class may not depend on the RegisterCoalescer.o file in the current
+// .a file, causing alias analysis support to not be included in the
+// tool correctly!
+//
+RegisterCoalescer::~RegisterCoalescer() {}
+
+// Because of the way .a files work, we must force the SimpleRC
+// implementation to be pulled in if the RegisterCoalescer classes are
+// pulled in. Otherwise we run the risk of RegisterCoalescer being
+// used, but the default implementation not being linked into the tool
+// that uses it.
+DEFINING_FILE_FOR(RegisterCoalescer)
OpenPOWER on IntegriCloud