ilinpv added inline comments.

================
Comment at: compiler-rt/lib/builtins/cpu_model.c:1379
 
+void init_cpu_features_resolver(unsigned long hwcap, const __ifunc_arg_t *arg) 
{
+  if (__aarch64_cpu_features.features)
----------------
ilinpv wrote:
> MaskRay wrote:
> > It seems that we don't need the `_constructor` function. We can just move 
> > the 
> > 
> > ```
> > #if defined(__ANDROID__)
> >   // ifunc resolvers don't have hwcaps in arguments on Android API lower
> >   // than 30. In this case set detection done and keep all CPU features
> >   // unsupported (zeros).
> >   if (android_get_device_api_level() < 30) {
> >     setCPUFeature(FEAT_MAX);
> >     return;
> >   }
> > ```
> > 
> > logic to init_cpu_features_resolver
> We don't need this "Android API check and return" in 
> init_cpu_features_resolver when it is called from constructor 
> ##init_cpu_features## where hwcaps are obtained through getauxval calls.
It seems there is no other way than split it in ##_constructor## and 
##_resolver## parts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158641

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to