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

Eric Christopher via llvm-dev llvm-dev at lists.llvm.org
Fri Aug 25 15:28:37 PDT 2017


On Wed, Aug 23, 2017 at 2:37 PM Alex Bradbury <asb at asbradbury.org> wrote:

> 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.
>
>
Yeah, this is pretty annoying, but hadn't been fixed yet.

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170825/929ddae1/attachment.html>


More information about the llvm-dev mailing list