2003-09-30 18:37:50 +00:00
|
|
|
//===-- llvm/Target/TargetMachine.h - Target Information --------*- C++ -*-===//
|
2005-04-21 20:59:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 19:59:42 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 20:59:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2001-09-18 12:38:31 +00:00
|
|
|
//
|
2006-09-04 04:14:57 +00:00
|
|
|
// This file defines the TargetMachine and LLVMTargetMachine classes.
|
2001-09-18 12:38:31 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TARGET_TARGETMACHINE_H
|
|
|
|
#define LLVM_TARGET_TARGETMACHINE_H
|
|
|
|
|
2011-12-02 22:16:29 +00:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
2011-07-19 06:37:02 +00:00
|
|
|
#include "llvm/MC/MCCodeGenInfo.h"
|
2011-07-08 01:53:10 +00:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2003-10-20 15:14:33 +00:00
|
|
|
#include <cassert>
|
2009-08-11 20:42:37 +00:00
|
|
|
#include <string>
|
2001-09-18 12:38:31 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2011-06-29 01:14:12 +00:00
|
|
|
class InstrItineraryData;
|
|
|
|
class JITCodeEmitter;
|
2009-08-22 20:48:53 +00:00
|
|
|
class MCAsmInfo;
|
2011-07-19 06:37:02 +00:00
|
|
|
class MCCodeGenInfo;
|
2011-06-29 01:14:12 +00:00
|
|
|
class MCContext;
|
|
|
|
class Pass;
|
|
|
|
class PassManager;
|
|
|
|
class PassManagerBase;
|
|
|
|
class Target;
|
2006-05-12 06:33:49 +00:00
|
|
|
class TargetData;
|
2011-06-29 01:14:12 +00:00
|
|
|
class TargetELFWriterInfo;
|
|
|
|
class TargetFrameLowering;
|
2003-01-13 00:21:32 +00:00
|
|
|
class TargetInstrInfo;
|
2009-02-05 01:49:45 +00:00
|
|
|
class TargetIntrinsicInfo;
|
2003-12-20 01:22:19 +00:00
|
|
|
class TargetJITInfo;
|
2006-03-13 23:17:42 +00:00
|
|
|
class TargetLowering;
|
2008-02-10 18:45:23 +00:00
|
|
|
class TargetRegisterInfo;
|
2011-06-29 01:14:12 +00:00
|
|
|
class TargetSelectionDAGInfo;
|
2011-07-01 21:01:15 +00:00
|
|
|
class TargetSubtargetInfo;
|
2009-07-14 20:18:05 +00:00
|
|
|
class formatted_raw_ostream;
|
2011-03-18 22:48:41 +00:00
|
|
|
class raw_ostream;
|
2001-09-18 12:38:31 +00:00
|
|
|
|
2002-12-28 20:13:29 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// TargetMachine - Primary interface to the complete machine description for
|
|
|
|
/// the target machine. All target-specific information should be accessible
|
|
|
|
/// through this interface.
|
2005-04-21 20:59:05 +00:00
|
|
|
///
|
2003-06-03 15:28:40 +00:00
|
|
|
class TargetMachine {
|
2006-09-04 04:14:57 +00:00
|
|
|
TargetMachine(const TargetMachine &); // DO NOT IMPLEMENT
|
|
|
|
void operator=(const TargetMachine &); // DO NOT IMPLEMENT
|
2006-09-03 18:44:26 +00:00
|
|
|
protected: // Can only create subclasses.
|
2011-07-08 01:53:10 +00:00
|
|
|
TargetMachine(const Target &T, StringRef TargetTriple,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options);
|
2005-07-12 03:04:49 +00:00
|
|
|
|
|
|
|
/// getSubtargetImpl - virtual method implemented by subclasses that returns
|
2011-07-01 21:01:15 +00:00
|
|
|
/// a reference to that target's TargetSubtargetInfo-derived member variable.
|
|
|
|
virtual const TargetSubtargetInfo *getSubtargetImpl() const { return 0; }
|
2009-07-15 20:24:03 +00:00
|
|
|
|
|
|
|
/// TheTarget - The Target that this machine was created for.
|
|
|
|
const Target &TheTarget;
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2011-07-08 01:53:10 +00:00
|
|
|
/// TargetTriple, TargetCPU, TargetFS - Triple string, CPU name, and target
|
|
|
|
/// feature strings the TargetMachine instance is created with.
|
|
|
|
std::string TargetTriple;
|
|
|
|
std::string TargetCPU;
|
|
|
|
std::string TargetFS;
|
|
|
|
|
2011-07-19 06:37:02 +00:00
|
|
|
/// CodeGenInfo - Low level target information such as relocation model.
|
|
|
|
const MCCodeGenInfo *CodeGenInfo;
|
|
|
|
|
2006-09-07 22:06:40 +00:00
|
|
|
/// AsmInfo - Contains target specific asm information.
|
|
|
|
///
|
2009-08-22 20:48:53 +00:00
|
|
|
const MCAsmInfo *AsmInfo;
|
2010-05-26 21:48:55 +00:00
|
|
|
|
|
|
|
unsigned MCRelaxAll : 1;
|
2011-01-23 17:55:27 +00:00
|
|
|
unsigned MCNoExecStack : 1;
|
2011-03-28 22:49:19 +00:00
|
|
|
unsigned MCSaveTempLabels : 1;
|
2010-11-19 02:26:16 +00:00
|
|
|
unsigned MCUseLoc : 1;
|
2011-04-30 03:44:37 +00:00
|
|
|
unsigned MCUseCFI : 1;
|
2011-10-17 23:05:28 +00:00
|
|
|
unsigned MCUseDwarfDirectory : 1;
|
2010-05-26 21:48:55 +00:00
|
|
|
|
2001-09-18 12:38:31 +00:00
|
|
|
public:
|
2003-12-28 21:23:38 +00:00
|
|
|
virtual ~TargetMachine();
|
2002-10-29 21:12:46 +00:00
|
|
|
|
2009-07-15 20:24:03 +00:00
|
|
|
const Target &getTarget() const { return TheTarget; }
|
2009-07-15 12:11:05 +00:00
|
|
|
|
2011-07-08 01:53:10 +00:00
|
|
|
const StringRef getTargetTriple() const { return TargetTriple; }
|
|
|
|
const StringRef getTargetCPU() const { return TargetCPU; }
|
|
|
|
const StringRef getTargetFeatureString() const { return TargetFS; }
|
|
|
|
|
2011-12-02 22:16:29 +00:00
|
|
|
TargetOptions Options;
|
|
|
|
|
2001-09-18 12:38:31 +00:00
|
|
|
// Interfaces to the major aspects of target machine information:
|
|
|
|
// -- Instruction opcode and operand information
|
|
|
|
// -- Pipelines and scheduling information
|
2002-09-20 00:52:09 +00:00
|
|
|
// -- Stack frame information
|
2006-03-13 23:17:42 +00:00
|
|
|
// -- Selection DAG lowering information
|
2005-04-21 20:59:05 +00:00
|
|
|
//
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const TargetInstrInfo *getInstrInfo() const { return 0; }
|
|
|
|
virtual const TargetFrameLowering *getFrameLowering() const { return 0; }
|
2010-04-17 15:26:15 +00:00
|
|
|
virtual const TargetLowering *getTargetLowering() const { return 0; }
|
|
|
|
virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const{ return 0; }
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const TargetData *getTargetData() const { return 0; }
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2009-08-22 20:48:53 +00:00
|
|
|
/// getMCAsmInfo - Return target specific asm information.
|
2006-09-07 22:06:40 +00:00
|
|
|
///
|
2009-08-22 20:48:53 +00:00
|
|
|
const MCAsmInfo *getMCAsmInfo() const { return AsmInfo; }
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2005-07-27 05:53:44 +00:00
|
|
|
/// getSubtarget - This method returns a pointer to the specified type of
|
2011-07-01 21:01:15 +00:00
|
|
|
/// TargetSubtargetInfo. In debug builds, it verifies that the object being
|
2005-07-12 03:04:49 +00:00
|
|
|
/// returned is of the correct type.
|
2005-08-05 21:53:21 +00:00
|
|
|
template<typename STC> const STC &getSubtarget() const {
|
2010-01-21 06:11:03 +00:00
|
|
|
return *static_cast<const STC*>(getSubtargetImpl());
|
2005-07-12 01:41:54 +00:00
|
|
|
}
|
|
|
|
|
2002-10-30 00:53:02 +00:00
|
|
|
/// getRegisterInfo - If register information is available, return it. If
|
2002-12-28 20:13:29 +00:00
|
|
|
/// not, return null. This is kept separate from RegInfo until RegInfo has
|
|
|
|
/// details of graph coloring register allocation removed from it.
|
2002-10-30 00:53:02 +00:00
|
|
|
///
|
2008-02-10 18:45:23 +00:00
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; }
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2009-02-05 01:49:45 +00:00
|
|
|
/// getIntrinsicInfo - If intrinsic information is available, return it. If
|
|
|
|
/// not, return null.
|
|
|
|
///
|
|
|
|
virtual const TargetIntrinsicInfo *getIntrinsicInfo() const { return 0; }
|
2002-10-30 00:53:02 +00:00
|
|
|
|
2003-12-20 01:22:19 +00:00
|
|
|
/// getJITInfo - If this target supports a JIT, return information for it,
|
|
|
|
/// otherwise return null.
|
|
|
|
///
|
|
|
|
virtual TargetJITInfo *getJITInfo() { return 0; }
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2005-11-01 20:06:59 +00:00
|
|
|
/// getInstrItineraryData - Returns instruction itinerary data for the target
|
|
|
|
/// or specific subtarget.
|
|
|
|
///
|
2010-10-16 08:25:21 +00:00
|
|
|
virtual const InstrItineraryData *getInstrItineraryData() const {
|
2010-09-10 01:29:16 +00:00
|
|
|
return 0;
|
2005-11-01 20:06:59 +00:00
|
|
|
}
|
2003-12-20 01:22:19 +00:00
|
|
|
|
2007-01-27 02:55:04 +00:00
|
|
|
/// getELFWriterInfo - If this target supports an ELF writer, return
|
|
|
|
/// information for it, otherwise return null.
|
2010-10-16 08:25:21 +00:00
|
|
|
///
|
2007-01-27 02:55:04 +00:00
|
|
|
virtual const TargetELFWriterInfo *getELFWriterInfo() const { return 0; }
|
|
|
|
|
2010-05-26 21:48:55 +00:00
|
|
|
/// hasMCRelaxAll - Check whether all machine code instructions should be
|
|
|
|
/// relaxed.
|
|
|
|
bool hasMCRelaxAll() const { return MCRelaxAll; }
|
|
|
|
|
|
|
|
/// setMCRelaxAll - Set whether all machine code instructions should be
|
|
|
|
/// relaxed.
|
|
|
|
void setMCRelaxAll(bool Value) { MCRelaxAll = Value; }
|
|
|
|
|
2011-03-28 22:49:19 +00:00
|
|
|
/// hasMCSaveTempLabels - Check whether temporary labels will be preserved
|
|
|
|
/// (i.e., not treated as temporary).
|
|
|
|
bool hasMCSaveTempLabels() const { return MCSaveTempLabels; }
|
|
|
|
|
|
|
|
/// setMCSaveTempLabels - Set whether temporary labels will be preserved
|
|
|
|
/// (i.e., not treated as temporary).
|
|
|
|
void setMCSaveTempLabels(bool Value) { MCSaveTempLabels = Value; }
|
|
|
|
|
2011-01-23 17:55:27 +00:00
|
|
|
/// hasMCNoExecStack - Check whether an executable stack is not needed.
|
|
|
|
bool hasMCNoExecStack() const { return MCNoExecStack; }
|
|
|
|
|
|
|
|
/// setMCNoExecStack - Set whether an executabel stack is not needed.
|
|
|
|
void setMCNoExecStack(bool Value) { MCNoExecStack = Value; }
|
|
|
|
|
2010-11-19 02:26:16 +00:00
|
|
|
/// hasMCUseLoc - Check whether we should use dwarf's .loc directive.
|
|
|
|
bool hasMCUseLoc() const { return MCUseLoc; }
|
|
|
|
|
|
|
|
/// setMCUseLoc - Set whether all we should use dwarf's .loc directive.
|
|
|
|
void setMCUseLoc(bool Value) { MCUseLoc = Value; }
|
|
|
|
|
2011-04-30 03:44:37 +00:00
|
|
|
/// hasMCUseCFI - Check whether we should use dwarf's .cfi_* directives.
|
|
|
|
bool hasMCUseCFI() const { return MCUseCFI; }
|
|
|
|
|
|
|
|
/// setMCUseCFI - Set whether all we should use dwarf's .cfi_* directives.
|
|
|
|
void setMCUseCFI(bool Value) { MCUseCFI = Value; }
|
|
|
|
|
2011-10-17 23:05:28 +00:00
|
|
|
/// hasMCUseDwarfDirectory - Check whether we should use .file directives with
|
|
|
|
/// explicit directories.
|
|
|
|
bool hasMCUseDwarfDirectory() const { return MCUseDwarfDirectory; }
|
|
|
|
|
|
|
|
/// setMCUseDwarfDirectory - Set whether all we should use .file directives
|
|
|
|
/// with explicit directories.
|
|
|
|
void setMCUseDwarfDirectory(bool Value) { MCUseDwarfDirectory = Value; }
|
|
|
|
|
2006-02-22 20:19:42 +00:00
|
|
|
/// getRelocationModel - Returns the code generation relocation model. The
|
|
|
|
/// choices are static, PIC, and dynamic-no-pic, and target default.
|
2011-07-19 06:37:02 +00:00
|
|
|
Reloc::Model getRelocationModel() const;
|
2006-02-22 20:19:42 +00:00
|
|
|
|
2006-07-06 01:53:36 +00:00
|
|
|
/// getCodeModel - Returns the code model. The choices are small, kernel,
|
|
|
|
/// medium, large, and target default.
|
2011-07-20 07:51:56 +00:00
|
|
|
CodeModel::Model getCodeModel() const;
|
2006-07-06 01:53:36 +00:00
|
|
|
|
2011-11-16 08:38:26 +00:00
|
|
|
/// getOptLevel - Returns the optimization level: None, Less,
|
|
|
|
/// Default, or Aggressive.
|
|
|
|
CodeGenOpt::Level getOptLevel() const;
|
|
|
|
|
2009-03-25 01:47:28 +00:00
|
|
|
/// getAsmVerbosityDefault - Returns the default value of asm verbosity.
|
|
|
|
///
|
|
|
|
static bool getAsmVerbosityDefault();
|
|
|
|
|
|
|
|
/// setAsmVerbosityDefault - Set the default value of asm verbosity. Default
|
|
|
|
/// is false.
|
|
|
|
static void setAsmVerbosityDefault(bool);
|
|
|
|
|
2010-04-13 00:36:43 +00:00
|
|
|
/// getDataSections - Return true if data objects should be emitted into their
|
|
|
|
/// own section, corresponds to -fdata-sections.
|
|
|
|
static bool getDataSections();
|
|
|
|
|
|
|
|
/// getFunctionSections - Return true if functions should be emitted into
|
|
|
|
/// their own section, corresponding to -ffunction-sections.
|
|
|
|
static bool getFunctionSections();
|
|
|
|
|
|
|
|
/// setDataSections - Set if the data are emit into separate sections.
|
|
|
|
static void setDataSections(bool);
|
|
|
|
|
|
|
|
/// setFunctionSections - Set if the functions are emit into separate
|
|
|
|
/// sections.
|
|
|
|
static void setFunctionSections(bool);
|
|
|
|
|
2005-06-25 02:47:50 +00:00
|
|
|
/// CodeGenFileType - These enums are meant to be passed into
|
2010-02-02 21:06:45 +00:00
|
|
|
/// addPassesToEmitFile to indicate what type of file to emit, and returned by
|
|
|
|
/// it to indicate what type of file could actually be made.
|
2005-06-25 02:47:50 +00:00
|
|
|
enum CodeGenFileType {
|
2010-02-02 21:06:45 +00:00
|
|
|
CGFT_AssemblyFile,
|
|
|
|
CGFT_ObjectFile,
|
2010-02-03 05:55:08 +00:00
|
|
|
CGFT_Null // Do not emit any output.
|
2005-06-25 02:47:50 +00:00
|
|
|
};
|
|
|
|
|
2007-05-22 18:31:04 +00:00
|
|
|
/// getEnableTailMergeDefault - the default setting for -enable-tail-merge
|
2007-05-22 17:14:46 +00:00
|
|
|
/// on this target. User flag overrides.
|
2007-11-19 20:46:23 +00:00
|
|
|
virtual bool getEnableTailMergeDefault() const { return true; }
|
2007-05-22 17:14:46 +00:00
|
|
|
|
2007-02-08 01:34:45 +00:00
|
|
|
/// addPassesToEmitFile - Add passes to the specified pass manager to get the
|
|
|
|
/// specified file emitted. Typically this will involve several steps of code
|
2010-02-03 05:55:08 +00:00
|
|
|
/// generation. This method should return true if emission of this file type
|
|
|
|
/// is not supported, or false on success.
|
|
|
|
virtual bool addPassesToEmitFile(PassManagerBase &,
|
|
|
|
formatted_raw_ostream &,
|
2010-02-17 23:55:26 +00:00
|
|
|
CodeGenFileType,
|
2011-12-02 20:53:57 +00:00
|
|
|
bool /*DisableVerify*/ = true) {
|
2010-02-03 05:55:08 +00:00
|
|
|
return true;
|
2007-02-08 01:34:45 +00:00
|
|
|
}
|
|
|
|
|
2009-05-30 20:51:52 +00:00
|
|
|
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
|
2010-02-02 22:31:11 +00:00
|
|
|
/// get machine code emitted. This uses a JITCodeEmitter object to handle
|
2009-05-30 20:51:52 +00:00
|
|
|
/// actually outputting the machine code and resolving things like the address
|
|
|
|
/// of functions. This method returns true if machine code emission is
|
|
|
|
/// not supported.
|
|
|
|
///
|
|
|
|
virtual bool addPassesToEmitMachineCode(PassManagerBase &,
|
|
|
|
JITCodeEmitter &,
|
2011-12-02 20:53:57 +00:00
|
|
|
bool /*DisableVerify*/ = true) {
|
2009-05-30 20:51:52 +00:00
|
|
|
return true;
|
|
|
|
}
|
2010-07-22 05:58:53 +00:00
|
|
|
|
|
|
|
/// addPassesToEmitMC - Add passes to the specified pass manager to get
|
|
|
|
/// machine code emitted with the MCJIT. This method returns true if machine
|
|
|
|
/// code is not supported. It fills the MCContext Ctx pointer which can be
|
|
|
|
/// used to build custom MCStreamer.
|
|
|
|
///
|
2010-07-22 21:51:30 +00:00
|
|
|
virtual bool addPassesToEmitMC(PassManagerBase &,
|
|
|
|
MCContext *&,
|
2011-03-21 18:06:32 +00:00
|
|
|
raw_ostream &,
|
2011-12-02 20:53:57 +00:00
|
|
|
bool /*DisableVerify*/ = true) {
|
2010-07-22 05:58:53 +00:00
|
|
|
return true;
|
|
|
|
}
|
2006-09-04 04:14:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/// LLVMTargetMachine - This class describes a target machine that is
|
|
|
|
/// implemented with the LLVM target-independent code generator.
|
|
|
|
///
|
|
|
|
class LLVMTargetMachine : public TargetMachine {
|
|
|
|
protected: // Can only create subclasses.
|
2011-07-08 01:53:10 +00:00
|
|
|
LLVMTargetMachine(const Target &T, StringRef TargetTriple,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, TargetOptions Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2011-12-02 22:16:29 +00:00
|
|
|
/// printNoVerify - Add a pass to dump the machine function, if debugging is
|
|
|
|
/// enabled.
|
|
|
|
///
|
|
|
|
void printNoVerify(PassManagerBase &PM, const char *Banner) const;
|
|
|
|
|
|
|
|
/// printAndVerify - Add a pass to dump then verify the machine function, if
|
|
|
|
/// those steps are enabled.
|
|
|
|
///
|
|
|
|
void printAndVerify(PassManagerBase &PM, const char *Banner) const;
|
|
|
|
|
2010-03-13 20:55:24 +00:00
|
|
|
private:
|
2008-09-25 00:37:07 +00:00
|
|
|
/// addCommonCodeGenPasses - Add standard LLVM codegen passes used for
|
|
|
|
/// both emitting to assembly files or machine code output.
|
|
|
|
///
|
2011-11-16 08:38:26 +00:00
|
|
|
bool addCommonCodeGenPasses(PassManagerBase &,
|
2010-03-13 20:55:24 +00:00
|
|
|
bool DisableVerify, MCContext *&OutCtx);
|
2008-09-25 00:37:07 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
public:
|
2007-02-08 01:34:45 +00:00
|
|
|
/// addPassesToEmitFile - Add passes to the specified pass manager to get the
|
|
|
|
/// specified file emitted. Typically this will involve several steps of code
|
2011-11-16 08:38:26 +00:00
|
|
|
/// generation.
|
2010-02-03 05:55:08 +00:00
|
|
|
virtual bool addPassesToEmitFile(PassManagerBase &PM,
|
|
|
|
formatted_raw_ostream &Out,
|
|
|
|
CodeGenFileType FileType,
|
2010-02-28 00:41:59 +00:00
|
|
|
bool DisableVerify = true);
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2009-05-30 20:51:52 +00:00
|
|
|
/// addPassesToEmitMachineCode - Add passes to the specified pass manager to
|
2010-02-02 22:31:11 +00:00
|
|
|
/// get machine code emitted. This uses a JITCodeEmitter object to handle
|
2009-05-30 20:51:52 +00:00
|
|
|
/// actually outputting the machine code and resolving things like the address
|
|
|
|
/// of functions. This method returns true if machine code emission is
|
|
|
|
/// not supported.
|
|
|
|
///
|
|
|
|
virtual bool addPassesToEmitMachineCode(PassManagerBase &PM,
|
|
|
|
JITCodeEmitter &MCE,
|
2010-02-28 00:41:59 +00:00
|
|
|
bool DisableVerify = true);
|
2010-07-22 05:58:53 +00:00
|
|
|
|
|
|
|
/// addPassesToEmitMC - Add passes to the specified pass manager to get
|
|
|
|
/// machine code emitted with the MCJIT. This method returns true if machine
|
|
|
|
/// code is not supported. It fills the MCContext Ctx pointer which can be
|
|
|
|
/// used to build custom MCStreamer.
|
|
|
|
///
|
|
|
|
virtual bool addPassesToEmitMC(PassManagerBase &PM,
|
|
|
|
MCContext *&Ctx,
|
2011-03-18 22:48:41 +00:00
|
|
|
raw_ostream &OS,
|
2010-07-22 05:58:53 +00:00
|
|
|
bool DisableVerify = true);
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
/// Target-Independent Code Generator Pass Configuration Options.
|
2010-07-24 20:48:54 +00:00
|
|
|
|
|
|
|
/// addPreISelPasses - This method should add any "last minute" LLVM->LLVM
|
|
|
|
/// passes (which are run just before instruction selector).
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addPreISel(PassManagerBase &) {
|
2010-07-24 20:48:54 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// addInstSelector - This method should install an instruction selector pass,
|
|
|
|
/// which converts from LLVM code to machine instructions.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addInstSelector(PassManagerBase &) {
|
2006-09-04 04:14:57 +00:00
|
|
|
return true;
|
|
|
|
}
|
2008-04-23 18:22:28 +00:00
|
|
|
|
2009-09-30 08:49:50 +00:00
|
|
|
/// addPreRegAlloc - This method may be implemented by targets that want to
|
|
|
|
/// run passes immediately before register allocation. This should return
|
2008-04-23 18:22:28 +00:00
|
|
|
/// true if -print-machineinstrs should print after these passes.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addPreRegAlloc(PassManagerBase &) {
|
2008-04-23 18:22:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-09-30 08:49:50 +00:00
|
|
|
/// addPostRegAlloc - This method may be implemented by targets that want
|
|
|
|
/// to run passes after register allocation but before prolog-epilog
|
2006-09-04 04:14:57 +00:00
|
|
|
/// insertion. This should return true if -print-machineinstrs should print
|
|
|
|
/// after these passes.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addPostRegAlloc(PassManagerBase &) {
|
2006-09-04 04:14:57 +00:00
|
|
|
return false;
|
|
|
|
}
|
2009-09-30 08:49:50 +00:00
|
|
|
|
|
|
|
/// addPreSched2 - This method may be implemented by targets that want to
|
|
|
|
/// run passes after prolog-epilog insertion and before the second instruction
|
|
|
|
/// scheduling pass. This should return true if -print-machineinstrs should
|
|
|
|
/// print after these passes.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addPreSched2(PassManagerBase &) {
|
2009-09-30 08:49:50 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-10-16 08:25:21 +00:00
|
|
|
|
2006-09-04 04:14:57 +00:00
|
|
|
/// addPreEmitPass - This pass may be implemented by targets that want to run
|
|
|
|
/// passes immediately before machine code is emitted. This should return
|
|
|
|
/// true if -print-machineinstrs should print out the code after the passes.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addPreEmitPass(PassManagerBase &) {
|
2006-09-04 04:14:57 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-10-16 08:25:21 +00:00
|
|
|
|
|
|
|
|
2009-05-30 20:51:52 +00:00
|
|
|
/// addCodeEmitter - This pass should be overridden by the target to add a
|
|
|
|
/// code emitter, if supported. If this is not supported, 'true' should be
|
2009-07-15 22:33:19 +00:00
|
|
|
/// returned.
|
2011-11-16 08:38:26 +00:00
|
|
|
virtual bool addCodeEmitter(PassManagerBase &,
|
2009-07-15 22:33:19 +00:00
|
|
|
JITCodeEmitter &) {
|
2009-05-30 20:51:52 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2007-05-22 18:31:04 +00:00
|
|
|
/// getEnableTailMergeDefault - the default setting for -enable-tail-merge
|
2007-05-22 17:14:46 +00:00
|
|
|
/// on this target. User flag overrides.
|
2007-11-19 20:46:23 +00:00
|
|
|
virtual bool getEnableTailMergeDefault() const { return true; }
|
2001-09-18 12:38:31 +00:00
|
|
|
};
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2001-09-18 12:38:31 +00:00
|
|
|
#endif
|