labrinea wrote:

> In the current patch, it just gets the non-mangled name. And the fact that we 
> get a not-mangled function that uses `feature` without going through a 
> resolver is concerning to me.

I am not sure I understand. Are you refering to the StringSet I added which 
keeps non-mangled names of versioned functions? Those unique non-mangled names 
will be appended to `MultiVersionFuncs` which are iterated by the outer loop of 
`CodeGenModule::emitMultiVersionFunctions()`. Then for each of these 
declarations there is a chain of declarations (mangled function versions), 
which is iterated by the inner loop (forEachMultiversionedFunctionVersion). In 
that inner loop we either create (emit) a version or we just get a reference to 
its declaration. All these mangled versions that are part of the chain and are 
passed to `EmitMultiVersionResolver()` via `Options`. The reason we are using a 
Set is to avoid duplicates in the outer loop, which would result in multiple 
copies of the corresponding basic blocks in the resolver's body. Oh, and btw 
the default versions always have an implicit target_version attribute by the 
time they are processed by emitMultiVersionFunctions (added by the sema 
checker), so they are already mangled. I am not sure I answered. Perhaps we 
could decipher the concern offline.



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

Reply via email to