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

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 20 17:08:06 PDT 2023


pengfei added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13318-13320
+    Value *Idxs[] = {Builder.getInt32(0), Builder.getInt32(i - 1)};
+    Value *Features = Builder.CreateAlignedLoad(
+        Int32Ty, Builder.CreateGEP(ATy, CpuFeatures2, Idxs),
----------------
MaskRay wrote:
> pengfei wrote:
> > Do we have problem when linking with old version of libgcc?
> If we don't use `__cpu_features2[1..3]`, no problem with older libgcc.
> 
> The way GCC upgraded `__cpu_features2` to an array is compatible with scalar `__cpu_features2`.
I assume GCC seldom links to older libgcc, but there's no guarantee Clang can link to latest libgcc.
And we cannot assume user won't use it once the method provided.
I don't have a good idea for it, but I think we should write the requirement done in release note or somewhere if we cannot find a better way.


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