https://github.com/jeanPerier commented:

Thanks for the explanation, well it is a bit weird to me that  
`targetMachine->getTargetFeatureString()` is not the single source of truth 
once created (why is it not what LLVM uses in the producer IR?), but that 
problem seems to not be flang specific here.

For the flang part, I am not an expert with the driver, but the fact that the 
compiler instance is modifying the compiler invocation seems a bit reverse to 
me (as I understand it, one invocation can be shared by multiple instances). I 
would welcome some driver expert feedback here like @tblah or @banach-space.

My minimum request on my side would be to avoid having the side effect in 
`getExplicitAndImplicitPPCTargetFeatures`, and to centralize the setting of 
`targetOpts.targetFeatureStr` in `CompilerInstance::setUpTargetMachine` using 
`featuresStr` for the PPC case after the `if (!triple.isPPC())` case.

https://github.com/llvm/llvm-project/pull/169860
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to