diff options
Diffstat (limited to 'include/llvm/Target')
| -rw-r--r-- | include/llvm/Target/Mangler.h | 19 | ||||
| -rw-r--r-- | include/llvm/Target/TargetAsmBackend.h | 29 | ||||
| -rw-r--r-- | include/llvm/Target/TargetLowering.h | 7 | ||||
| -rw-r--r-- | include/llvm/Target/TargetLoweringObjectFile.h | 20 | ||||
| -rw-r--r-- | include/llvm/Target/TargetMachine.h | 7 | ||||
| -rw-r--r-- | include/llvm/Target/TargetRegistry.h | 28 | ||||
| -rw-r--r-- | include/llvm/Target/TargetSelectionDAG.td | 2 |
7 files changed, 74 insertions, 38 deletions
diff --git a/include/llvm/Target/Mangler.h b/include/llvm/Target/Mangler.h index 45cbf9da1e4e..a9f3576559d4 100644 --- a/include/llvm/Target/Mangler.h +++ b/include/llvm/Target/Mangler.h @@ -1,4 +1,4 @@ -//===-- llvm/Target/Mangler.h - Self-contained name mangler ----*- C++ -*-===// +//===-- llvm/Target/Mangler.h - Self-contained name mangler -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -23,7 +23,9 @@ class Twine; class Value; class GlobalValue; template <typename T> class SmallVectorImpl; -class MCAsmInfo; +class MCContext; +class MCSymbol; +class TargetData; class Mangler { public: @@ -34,7 +36,8 @@ public: }; private: - const MCAsmInfo &MAI; + MCContext &Context; + const TargetData &TD; /// AnonGlobalIDs - We need to give global values the same name every time /// they are mangled. This keeps track of the number we give to anonymous @@ -47,10 +50,14 @@ private: unsigned NextAnonGlobalID; public: - // Mangler ctor - if a prefix is specified, it will be prepended onto all - // symbols. - Mangler(const MCAsmInfo &mai) : MAI(mai), NextAnonGlobalID(1) {} + Mangler(MCContext &context, const TargetData &td) + : Context(context), TD(td), NextAnonGlobalID(1) {} + /// getSymbol - Return the MCSymbol for the specified global value. This + /// symbol is the main label that is the address of the global. + MCSymbol *getSymbol(const GlobalValue *GV); + + /// getNameWithPrefix - Fill OutName with the name of the appropriate prefix /// and the specified global variable's name. If the global variable doesn't /// have a name, this fills in a unique name for the global. diff --git a/include/llvm/Target/TargetAsmBackend.h b/include/llvm/Target/TargetAsmBackend.h index dfdabdb7fa3b..35a995f541e2 100644 --- a/include/llvm/Target/TargetAsmBackend.h +++ b/include/llvm/Target/TargetAsmBackend.h @@ -11,6 +11,7 @@ #define LLVM_TARGET_TARGETASMBACKEND_H namespace llvm { +class MCSection; class Target; /// TargetAsmBackend - Generic interface to target specific assembler backends. @@ -28,6 +29,34 @@ public: const Target &getTarget() const { return TheTarget; } + /// hasAbsolutizedSet - Check whether this target "absolutizes" + /// assignments. That is, given code like: + /// a: + /// ... + /// b: + /// tmp = a - b + /// .long tmp + /// will the value of 'tmp' be a relocatable expression, or the assembly time + /// value of L0 - L1. This distinction is only relevant for platforms that + /// support scattered symbols, since in the absence of scattered symbols (a - + /// b) cannot change after assembly. + virtual bool hasAbsolutizedSet() const { return false; } + + /// hasScatteredSymbols - Check whether this target supports scattered + /// symbols. If so, the assembler should assume that atoms can be scattered by + /// the linker. In particular, this means that the offsets between symbols + /// which are in distinct atoms is not known at link time, and the assembler + /// must generate fixups and relocations appropriately. + /// + /// Note that the assembler currently does not reason about atoms, instead it + /// assumes all temporary symbols reside in the "current atom". + virtual bool hasScatteredSymbols() const { return false; } + + /// doesSectionRequireSymbols - Check whether the given section requires that + /// all symbols (even temporaries) have symbol table entries. + virtual bool doesSectionRequireSymbols(const MCSection &Section) const { + return false; + } }; } // End llvm namespace diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 5bc1c0e60927..b19c20af346f 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -323,13 +323,6 @@ public: return false; } - /// getWidenVectorType: given a vector type, returns the type to widen to - /// (e.g., v7i8 to v8i8). If the vector type is legal, it returns itself. - /// If there is no vector type that we want to widen to, returns MVT::Other - /// When and were to widen is target dependent based on the cost of - /// scalarizing vs using the wider vector type. - virtual EVT getWidenVectorType(EVT VT) const; - /// isFPImmLegal - Returns true if the target can instruction select the /// specified FP immediate natively. If false, the legalizer will materialize /// the FP immediate as a load from a constant pool. diff --git a/include/llvm/Target/TargetLoweringObjectFile.h b/include/llvm/Target/TargetLoweringObjectFile.h index 056efea30caa..6c99598ea6ee 100644 --- a/include/llvm/Target/TargetLoweringObjectFile.h +++ b/include/llvm/Target/TargetLoweringObjectFile.h @@ -22,11 +22,12 @@ namespace llvm { class MachineModuleInfo; class Mangler; class MCAsmInfo; + class MCContext; class MCExpr; class MCSection; class MCSectionMachO; class MCSymbol; - class MCContext; + class MCStreamer; class GlobalValue; class TargetMachine; @@ -197,17 +198,20 @@ public: return 0; } - /// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a reference + /// getExprForDwarfGlobalReference - Return an MCExpr to use for a reference /// to the specified global variable from exception handling information. /// virtual const MCExpr * - getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, - MachineModuleInfo *MMI, unsigned Encoding) const; - - virtual const MCExpr * - getSymbolForDwarfReference(const MCSymbol *Sym, MachineModuleInfo *MMI, - unsigned Encoding) const; + getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, + MachineModuleInfo *MMI, unsigned Encoding, + MCStreamer &Streamer) const; + /// + const MCExpr * + getExprForDwarfReference(const MCSymbol *Sym, Mangler *Mang, + MachineModuleInfo *MMI, unsigned Encoding, + MCStreamer &Streamer) const; + virtual unsigned getPersonalityEncoding() const; virtual unsigned getLSDAEncoding() const; virtual unsigned getFDEEncoding() const; diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index a7062ac94f35..b239a306761f 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -30,6 +30,7 @@ class TargetJITInfo; class TargetLowering; class TargetFrameInfo; class JITCodeEmitter; +class MCContext; class TargetRegisterInfo; class PassManagerBase; class PassManager; @@ -224,16 +225,18 @@ public: /// implemented with the LLVM target-independent code generator. /// class LLVMTargetMachine : public TargetMachine { + std::string TargetTriple; + protected: // Can only create subclasses. LLVMTargetMachine(const Target &T, const std::string &TargetTriple); +private: /// addCommonCodeGenPasses - Add standard LLVM codegen passes used for /// both emitting to assembly files or machine code output. /// bool addCommonCodeGenPasses(PassManagerBase &, CodeGenOpt::Level, - bool DisableVerify); + bool DisableVerify, MCContext *&OutCtx); -private: virtual void setCodeModelForJIT(); virtual void setCodeModelForStatic(); diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h index a409b621af2b..43738638cf8e 100644 --- a/include/llvm/Target/TargetRegistry.h +++ b/include/llvm/Target/TargetRegistry.h @@ -62,11 +62,9 @@ namespace llvm { const std::string &Features); typedef AsmPrinter *(*AsmPrinterCtorTy)(formatted_raw_ostream &OS, TargetMachine &TM, - MCContext &Ctx, - MCStreamer &Streamer, - const MCAsmInfo *MAI); + MCStreamer &Streamer); typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T, - MCAssembler &A); + const std::string &TT); typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T, const MCAsmInfo &MAI); typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,MCAsmParser &P); @@ -208,11 +206,12 @@ namespace llvm { /// createAsmBackend - Create a target specific assembly parser. /// + /// \arg Triple - The target triple string. /// \arg Backend - The target independent assembler object. - TargetAsmBackend *createAsmBackend(MCAssembler &Backend) const { + TargetAsmBackend *createAsmBackend(const std::string &Triple) const { if (!AsmBackendCtorFn) return 0; - return AsmBackendCtorFn(*this, Backend); + return AsmBackendCtorFn(*this, Triple); } /// createAsmLexer - Create a target specific assembly lexer. @@ -234,13 +233,12 @@ namespace llvm { } /// createAsmPrinter - Create a target specific assembly printer pass. This - /// takes ownership of the MCContext and MCStreamer objects but not the MAI. + /// takes ownership of the MCStreamer object. AsmPrinter *createAsmPrinter(formatted_raw_ostream &OS, TargetMachine &TM, - MCContext &Ctx, MCStreamer &Streamer, - const MCAsmInfo *MAI) const { + MCStreamer &Streamer) const { if (!AsmPrinterCtorFn) return 0; - return AsmPrinterCtorFn(OS, TM, Ctx, Streamer, MAI); + return AsmPrinterCtorFn(OS, TM, Streamer); } const MCDisassembler *createMCDisassembler() const { @@ -587,8 +585,9 @@ namespace llvm { } private: - static TargetAsmBackend *Allocator(const Target &T, MCAssembler &Backend) { - return new AsmBackendImpl(T, Backend); + static TargetAsmBackend *Allocator(const Target &T, + const std::string &Triple) { + return new AsmBackendImpl(T, Triple); } }; @@ -648,9 +647,8 @@ namespace llvm { private: static AsmPrinter *Allocator(formatted_raw_ostream &OS, TargetMachine &TM, - MCContext &Ctx, MCStreamer &Streamer, - const MCAsmInfo *MAI) { - return new AsmPrinterImpl(OS, TM, Ctx, Streamer, MAI); + MCStreamer &Streamer) { + return new AsmPrinterImpl(OS, TM, Streamer); } }; diff --git a/include/llvm/Target/TargetSelectionDAG.td b/include/llvm/Target/TargetSelectionDAG.td index 4365d332c044..c718c86e60ad 100644 --- a/include/llvm/Target/TargetSelectionDAG.td +++ b/include/llvm/Target/TargetSelectionDAG.td @@ -345,6 +345,8 @@ def sint_to_fp : SDNode<"ISD::SINT_TO_FP" , SDTIntToFPOp>; def uint_to_fp : SDNode<"ISD::UINT_TO_FP" , SDTIntToFPOp>; def fp_to_sint : SDNode<"ISD::FP_TO_SINT" , SDTFPToIntOp>; def fp_to_uint : SDNode<"ISD::FP_TO_UINT" , SDTFPToIntOp>; +def f16_to_f32 : SDNode<"ISD::FP16_TO_FP32", SDTIntToFPOp>; +def f32_to_f16 : SDNode<"ISD::FP32_TO_FP16", SDTFPToIntOp>; def setcc : SDNode<"ISD::SETCC" , SDTSetCC>; def select : SDNode<"ISD::SELECT" , SDTSelect>; |
