diff options
author | Eric Christopher <echristo@gmail.com> | 2017-02-10 04:35:21 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2017-02-10 04:35:21 +0000 |
commit | f6ee1f3d692e6f4f33d4c27f5a811bc39bdbbf94 (patch) | |
tree | a8580189034ecc6a894c4faf0609d7e658b46a50 | |
parent | def60acdf5ff7d5c8807bcf5382de2767e3a8819 (diff) | |
download | bcm5719-llvm-f6ee1f3d692e6f4f33d4c27f5a811bc39bdbbf94.tar.gz bcm5719-llvm-f6ee1f3d692e6f4f33d4c27f5a811bc39bdbbf94.zip |
Temporarily revert "For X86-64 linux and PPC64 linux align int128 to 16 bytes."
until we can get better TargetMachine::isCompatibleDataLayout to compare - otherwise
we can't code generate existing bitcode without a string equality data layout.
This reverts commit r294703.
llvm-svn: 294708
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 50 | ||||
-rw-r--r-- | clang/test/CodeGen/target-data.c | 4 | ||||
-rw-r--r-- | clang/test/CodeGen/thinlto-multi-module.ll | 2 | ||||
-rw-r--r-- | clang/test/CodeGen/thinlto_backend.ll | 2 |
4 files changed, 14 insertions, 44 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index a359ec2088c..f03e7e19248 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -1673,35 +1673,15 @@ public: IntMaxType = SignedLong; Int64Type = SignedLong; - std::string Layout; - - // PPC64LE is little endian. - if (Triple.getArch() == llvm::Triple::ppc64le) - Layout = "e"; - else - Layout = "E"; - - Layout += llvm::DataLayout::getManglingComponent(Triple); - - Layout += "-i64:64"; - - // 128 bit integers are always aligned to 128 bits, but only 64-bit matters, - // because __int128 is only supoprted on 64-bit targets. - // FIXME: See if this is valid on other 64-bit ppc oses. - if (Triple.isOSLinux()) - Layout += "-i128:128"; - - Layout += "-n32:64"; - - resetDataLayout(Layout); - - // PPC64LE started a new ABI. - if (Triple.getArch() == llvm::Triple::ppc64le) + if ((Triple.getArch() == llvm::Triple::ppc64le)) { + resetDataLayout("e-m:e-i64:64-n32:64"); ABI = "elfv2"; - else + } else { + resetDataLayout("E-m:e-i64:64-n32:64"); ABI = "elfv1"; + } - switch (Triple.getOS()) { + switch (getTriple().getOS()) { case llvm::Triple::FreeBSD: LongDoubleWidth = LongDoubleAlign = 64; LongDoubleFormat = &llvm::APFloat::IEEEdouble(); @@ -4601,21 +4581,11 @@ public: Int64Type = IsX32 ? SignedLongLong : SignedLong; RegParmMax = 6; - // Use 128-bit alignment for 128-bit integers in linux. - // FIXME: Figure out if we should change this for other oses. // Pointers are 32-bit in x32. - if (IsX32) { - if (Triple.isOSLinux()) - resetDataLayout( - "e-m:e-p:32:32-i64:64-i128:128-f80:128-n8:16:32:64-S128"); - else - resetDataLayout("e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"); - } else if (IsWinCOFF) - resetDataLayout("e-m:w-i64:64-f80:128-n8:16:32:64-S128"); - else if (Triple.isOSLinux()) - resetDataLayout("e-m:e-i64:64-i128:128-f80:128-n8:16:32:64-S128"); - else - resetDataLayout("e-m:e-i64:64-f80:128-n8:16:32:64-S128"); + resetDataLayout(IsX32 + ? "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128" + : IsWinCOFF ? "e-m:w-i64:64-f80:128-n8:16:32:64-S128" + : "e-m:e-i64:64-f80:128-n8:16:32:64-S128"); // Use fpret only for long double. RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble); diff --git a/clang/test/CodeGen/target-data.c b/clang/test/CodeGen/target-data.c index 8f8b9e1f8b6..1e8ce6a2fd1 100644 --- a/clang/test/CodeGen/target-data.c +++ b/clang/test/CodeGen/target-data.c @@ -100,11 +100,11 @@ // RUN: %clang_cc1 -triple powerpc64-linux -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=PPC64-LINUX -// PPC64-LINUX: target datalayout = "E-m:e-i64:64-i128:128-n32:64" +// PPC64-LINUX: target datalayout = "E-m:e-i64:64-n32:64" // RUN: %clang_cc1 -triple powerpc64le-linux -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=PPC64LE-LINUX -// PPC64LE-LINUX: target datalayout = "e-m:e-i64:64-i128:128-n32:64" +// PPC64LE-LINUX: target datalayout = "e-m:e-i64:64-n32:64" // RUN: %clang_cc1 -triple powerpc-darwin -o - -emit-llvm %s | \ // RUN: FileCheck %s -check-prefix=PPC32-DARWIN diff --git a/clang/test/CodeGen/thinlto-multi-module.ll b/clang/test/CodeGen/thinlto-multi-module.ll index 127426ab3d0..21d28cf44da 100644 --- a/clang/test/CodeGen/thinlto-multi-module.ll +++ b/clang/test/CodeGen/thinlto-multi-module.ll @@ -11,7 +11,7 @@ ; CHECK-OBJ: T f1 ; CHECK-OBJ: U f2 -target datalayout = "e-m:e-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" declare void @f2() diff --git a/clang/test/CodeGen/thinlto_backend.ll b/clang/test/CodeGen/thinlto_backend.ll index e2c7f105e82..ac0b3b76ef7 100644 --- a/clang/test/CodeGen/thinlto_backend.ll +++ b/clang/test/CodeGen/thinlto_backend.ll @@ -31,7 +31,7 @@ ; RUN: %clang -target x86_64-unknown-linux-gnu -O2 -o %t3.o -x ir %t1.o -c -fthinlto-index=%t.thinlto.bc 2>&1 | FileCheck %s -check-prefix=CHECK-ERROR2 ; CHECK-ERROR2: Error loading imported file '{{.*}}': Could not find module summary -target datalayout = "e-m:e-i64:64-i128:128-f80:128-n8:16:32:64-S128" +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" declare void @f2() |