================
@@ -4303,21 +4288,15 @@ void CodeGenModule::emitMultiVersionFunctions() {
                 continue;
 
               llvm::Function *Func = createFunction(CurFD, I);
-              StringRef Architecture;
               Feats.clear();
-              if (getTarget().getTriple().isAArch64())
-                TC->getFeatures(Feats, I);
-              else if (getTarget().getTriple().isRISCV()) {
-                StringRef Version = TC->getFeatureStr(I);
-                Feats.push_back(Version);
+              if (getTarget().getTriple().isX86()) {
+                TC->getAddedFeatures(Feats, I);
----------------
phoebewang wrote:

I'm not familar with TargetClones. I saw two test cases in 
https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/attr-target-clones.c
```
inline int __attribute__((target_clones("arch=sandybridge,default,sse4.2")))
foo_inline2(void){ return 0; }

__attribute__((target_clones("default", "arch=x86-64", "arch=x86-64-v2", 
"arch=x86-64-v3", "arch=x86-64-v4")))
int isa_level(int) { return 0; }
```

Is there differece to `I` here? If `I` already split by `,`, what's the reason 
to split it in `getAddedFeatures/getArchitecture`?

https://github.com/llvm/llvm-project/pull/116257
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to