[PATCH] D158329: [X86] Support arch=x86-64{,-v2,-v3,-v4} for target_clones attribute

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 21:15:52 PDT 2023


erichkeane added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13277
+llvm::Value *
+CodeGenFunction::EmitX86CpuSupports(const uint32_t FeaturesMask[4]) {
   Value *Result = Builder.getTrue();
----------------
Can this be a std::array instead?  The C array is pretty meaningless here.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13314
+      continue;
+    if (!CpuFeatures2) {
+      CpuFeatures2 = CGM.CreateRuntimeVariable(ATy, "__cpu_features2");
----------------
Why is this in the loop?  Is there a good reason to not just always initialize it?  


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:2688
+    if (Arch.consume_front("x86-64")) {
+      if (Arch.empty()) // FEATURE_X86_64_BASELINE 95=2*32+31
+        Mask[2] = 1u << 31;
----------------
Can you clarify the comments here on these?  I'm a little confused by their meaning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158329



More information about the cfe-commits mailing list