[clang] [PowerPC][RFC] Make power9-vector indicate isa-3.0 and power9-altivec (PR #86905)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 20:30:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-powerpc

Author: Kai Luo (bzEq)

<details>
<summary>Changes</summary>

This is to address https://github.com/llvm/llvm-project/issues/84703. However this might not be a long-term solution in my view.

---
Full diff: https://github.com/llvm/llvm-project/pull/86905.diff


1 Files Affected:

- (modified) clang/lib/Basic/Targets/PPC.cpp (+3) 


``````````diff
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index aebe51bfa4daad..14caa1898a9eb8 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -597,6 +597,7 @@ bool PPCTargetInfo::initFeatureMap(
                                           .Default(false);
 
   Features["isa-v30-instructions"] =
+      llvm::is_contained(FeaturesVec, "+power9-vector") or
       llvm::StringSwitch<bool>(CPU).Case("pwr9", true).Default(false);
 
   Features["quadword-atomics"] =
@@ -605,6 +606,8 @@ bool PPCTargetInfo::initFeatureMap(
                                        .Case("pwr8", true)
                                        .Default(false);
 
+  Features["power9-altivec"] = llvm::is_contained(FeaturesVec, "+power9-vector");
+
   // Power10 includes all the same features as Power9 plus any features specific
   // to the Power10 core.
   if (CPU == "pwr10" || CPU == "power10") {

``````````

</details>


https://github.com/llvm/llvm-project/pull/86905


More information about the cfe-commits mailing list