[flang-commits] [clang] [flang] [flang] Emit target features for PPC (PR #169860)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Fri Nov 28 09:18:15 PST 2025


kkwli wrote:

> While it makes sense to me that target features are set-up and emitted for PPC, I do not get why the way is done has to be modified in a custom way for PPC (see inline comments). I am not saying the changes are not needed, I just do not understand why it is only needed for PPC.
> 
> Can you explain what is not going as expected if you where to not add the new targetFeatureStr and set-it up in getExplicitAndImplicitPPCTargetFeatures?

@jeanPerier Thanks for the review. The issue I encounter is in `CompilerInstance::setUpTargetMachine` the call to `createTargetMachine` adds some extra features by `computeFSAdditions`. The extra features are not part of what clang emits. One of my requirements is to emit an identical list so that LTO can take advantage of. My approach is to preserve the list return from `llvm::PPC::getPPCDefaultTargetFeatures` and to use it for the call to  `fir::setTargetFeatures` in `Fortran::lower::LoweringBridge::LoweringBridge`. The reason to have the list `targetFeatureStr` in `TargetOptions` is to be closer to `featuresAsWritten` which is of similar nature.

https://github.com/llvm/llvm-project/pull/169860


More information about the flang-commits mailing list