[llvm] [TargetParser][AArch64] Believe runtime feature detection (PR #95694)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 16 02:22:26 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c44d52823b4fe8f3aa98fc034f9fcc69b98ef6a0 1c8afcccf57b0d9336c0468fba68c1e0449736c4 -- llvm/lib/TargetParser/Host.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index 163a1262e2..0cb0419746 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -1967,8 +1967,9 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
   }
 
 #if defined(__aarch64__)
-  // LLVM has decided some AArch64 CPUs have all the instructions they _may_ have, as opposed to
-  // all the instructions they _must_ have, so allow runtime information to correct us on that.
+  // LLVM has decided some AArch64 CPUs have all the instructions they _may_
+  // have, as opposed to all the instructions they _must_ have, so allow runtime
+  // information to correct us on that.
   Features["crypto"] = (crypto == (CAP_AES | CAP_PMULL | CAP_SHA1 | CAP_SHA2));
 #endif
 
@@ -1977,9 +1978,12 @@ bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
 #elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64))
 bool sys::getHostCPUFeatures(StringMap<bool> &Features) {
   // If we're asking the OS at runtime, believe what the OS says
-  Features["neon"] = IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
-  Features["crc"] = IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
-  Features["crypto"] = IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
+  Features["neon"] =
+      IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE);
+  Features["crc"] =
+      IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
+  Features["crypto"] =
+      IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
 
   return true;
 }

``````````

</details>


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


More information about the llvm-commits mailing list