]> granicus.if.org Git - clang/commitdiff
Change the X86 datalayout to add three address spaces for 32 bit signed,
authorAmy Huang <akhuang@google.com>
Tue, 27 Aug 2019 17:46:53 +0000 (17:46 +0000)
committerAmy Huang <akhuang@google.com>
Tue, 27 Aug 2019 17:46:53 +0000 (17:46 +0000)
32 bit unsigned, and 64 bit pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370083 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
lib/Basic/Targets/OSTargets.h
lib/Basic/Targets/X86.h
test/CodeGen/Inputs/thinlto-multi-module.ll
test/CodeGen/Inputs/thinlto_backend.ll
test/CodeGen/Inputs/thinlto_backend_local_name_conflict1.ll
test/CodeGen/Inputs/thinlto_backend_local_name_conflict2.ll
test/CodeGen/iamcu-abi.c
test/CodeGen/target-data.c
test/CodeGen/thinlto-diagnostic-handler-remarks-with-hotness.ll
test/CodeGen/thinlto-distributed-backend-skip.ll
test/CodeGen/thinlto-distributed-cfi-devirt.ll
test/CodeGen/thinlto-distributed-cfi.ll
test/CodeGen/thinlto-distributed.ll
test/CodeGen/thinlto-multi-module.ll
test/CodeGen/thinlto_backend.ll
test/CodeGen/thinlto_backend_local_name_conflict.ll

index da22e6508c60123fe6203f91a794e761eb5ff2a8..cc72a0a39f30fb42b0b361ec6f962cc191cdc364 100644 (file)
@@ -775,9 +775,11 @@ public:
     if (Triple.getArch() == llvm::Triple::arm) {
       // Handled in ARM's setABI().
     } else if (Triple.getArch() == llvm::Triple::x86) {
-      this->resetDataLayout("e-m:e-p:32:32-i64:64-n8:16:32-S128");
+      this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
+                            "i64:64-n8:16:32-S128");
     } else if (Triple.getArch() == llvm::Triple::x86_64) {
-      this->resetDataLayout("e-m:e-p:32:32-i64:64-n8:16:32:64-S128");
+      this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
+                            "i64:64-n8:16:32:64-S128");
     } else if (Triple.getArch() == llvm::Triple::mipsel) {
       // Handled on mips' setDataLayout.
     } else {
index dd1e7db6c81e53ac45d267c0d4deea8a25d20907..dee342c0d0ee992d0cb2b77da04bb8c99963a447 100644 (file)
@@ -340,7 +340,8 @@ public:
     LongDoubleWidth = 96;
     LongDoubleAlign = 32;
     SuitableAlign = 128;
-    resetDataLayout("e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128");
+    resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-"
+                    "f80:32-n8:16:32-S128");
     SizeType = UnsignedInt;
     PtrDiffType = SignedInt;
     IntPtrType = SignedInt;
@@ -440,7 +441,8 @@ public:
       UseSignedCharForObjCBool = false;
     SizeType = UnsignedLong;
     IntPtrType = SignedLong;
-    resetDataLayout("e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128");
+    resetDataLayout("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-"
+                    "f80:128-n8:16:32-S128");
     HasAlignMac68kSupport = true;
   }
 
@@ -465,9 +467,10 @@ public:
     DoubleAlign = LongLongAlign = 64;
     bool IsWinCOFF =
         getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
-    resetDataLayout(IsWinCOFF
-                        ? "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
-                        : "e-m:e-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
+    resetDataLayout(IsWinCOFF ? "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:"
+                                "64-i64:64-f80:32-n8:16:32-a:0:32-S32"
+                              : "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:"
+                                "64-i64:64-f80:32-n8:16:32-a:0:32-S32");
   }
 };
 
