[llvm-dev] Subtarget Initialization in <ARCH>TargetMachine constructor
Y Song via llvm-dev
llvm-dev at lists.llvm.org
Fri Aug 25 15:51:57 PDT 2017
On Fri, Aug 25, 2017 at 3:28 PM, Eric Christopher <echristo at gmail.com> wrote:
>
>
> 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.
Thanks, Eric. Filed a lower priority bug
https://bugs.llvm.org/show_bug.cgi?id=34331
to keep the record.
More information about the llvm-dev
mailing list