diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2012-05-24 21:38:21 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2012-05-24 21:38:21 +0000 |
commit | 42a0b48dd3773574f648c19b4d9abafb6b4a4f16 (patch) | |
tree | d9a4399f281c81c89d9a5118795d64fb1d4893f9 /lib | |
parent | 6b31d4ea3610b04d71e1eb38d8fc625eae7b759a (diff) |
Remove the PTX back-end and all of its artifacts (triple, etc.)
This back-end was deprecated in favor of the NVPTX back-end.
NV_CONTRIB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
55 files changed, 1 insertions, 6767 deletions
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 868aa57018..822ada7d9b 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -38,8 +38,6 @@ const char *Triple::getArchTypeName(ArchType Kind) { case x86_64: return "x86_64"; case xcore: return "xcore"; case mblaze: return "mblaze"; - case ptx32: return "ptx32"; - case ptx64: return "ptx64"; case nvptx: return "nvptx"; case nvptx64: return "nvptx64"; case le32: return "le32"; @@ -76,8 +74,6 @@ const char *Triple::getArchTypePrefix(ArchType Kind) { case xcore: return "xcore"; - case ptx32: return "ptx"; - case ptx64: return "ptx"; case nvptx: return "nvptx"; case nvptx64: return "nvptx"; case le32: return "le32"; @@ -164,8 +160,6 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) { .Case("x86", x86) .Case("x86-64", x86_64) .Case("xcore", xcore) - .Case("ptx32", ptx32) - .Case("ptx64", ptx64) .Case("nvptx", nvptx) .Case("nvptx64", nvptx64) .Case("le32", le32) @@ -198,8 +192,6 @@ Triple::ArchType Triple::getArchTypeForDarwinArchName(StringRef Str) { .Cases("arm", "armv4t", "armv5", "armv6", Triple::arm) .Cases("armv7", "armv7f", "armv7k", "armv7s", "xscale", Triple::arm) .Case("r600", Triple::r600) - .Case("ptx32", Triple::ptx32) - .Case("ptx64", Triple::ptx64) .Case("nvptx", Triple::nvptx) .Case("nvptx64", Triple::nvptx64) .Case("amdil", Triple::amdil) @@ -223,8 +215,6 @@ const char *Triple::getArchNameForAssembler() { .Cases("armv6", "thumbv6", "armv6") .Cases("armv7", "thumbv7", "armv7") .Case("r600", "r600") - .Case("ptx32", "ptx32") - .Case("ptx64", "ptx64") .Case("nvptx", "nvptx") .Case("nvptx64", "nvptx64") .Case("le32", "le32") @@ -259,8 +249,6 @@ static Triple::ArchType parseArch(StringRef ArchName) { .Case("sparcv9", Triple::sparcv9) .Case("tce", Triple::tce) .Case("xcore", Triple::xcore) - .Case("ptx32", Triple::ptx32) - .Case("ptx64", Triple::ptx64) .Case("nvptx", Triple::nvptx) .Case("nvptx64", Triple::nvptx64) .Case("le32", Triple::le32) @@ -689,7 +677,6 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) { case llvm::Triple::mipsel: case llvm::Triple::nvptx: case llvm::Triple::ppc: - case llvm::Triple::ptx32: case llvm::Triple::r600: case llvm::Triple::sparc: case llvm::Triple::tce: @@ -702,7 +689,6 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) { case llvm::Triple::mips64el: case llvm::Triple::nvptx64: case llvm::Triple::ppc64: - case llvm::Triple::ptx64: case llvm::Triple::sparcv9: case llvm::Triple::x86_64: return 64; @@ -740,7 +726,6 @@ Triple Triple::get32BitArchVariant() const { case Triple::mipsel: case Triple::nvptx: case Triple::ppc: - case Triple::ptx32: case Triple::r600: case Triple::sparc: case Triple::tce: @@ -754,7 +739,6 @@ Triple Triple::get32BitArchVariant() const { case Triple::mips64el: T.setArch(Triple::mipsel); break; case Triple::nvptx64: T.setArch(Triple::nvptx); break; case Triple::ppc64: T.setArch(Triple::ppc); break; - case Triple::ptx64: T.setArch(Triple::ptx32); break; case Triple::sparcv9: T.setArch(Triple::sparc); break; case Triple::x86_64: T.setArch(Triple::x86); break; } @@ -783,7 +767,6 @@ Triple Triple::get64BitArchVariant() const { case Triple::mips64el: case Triple::nvptx64: case Triple::ppc64: - case Triple::ptx64: case Triple::sparcv9: case Triple::x86_64: // Already 64-bit. @@ -793,7 +776,6 @@ Triple Triple::get64BitArchVariant() const { case Triple::mipsel: T.setArch(Triple::mips64el); break; case Triple::nvptx: T.setArch(Triple::nvptx64); break; case Triple::ppc: T.setArch(Triple::ppc64); break; - case Triple::ptx32: T.setArch(Triple::ptx64); break; case Triple::sparc: T.setArch(Triple::sparcv9); break; case Triple::x86: T.setArch(Triple::x86_64); break; } diff --git a/lib/Target/LLVMBuild.txt b/lib/Target/LLVMBuild.txt index 045ab9ea3a..8995080974 100644 --- a/lib/Target/LLVMBuild.txt +++ b/lib/Target/LLVMBuild.txt @@ -16,7 +16,7 @@ ;===------------------------------------------------------------------------===; [common] -subdirectories = ARM CellSPU CppBackend Hexagon MBlaze MSP430 NVPTX Mips PTX PowerPC Sparc X86 XCore +subdirectories = ARM CellSPU CppBackend Hexagon MBlaze MSP430 NVPTX Mips PowerPC Sparc X86 XCore ; This is a special group whose required libraries are extended (by llvm-build) ; with the best execution engine (the native JIT, if available, or the diff --git a/lib/Target/PTX/CMakeLists.txt b/lib/Target/PTX/CMakeLists.txt deleted file mode 100644 index a3be342f77..0000000000 --- a/lib/Target/PTX/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS PTX.td) - -tablegen(LLVM PTXGenAsmWriter.inc -gen-asm-writer) -tablegen(LLVM PTXGenDAGISel.inc -gen-dag-isel) -tablegen(LLVM PTXGenInstrInfo.inc -gen-instr-info) -tablegen(LLVM PTXGenRegisterInfo.inc -gen-register-info) -tablegen(LLVM PTXGenSubtargetInfo.inc -gen-subtarget) -add_public_tablegen_target(PTXCommonTableGen) - -add_llvm_target(PTXCodeGen - PTXAsmPrinter.cpp - PTXISelDAGToDAG.cpp - PTXISelLowering.cpp - PTXInstrInfo.cpp - PTXFPRoundingModePass.cpp - PTXFrameLowering.cpp - PTXMCAsmStreamer.cpp - PTXMCInstLower.cpp - PTXMFInfoExtract.cpp - PTXMachineFunctionInfo.cpp - PTXParamManager.cpp - PTXRegAlloc.cpp - PTXRegisterInfo.cpp - PTXSelectionDAGInfo.cpp - PTXSubtarget.cpp - PTXTargetMachine.cpp - ) - -add_subdirectory(TargetInfo) -add_subdirectory(InstPrinter) -add_subdirectory(MCTargetDesc) - diff --git a/lib/Target/PTX/InstPrinter/CMakeLists.txt b/lib/Target/PTX/InstPrinter/CMakeLists.txt deleted file mode 100644 index b25289347b..0000000000 --- a/lib/Target/PTX/InstPrinter/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMPTXAsmPrinter - PTXInstPrinter.cpp - ) - -add_dependencies(LLVMPTXAsmPrinter PTXCommonTableGen) - diff --git a/lib/Target/PTX/InstPrinter/LLVMBuild.txt b/lib/Target/PTX/InstPrinter/LLVMBuild.txt deleted file mode 100644 index af5d20029f..0000000000 --- a/lib/Target/PTX/InstPrinter/LLVMBuild.txt +++ /dev/null @@ -1,23 +0,0 @@ -;===- ./lib/Target/PTX/InstPrinter/LLVMBuild.txt ---------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Library -name = PTXAsmPrinter -parent = PTX -required_libraries = MC Support -add_to_library_groups = PTX diff --git a/lib/Target/PTX/InstPrinter/Makefile b/lib/Target/PTX/InstPrinter/Makefile deleted file mode 100644 index 0ccfe44078..0000000000 --- a/lib/Target/PTX/InstPrinter/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/PTX/AsmPrinter/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMPTXAsmPrinter - -# Hack: we need to include 'main' ptx target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common - diff --git a/lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp b/lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp deleted file mode 100644 index 1830213267..0000000000 --- a/lib/Target/PTX/InstPrinter/PTXInstPrinter.cpp +++ /dev/null @@ -1,249 +0,0 @@ -//===-- PTXInstPrinter.cpp - Convert PTX MCInst to assembly syntax --------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class prints a PTX MCInst to a .ptx file. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "asm-printer" -#include "PTXInstPrinter.h" -#include "MCTargetDesc/PTXBaseInfo.h" -#include "llvm/MC/MCAsmInfo.h" -#include "llvm/MC/MCExpr.h" -#include "llvm/MC/MCInst.h" -#include "llvm/MC/MCSymbol.h" -#include "llvm/MC/MCInstrInfo.h" -#include "llvm/ADT/APFloat.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" -using namespace llvm; - -#include "PTXGenAsmWriter.inc" - -PTXInstPrinter::PTXInstPrinter(const MCAsmInfo &MAI, - const MCInstrInfo &MII, - const MCRegisterInfo &MRI, - const MCSubtargetInfo &STI) : - MCInstPrinter(MAI, MII, MRI) { - // Initialize the set of available features. - setAvailableFeatures(STI.getFeatureBits()); -} - -void PTXInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { - // Decode the register number into type and offset - unsigned RegSpace = RegNo & 0x7; - unsigned RegType = (RegNo >> 3) & 0x7; - unsigned RegOffset = RegNo >> 6; - - // Print the register - OS << "%"; - - switch (RegSpace) { - default: - llvm_unreachable("Unknown register space!"); - case PTXRegisterSpace::Reg: - switch (RegType) { - default: - llvm_unreachable("Unknown register type!"); - case PTXRegisterType::Pred: - OS << "p"; - break; - case PTXRegisterType::B16: - OS << "rh"; - break; - case PTXRegisterType::B32: - OS << "r"; - break; - case PTXRegisterType::B64: - OS << "rd"; - break; - case PTXRegisterType::F32: - OS << "f"; - break; - case PTXRegisterType::F64: - OS << "fd"; - break; - } - break; - case PTXRegisterSpace::Return: - OS << "ret"; - break; - case PTXRegisterSpace::Argument: - OS << "arg"; - break; - } - - OS << RegOffset; -} - -void PTXInstPrinter::printInst(const MCInst *MI, raw_ostream &O, - StringRef Annot) { - printPredicate(MI, O); - switch (MI->getOpcode()) { - default: - printInstruction(MI, O); - break; - case PTX::CALL: - printCall(MI, O); - } - O << ";"; - printAnnotation(O, Annot); -} - -void PTXInstPrinter::printPredicate(const MCInst *MI, raw_ostream &O) { - // The last two operands are the predicate operands - int RegIndex; - int OpIndex; - - if (MI->getOpcode() == PTX::CALL) { - RegIndex = 0; - OpIndex = 1; - } else { - RegIndex = MI->getNumOperands()-2; - OpIndex = MI->getNumOperands()-1; - } - - int PredOp = MI->getOperand(OpIndex).getImm(); - if (PredOp == PTXPredicate::None) - return; - - if (PredOp == PTXPredicate::Negate) - O << '!'; - else - O << '@'; - - printOperand(MI, RegIndex, O); -} - -void PTXInstPrinter::printCall(const MCInst *MI, raw_ostream &O) { - O << "\tcall.uni\t"; - // The first two operands are the predicate slot - unsigned Index = 2; - unsigned NumRets = MI->getOperand(Index++).getImm(); - - if (NumRets > 0) { - O << "("; - printOperand(MI, Index++, O); - for (unsigned i = 1; i < NumRets; ++i) { - O << ", "; - printOperand(MI, Index++, O); - } - O << "), "; - } - - const MCExpr* Expr = MI->getOperand(Index++).getExpr(); - unsigned NumArgs = MI->getOperand(Index++).getImm(); - - // if the function call is to printf or puts, change to vprintf - if (const MCSymbolRefExpr *SymRefExpr = dyn_cast<MCSymbolRefExpr>(Expr)) { - const MCSymbol &Sym = SymRefExpr->getSymbol(); - if (Sym.getName() == "printf" || Sym.getName() == "puts") { - O << "vprintf"; - } else { - O << Sym.getName(); - } - } else { - O << *Expr; - } - - O << ", ("; - - if (NumArgs > 0) { - printOperand(MI, Index++, O); - for (unsigned i = 1; i < NumArgs; ++i) { - O << ", "; - printOperand(MI, Index++, O); - } - } - O << ")"; -} - -void PTXInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, - raw_ostream &O) { - const MCOperand &Op = MI->getOperand(OpNo); - if (Op.isImm()) { - O << Op.getImm(); - } else if (Op.isFPImm()) { - double Imm = Op.getFPImm(); - APFloat FPImm(Imm); - APInt FPIntImm = FPImm.bitcastToAPInt(); - O << "0D"; - // PTX requires us to output the full 64 bits, even if the number is zero - if (FPIntImm.getZExtValue() > 0) { - O << FPIntImm.toString(16, false); - } else { - O << "0000000000000000"; - } - } else if (Op.isReg()) { - printRegName(O, Op.getReg()); - } else { - assert(Op.isExpr() && "unknown operand kind in printOperand"); - const MCExpr *Expr = Op.getExpr(); - if (const MCSymbolRefExpr *SymRefExpr = dyn_cast<MCSymbolRefExpr>(Expr)) { - const MCSymbol &Sym = SymRefExpr->getSymbol(); - O << Sym.getName(); - } else { - O << *Op.getExpr(); - } - } -} - -void PTXInstPrinter::printMemOperand(const MCInst *MI, unsigned OpNo, - raw_ostream &O) { - // By definition, operand OpNo+1 is an i32imm - const MCOperand &Op2 = MI->getOperand(OpNo+1); - printOperand(MI, OpNo, O); - if (Op2.getImm() == 0) - return; // don't print "+0" - O << "+" << Op2.getImm(); -} - -void PTXInstPrinter::printRoundingMode(const MCInst *MI, unsigned OpNo, - raw_ostream &O) { - const MCOperand &Op = MI->getOperand(OpNo); - assert (Op.isImm() && "Rounding modes must be immediate values"); - switch (Op.getImm()) { - default: - llvm_unreachable("Unknown rounding mode!"); - case PTXRoundingMode::RndDefault: - llvm_unreachable("FP rounding-mode pass did not handle instruction!"); - case PTXRoundingMode::RndNone: - // Do not print anything. - break; - case PTXRoundingMode::RndNearestEven: - O << ".rn"; - break; - case PTXRoundingMode::RndTowardsZero: - O << ".rz"; - break; - case PTXRoundingMode::RndNegInf: - O << ".rm"; - break; - case PTXRoundingMode::RndPosInf: - O << ".rp"; - break; - case PTXRoundingMode::RndApprox: - O << ".approx"; - break; - case PTXRoundingMode::RndNearestEvenInt: - O << ".rni"; - break; - case PTXRoundingMode::RndTowardsZeroInt: - O << ".rzi"; - break; - case PTXRoundingMode::RndNegInfInt: - O << ".rmi"; - break; - case PTXRoundingMode::RndPosInfInt: - O << ".rpi"; - break; - } -} - diff --git a/lib/Target/PTX/InstPrinter/PTXInstPrinter.h b/lib/Target/PTX/InstPrinter/PTXInstPrinter.h deleted file mode 100644 index ea4d50477d..0000000000 --- a/lib/Target/PTX/InstPrinter/PTXInstPrinter.h +++ /dev/null @@ -1,45 +0,0 @@ -//===- PTXInstPrinter.h - Convert PTX MCInst to assembly syntax -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class prints n PTX MCInst to a .ptx file. -// -//===----------------------------------------------------------------------===// - -#ifndef PTXINSTPRINTER_H -#define PTXINSTPRINTER_H - -#include "llvm/MC/MCInstPrinter.h" -#include "llvm/MC/MCSubtargetInfo.h" - -namespace llvm { - -class MCOperand; - -class PTXInstPrinter : public MCInstPrinter { -public: - PTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, - const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); - - virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); - virtual void printRegName(raw_ostream &OS, unsigned RegNo) const; - - // Autogenerated by tblgen. - void printInstruction(const MCInst *MI, raw_ostream &O); - static const char *getRegisterName(unsigned RegNo); - - void printPredicate(const MCInst *MI, raw_ostream &O); - void printCall(const MCInst *MI, raw_ostream &O); - void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); - void printMemOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O); - void printRoundingMode(const MCInst *MI, unsigned OpNo, raw_ostream &O); -}; -} - -#endif - diff --git a/lib/Target/PTX/LLVMBuild.txt b/lib/Target/PTX/LLVMBuild.txt deleted file mode 100644 index 15a1eb5328..0000000000 --- a/lib/Target/PTX/LLVMBuild.txt +++ /dev/null @@ -1,32 +0,0 @@ -;===- ./lib/Target/PTX/LLVMBuild.txt ---------------------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[common] -subdirectories = InstPrinter MCTargetDesc TargetInfo - -[component_0] -type = TargetGroup -name = PTX -parent = Target -has_asmprinter = 1 - -[component_1] -type = Library -name = PTXCodeGen -parent = PTX -required_libraries = Analysis AsmPrinter CodeGen Core MC PTXDesc PTXInfo SelectionDAG Support Target TransformUtils -add_to_library_groups = PTX diff --git a/lib/Target/PTX/MCTargetDesc/CMakeLists.txt b/lib/Target/PTX/MCTargetDesc/CMakeLists.txt deleted file mode 100644 index d1fd74c369..0000000000 --- a/lib/Target/PTX/MCTargetDesc/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_llvm_library(LLVMPTXDesc - PTXMCTargetDesc.cpp - PTXMCAsmInfo.cpp - ) - -add_dependencies(LLVMPTXDesc PTXCommonTableGen) diff --git a/lib/Target/PTX/MCTargetDesc/LLVMBuild.txt b/lib/Target/PTX/MCTargetDesc/LLVMBuild.txt deleted file mode 100644 index 19b80c5ce9..0000000000 --- a/lib/Target/PTX/MCTargetDesc/LLVMBuild.txt +++ /dev/null @@ -1,23 +0,0 @@ -;===- ./lib/Target/PTX/MCTargetDesc/LLVMBuild.txt --------------*- Conf -*--===; -; -; The LLVM Compiler Infrastructure -; -; This file is distributed under the University of Illinois Open Source -; License. See LICENSE.TXT for details. -; -;===------------------------------------------------------------------------===; -; -; This is an LLVMBuild description file for the components in this subdirectory. -; -; For more information on the LLVMBuild system, please see: -; -; http://llvm.org/docs/LLVMBuild.html -; -;===------------------------------------------------------------------------===; - -[component_0] -type = Library -name = PTXDesc -parent = PTX -required_libraries = MC PTXAsmPrinter PTXInfo Support -add_to_library_groups = PTX diff --git a/lib/Target/PTX/MCTargetDesc/Makefile b/lib/Target/PTX/MCTargetDesc/Makefile deleted file mode 100644 index 35f5a7b2e6.. |