diff options
| author | Amy Huang <akhuang@google.com> | 2019-09-18 22:15:58 +0000 |
|---|---|---|
| committer | Amy Huang <akhuang@google.com> | 2019-09-18 22:15:58 +0000 |
| commit | 68eae4985995f06a8bbfadb9cf420a66cbfbe04a (patch) | |
| tree | 158931587ca48c37796bb118c489590918548b19 /llvm/lib/Target | |
| parent | e40ef12bfad0108024d7d3979565096843bb29a7 (diff) | |
| download | bcm5719-llvm-68eae4985995f06a8bbfadb9cf420a66cbfbe04a.tar.gz bcm5719-llvm-68eae4985995f06a8bbfadb9cf420a66cbfbe04a.zip | |
Add AutoUpgrade function to add new address space datalayout string to existing datalayouts.
Summary:
Add function to AutoUpgrade to change the datalayout of old X86 datalayout strings.
This adds "-p270:32:32-p271:32:32-p272:64:64" to X86 datalayouts that are otherwise valid
and don't already contain it.
This also removes the compatibility changes in https://reviews.llvm.org/D66843.
Datalayout change in https://reviews.llvm.org/D64931.
Reviewers: rnk, echristo
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67631
llvm-svn: 372267
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 16 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.h | 3 |
2 files changed, 3 insertions, 16 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 8f3d1870761..9b74a593b18 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -106,8 +106,7 @@ static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { llvm_unreachable("unknown subtarget type"); } -static std::string computeDataLayout(const Triple &TT, - bool AddressSpaces = true) { +static std::string computeDataLayout(const Triple &TT) { // X86 is little endian std::string Ret = "e"; @@ -119,8 +118,7 @@ static std::string computeDataLayout(const Triple &TT, Ret += "-p:32:32"; // Address spaces for 32 bit signed, 32 bit unsigned, and 64 bit pointers. - if (AddressSpaces) - Ret += "-p270:32:32-p271:32:32-p272:64:64"; + Ret += "-p270:32:32-p271:32:32-p272:64:64"; // Some ABIs align 64 bit integers and doubles to 64 bits, others to 32. if (TT.isArch64Bit() || TT.isOSWindows() || TT.isOSNaCl()) @@ -223,8 +221,7 @@ X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT, getEffectiveRelocModel(TT, JIT, RM), getEffectiveX86CodeModel(CM, JIT, TT.getArch() == Triple::x86_64), OL), - TLOF(createTLOF(getTargetTriple())), - DLNoAddrSpaces(computeDataLayout(TT, /*AddressSpaces=*/false)) { + TLOF(createTLOF(getTargetTriple())) { // On PS4, the "return address" of a 'noreturn' call must still be within // the calling function, and TrapUnreachable is an easy way to get that. if (TT.isPS4() || TT.isOSBinFormatMachO()) { @@ -318,13 +315,6 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const { return I.get(); } -bool X86TargetMachine::isCompatibleDataLayout( - const DataLayout &Candidate) const { - // Maintain compatibility with datalayouts that don't have address space - // pointer sizes. - return DL == Candidate || DLNoAddrSpaces == Candidate; -} - //===----------------------------------------------------------------------===// // Command line options for x86 //===----------------------------------------------------------------------===// diff --git a/llvm/lib/Target/X86/X86TargetMachine.h b/llvm/lib/Target/X86/X86TargetMachine.h index aa970376b2a..b999e2e86af 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.h +++ b/llvm/lib/Target/X86/X86TargetMachine.h @@ -30,7 +30,6 @@ class X86RegisterBankInfo; class X86TargetMachine final : public LLVMTargetMachine { std::unique_ptr<TargetLoweringObjectFile> TLOF; mutable StringMap<std::unique_ptr<X86Subtarget>> SubtargetMap; - const DataLayout DLNoAddrSpaces; public: X86TargetMachine(const Target &T, const Triple &TT, StringRef CPU, @@ -53,8 +52,6 @@ public: TargetLoweringObjectFile *getObjFileLowering() const override { return TLOF.get(); } - - bool isCompatibleDataLayout(const DataLayout &Candidate) const override; }; } // end namespace llvm |

