[PATCH] D38596: Implement attribute target multiversioning

Hal Finkel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 5 13:19:36 PDT 2017


hfinkel added a comment.

Can you explain briefly what is required of the system in order to support this (is it just ifunc support in the dynamic linker / loader)?

In general, there are a number of places in this patch, at the Sema layer (including in the error messages), that talk about how this is an x86-only feature. As soon as someone adds support for a second architecture, this will cause unnecessary churn (and perhaps miss places resulting in stale comments). Can you create some callbacks, in TargetInfo or similar, so that we can just naturally make this work on other architectures?

> Function templates are NOT supported (not supported in GCC either).

Can you please elaborate on this? I'd like to see this feature, but I don't believe that we should introduce features that artificially force users to choose between good code design and technical capabilities. The fact that GCC does not support this feature on templates seems unfortunate, but not in itself a justification to replicate that restriction. I'm obviously fine with adding template functions in a follow-up commit, but I want to understand whether there's something in the design (of the feature or of your implementation approach) that makes this hard. I wouldn't want this to ship without template support.



================
Comment at: lib/Basic/Targets/X86.cpp:1330
+  // ordering of the GCC Target attribute.
+  const auto TargetArray = {"avx512vpopcntdq",
+                            "avx5124fmaps",
----------------
How are we expected to maintain this array?


https://reviews.llvm.org/D38596





More information about the cfe-commits mailing list