Need to EmitAttributes after get the correct feature bit.
Aside: RTS.emitTargetAttributes(*STI); just uses the last FeatureBits set by setFeatureBits (in RISCVAsmPrinter::runOnMachineFunction). If you have two functions with target features, the last wins.
So in practice the string is likely inferred from whatever the last __attribute__((target(...))). Using the default for the rest functions seems to make more sense.
In the LTO case, I think encoding the feature bits as module flag metadata probably makes sense, but we may need a new merge behavior (see "Max" behavior from D33418 for an example). In the absence of a better behavior, picking the first is probably not-so-bad and will give something which is immediately usable.