@@ -515,7 +518,8 @@ public:
       : X86_32TargetInfo(Triple, Opts) {
     this->WCharType = TargetInfo::UnsignedShort;
     DoubleAlign = LongLongAlign = 64;
-    resetDataLayout("e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32");
+    resetDataLayout("e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:"
+                    "32-n8:16:32-a:0:32-S32");
   }
 
   void getTargetDefines(const LangOptions &Opts,
@@ -552,7 +556,8 @@ public:
       : X86_32TargetInfo(Triple, Opts) {
     LongDoubleWidth = 64;
     LongDoubleFormat = &llvm::APFloat::IEEEdouble();
-    resetDataLayout("e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32");
+    resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:32-f64:"
+                    "32-f128:32-n8:16:32-a:0:32-S32");
     WIntType = UnsignedInt;
   }
 
@@ -611,10 +616,12 @@ public:
     RegParmMax = 6;
 
     // Pointers are 32-bit in x32.
-    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");
+    resetDataLayout(IsX32 ? "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
+                            "i64:64-f80:128-n8:16:32:64-S128"
+                          : IsWinCOFF ? "e-m:w-p270:32:32-p271:32:32-p272:64:"
+                                        "64-i64:64-f80:128-n8:16:32:64-S128"
+                                      : "e-m:e-p270:32:32-p271:32:32-p272:64:"
+                                        "64-i64:64-f80:128-n8:16:32:64-S128");
 
     // Use fpret only for long double.
     RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble);
@@ -804,7 +811,8 @@ public:
     llvm::Triple T = llvm::Triple(Triple);
     if (T.isiOS())
       UseSignedCharForObjCBool = false;
