1 //===-- PTXRegAlloc.cpp - PTX Register Allocator --------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains a register allocator for PTX code.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "ptx-reg-alloc"
17 #include "llvm/CodeGen/MachineFunctionPass.h"
18 #include "llvm/CodeGen/RegAllocRegistry.h"
23 // Special register allocator for PTX.
24 class PTXRegAlloc : public MachineFunctionPass {
27 PTXRegAlloc() : MachineFunctionPass(ID) {}
29 virtual const char* getPassName() const {
30 return "PTX Register Allocator";
33 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
35 MachineFunctionPass::getAnalysisUsage(AU);
38 virtual bool runOnMachineFunction(MachineFunction &MF) {
39 // We do not actually do anything (at least not yet).
44 char PTXRegAlloc::ID = 0;
46 static RegisterRegAlloc
47 ptxRegAlloc("ptx", "PTX register allocator", createPTXRegisterAllocator);
50 FunctionPass *llvm::createPTXRegisterAllocator() {
51 return new PTXRegAlloc();