[clang] a5040d5 - [SytemZ] Disable vector ABI when using option -march=arch[8|9|10]

Kai Nacke via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 10 01:20:11 PST 2020


Author: Kai Nacke
Date: 2020-02-10T04:14:05-05:00
New Revision: a5040d5ec97ecac9940275eb59175f0bdbd26ab4

URL: https://github.com/llvm/llvm-project/commit/a5040d5ec97ecac9940275eb59175f0bdbd26ab4
DIFF: https://github.com/llvm/llvm-project/commit/a5040d5ec97ecac9940275eb59175f0bdbd26ab4.diff

LOG: [SytemZ] Disable vector ABI when using option -march=arch[8|9|10]

When specifying -march=arch[8|9|10], those CPU types do NOT support
the vector extension. In this case the vector ABI must be disabled.
The generated data layout should NOT contain 64-v128.

Reviewers: uweigand

Differential Revision: https://reviews.llvm.org/D74146

Added: 
    

Modified: 
    clang/test/CodeGen/target-data.c
    llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/target-data.c b/clang/test/CodeGen/target-data.c
index 2c2243c03a6a..e49f8453e360 100644
--- a/clang/test/CodeGen/target-data.c
+++ b/clang/test/CodeGen/target-data.c
@@ -193,6 +193,18 @@
 
 // RUN: %clang_cc1 -triple s390x-unknown -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu z10 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch8 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu z196 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch9 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu zEC12 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
+// RUN: %clang_cc1 -triple s390x-unknown -target-cpu arch10 -o - -emit-llvm %s | \
+// RUN: FileCheck %s -check-prefix=SYSTEMZ
 // RUN: %clang_cc1 -triple s390x-unknown -target-cpu z13 -target-feature +soft-float -o - -emit-llvm %s | \
 // RUN: FileCheck %s -check-prefix=SYSTEMZ
 // SYSTEMZ: target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-a:8:16-n32:64"

diff  --git a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
index 0f319baff5a6..8a63ffe9e907 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
@@ -42,7 +42,8 @@ static bool UsesVectorABI(StringRef CPU, StringRef FS) {
   bool VectorABI = true;
   bool SoftFloat = false;
   if (CPU.empty() || CPU == "generic" ||
-      CPU == "z10" || CPU == "z196" || CPU == "zEC12")
+      CPU == "z10" || CPU == "z196" || CPU == "zEC12" ||
+      CPU == "arch8" || CPU == "arch9" || CPU == "arch10")
     VectorABI = false;
 
   SmallVector<StringRef, 3> Features;


        


More information about the cfe-commits mailing list