-    resetDataLayout("e-m:o-i64:64-f80:128-n8:16:32:64-S128");
+    resetDataLayout("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:"
+                    "16:32:64-S128");
   }
 
   bool handleTargetFeatures(std::vector<std::string> &Features,
index e8dc16a8f572aa4115e911cc165406964b7f53ad..e6fe92084ad81dc4070877bc1e5aa411de52278c 100644 (file)
@@ -1,4 +1,4 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @f2() {
index 78678c0c5add2a08eed3604a5ccd21f82ce20ee4..86c410efb5d113732214733a77cc1ecfe923f016 100644 (file)
@@ -1,4 +1,4 @@
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 define void @f2() {
index fb5306fc337ff6b9a48c188792a9dd32d3ecf71c..bec5f67f594dfe57413be01cd94c55cd0fc658a3 100644 (file)
@@ -1,6 +1,6 @@
 ; ModuleID = 'local_name_conflict_var.o'
 source_filename = "local_name_conflict_var.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 @baz = internal global i32 10, align 4
index bf3c262f180bff494965e413cb8c671e30f71359..51cd0bef0955f97407729be11152157739ff4397 100644 (file)
@@ -1,6 +1,6 @@
 ; ModuleID = 'local_name_conflict_var.o'
 source_filename = "local_name_conflict_var.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 @baz = internal global i32 10, align 4
index 897d475d49723a910ae8bdbdf503fcf2cdf0015c..6bb73d20315c164c06caad9dc44341dd793812cc 100644 (file)
@@ -1,9 +1,8 @@
 // RUN: %clang_cc1 -triple i386-pc-elfiamcu -emit-llvm -o - %s | FileCheck %s
 
-// CHECK: target datalayout = "e-m:e-p:32:32-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"
+// CHECK: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:32-f64:32-f128:32-n8:16:32-a:0:32-S32"
 // CHECK: target triple = "i386-pc-elfiamcu"
 
-
 void food(double *d);
 void fooll(long long *ll);
 void fooull(unsigned long long *ull);
index d9efe9f0a8879c0073aece54379be0737a85ffd6..3e4d05436327d6bc1bbd343c8af606da233786e0 100644 (file)
@@ -1,22 +1,22 @@
 // RUN: %clang_cc1 -triple i686-unknown-unknown -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=I686-UNKNOWN %s
-// I686-UNKNOWN: target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
+// I686-UNKNOWN: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
 
 // RUN: %clang_cc1 -triple i686-apple-darwin9 -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=I686-DARWIN %s
-// I686-DARWIN: target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
+// I686-DARWIN: target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:128-n8:16:32-S128"
 
 // RUN: %clang_cc1 -triple i686-unknown-win32 -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=I686-WIN32 %s
-// I686-WIN32: target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+// I686-WIN32: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
 
 // RUN: %clang_cc1 -triple i686-unknown-cygwin -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=I686-CYGWIN %s
-// I686-CYGWIN: target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
+// I686-CYGWIN: target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
 
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=X86_64 %s
-// X86_64: target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+// X86_64: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 
 // RUN: %clang_cc1 -triple xcore-unknown-unknown -emit-llvm -o - %s | \
 // RUN:     FileCheck --check-prefix=XCORE %s
 
 // RUN: %clang_cc1 -triple i686-nacl -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=I686-NACL
-// I686-NACL: target datalayout = "e-m:e-p:32:32-i64:64-n8:16:32-S128"
+// I686-NACL: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-n8:16:32-S128"
 
 // RUN: %clang_cc1 -triple x86_64-nacl -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=X86_64-NACL
-// X86_64-NACL: target datalayout = "e-m:e-p:32:32-i64:64-n8:16:32:64-S128"
+// X86_64-NACL: target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-n8:16:32:64-S128"
 
 // RUN: %clang_cc1 -triple arm-nacl -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=ARM-NACL
index 2d25930e508ba92388332e5d7f82d1f9796acac6..0362786ecdbfca62077b0263157d2ee42b020f26 100644 (file)
@@ -32,7 +32,7 @@
 
 ; CHECK: tinkywinky inlined into main with (cost=0, threshold=337) (hotness: 300)
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-scei-ps4"
 
 declare i32 @patatino()
index d9fa47d23dfc8aaaa4bb2ee24ec3ee23e5600437..d7b8225ee2693db7ae5e4b2073752e20fe9da7ca 100644 (file)
@@ -9,7 +9,7 @@
 ; RUN:   -fthinlto-index=%S/Inputs/thinlto-distributed-backend-skip.bc \
 ; RUN:   -emit-llvm -o - -x ir %t.o | FileCheck %s
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
 ; CHECK: "empty"
index d69b77bbc01067951f3bfe746b167cc3317e6b51..2920cf19c81a94d98b16e631309c140983f3fc60 100644 (file)
@@ -47,7 +47,7 @@
 ; RUN:   -emit-obj -fthinlto-index=%t.o.thinlto.bc -O2 \
 ; RUN:   -o %t.native.o -x ir %t.o
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
 %struct.A = type { i32 (...)** }
index ccd5c241eb81f679d2a5c600ddfb20e3f65a612b..65808fdc015883eaaea07ce6e6301802124a0d8f 100644 (file)
@@ -36,7 +36,7 @@
 ; RUN:   -emit-obj -fthinlto-index=%t.o.thinlto.bc \
 ; RUN:   -o %t.native.o -x ir %t.o
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
 %struct.B = type { %struct.A }
index ae21d7b3e9a3e13feef43192705db3919e57c148..a578aae7e05ff06a5be11cf64c7dd377a91af6a2 100644 (file)
@@ -12,7 +12,7 @@
 ; RUN:   -emit-obj -fthinlto-index=%t.o.thinlto.bc \
 ; RUN:   -o %t.native.o -x ir %t.o
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-grtev4-linux-gnu"
 
 define i32 @main() {
index 385d98c74d944a69d4f56624a965020e911f504d..186b34d2d7e1ba5a53b936306121019ba2d7e274 100644 (file)
@@ -11,7 +11,7 @@
 ; CHECK-OBJ: T f1
 ; CHECK-OBJ: U f2
 
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 declare void @f2()
index 2dd919d5f7de4fcf0af663a72f6464dba1d4a9e1..3546b74b1341d08415424a529ca0c9581d93c422 100644 (file)
@@ -47,7 +47,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-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 declare void @f2()
index cefbc51bf05c744cd3f2a4e802dafc9b3e91d5b2..2e3fe9b504f4a4dd450ae3d4c49fc61a979faea2 100644 (file)
@@ -21,7 +21,7 @@
 
 ; ModuleID = 'local_name_conflict_var_main.o'
 source_filename = "local_name_conflict_var_main.c"
-target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
 ; Function Attrs: noinline nounwind uwtable