[libc-commits] [PATCH] D74897: [libc] Add CMake script to check host cpu features

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Feb 26 13:42:17 PST 2020


sivachandra accepted this revision.
sivachandra added a comment.
This revision is now accepted and ready to land.

This has a better top-down flow. I left a few minor comments inline but accepting as I agree with you that we can iterate as required.



================
Comment at: libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake:16
+
+function(check_valid_feature feature)
+  if(NOT ${feature} IN_LIST ALL_CPU_FEATURES)
----------------
Do we really need this function? We only iterate over the `ALL_CPU_FEATURES` list which is a literal list defined in this file.


================
Comment at: libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake:44
+#
+# Creates variables of the form `OPT_<FEATURE>_FLAGS`.
+# OPT_NONE_FLAGS is a special flag for which no feature is needed.
----------------
If you want these flags available in global scope, then may be prefix them with `CPU_FEATURE_OPT_<FEATURE>_FLAGS`?


================
Comment at: libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake:88
+function(_check_host_cpu_feature feature)
+  check_valid_feature(${feature})
+  string(TOLOWER ${feature} lowercase_feature)
----------------
Like above, do we need this call?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74897/new/

https://reviews.llvm.org/D74897





More information about the libc-commits mailing list