1 //===-- AlphaTargetMachine.cpp - Define TargetMachine for Alpha -----------===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
14 #include "AlphaTargetMachine.h"
15 #include "llvm/CodeGen/Passes.h"
16 #include "llvm/Target/TargetOptions.h"
17 #include "llvm/Target/TargetMachineRegistry.h"
18 #include "llvm/Transforms/Scalar.h"
23 // Register the targets
24 RegisterTarget<AlphaTargetMachine> X("alpha", " Alpha (incomplete)");
27 AlphaTargetMachine::AlphaTargetMachine( const Module &M, IntrinsicLowering *IL)
28 : TargetMachine("alpha", IL, true),
29 FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) //TODO: check these
32 bool AlphaTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM,
33 MachineCodeEmitter &MCE)
40 /// addPassesToEmitAssembly - Add passes to the specified pass manager
41 /// to implement a static compiler for this target.
43 bool AlphaTargetMachine::addPassesToEmitAssembly(PassManager &PM,
46 // FIXME: Implement efficient support for garbage collection intrinsics.
47 PM.add(createLowerGCPass());
49 // FIXME: Implement the invoke/unwind instructions!
50 PM.add(createLowerInvokePass());
52 // FIXME: Implement the switch instruction in the instruction selector!
53 PM.add(createLowerSwitchPass());
55 // Make sure that no unreachable blocks are instruction selected.
56 PM.add(createUnreachableBlockEliminationPass());
58 PM.add(createAlphaPatternInstructionSelector(*this));
61 PM.add(createMachineFunctionPrinterPass(&std::cerr));
63 PM.add(createRegisterAllocator());
66 PM.add(createMachineFunctionPrinterPass(&std::cerr));
68 PM.add(createPrologEpilogCodeInserter());
70 // Must run branch selection immediately preceding the asm printer
71 //PM.add(createAlphaBranchSelectionPass());
73 PM.add(createAlphaCodePrinterPass(Out, *this));
75 PM.add(createMachineCodeDeleter());