================
@@ -14266,6 +14277,71 @@ 
CodeGenFunction::EmitAArch64CpuSupports(ArrayRef<StringRef> FeaturesStrs) {
   return Result;
 }
 
+Value *CodeGenFunction::EmitRISCVCpuSupports(ArrayRef<StringRef> FeaturesStrs,
+                                             unsigned &MaxGroupIDUsed) {
+
+  const unsigned FeatureBitSize = llvm::RISCV::RISCVFeatureBitSize;
----------------
preames wrote:

This block of repeating code should be factored out as a static helper.

However, you appear to be missing a very important detail.  This symbol must be 
a weak symbol, and the client code must bail if the weak symbol resolves to 
nullptr.  Otherwise we have a *hard* dependency on the compiler-rt/libgcc 
version as opposed to a soft dependency.  We want this to simply select the 
default implementation if the libgcc version does not support the new feature.

(I'm a bit unclear on the semantics of a weak global vs a weak function.  We 
may want to use a check on one of the symbols instead.)

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

Reply via email to