[llvm-dev] Subtarget Initialization in <ARCH>TargetMachine constructor

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 23 14:37:01 PDT 2017


On 23 August 2017 at 17:15, Y Song <ys114321 at gmail.com> wrote:
> The following is what I observed:
> Both Subtarget constructor and initAsmInfo will eventually create
> a MCSubtargetInfo, which calls InitMCProcessorInfo.
>
> void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef FS) {
>   FeatureBits = getFeatures(CPU, FS, ProcDesc, ProcFeatures);
>   if (!CPU.empty())
>     CPUSchedModel = &getSchedModelForCPU(CPU);
>   else
>     CPUSchedModel = &MCSchedModel::GetDefaultSchedModel();
> }
>
> If you have -mcpu=help in your command line
> llc -march=<> -mcpu=help ...
>
> The help information will be printed out twice because getFeatures will printout
> the help info if both ProcDesc and ProcFeatures are not empty.
> This is not really elegent. What I am wondering is whether there are other
> side effect of this approach or not. If not, maybe I can live with this
> for a while....

I see what you mean, thanks for the clarification. That seems worth
filing a bug for on https://bugs.llvm.org/, even though it seems
pretty low impact.

Best,

Alex


More information about the llvm-dev mailing list