Romaric Jodin
2015-Apr-16 13:07 UTC
[LLVMdev] CPU information in the LLVMTargetMachine constructor
Hi everyone, I'm working in a company to port LLVM on their own processors. I'm try to support several set of instructions and several architectures. I'm using the "--target" options to choose my set of instructions, and I would like to use the "-mcpu" to choose the architecture of which I want to compile the code. Does it seem right? But at the moment I cannot manage to have the CPU information in my "LLVMTargetMachine" constructor. I have it when I go through llc: clang -emit-llvm ... llc -mcpu=mycpu ... But not when I go directly from clang clang -mcpu=mycpu What should I do to have this information in the constructor using only the clang command? Best Regards, Romaric
mats petersson
2015-Apr-16 14:24 UTC
[LLVMdev] CPU information in the LLVMTargetMachine constructor
I'm fairly sure that you want to use `-march=mycpu`. -- Mats On 16 April 2015 at 14:07, Romaric Jodin <rjodin at kalray.eu> wrote:> Hi everyone, > > I'm working in a company to port LLVM on their own processors. > I'm try to support several set of instructions and several architectures. > > I'm using the "--target" options to choose my set of instructions, and I would like to use the "-mcpu" to choose the architecture of which I want to compile the code. > Does it seem right? > > But at the moment I cannot manage to have the CPU information in my "LLVMTargetMachine" constructor. > I have it when I go through llc: > clang -emit-llvm ... > llc -mcpu=mycpu ... > > But not when I go directly from clang > clang -mcpu=mycpu > > What should I do to have this information in the constructor using only the clang command? > > Best Regards, > Romaric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Romaric Jodin
2015-Apr-16 14:44 UTC
[LLVMdev] CPU information in the LLVMTargetMachine constructor
Hi Mats, What I want is to have a way to get a information on the "CPU" argument of the "LLVMTargetMachine" constructor. At the moment, neither "-mcpu" nor "-march" enable me to do so. But when I'm using the "-mcpu" argument with the llc command, I have the information where I want. Maybe I didn't implement something that should allow me to have the "-march" argument of the clang command in the CPU argument of the TargetMachine constructor. But I cannot manage to find what it is... Thank you in advance, Romaric ----- Mail original ----- De: "mats petersson" <mats at planetcatfish.com> À: "Romaric Jodin" <rjodin at kalray.eu> Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>, "Nicolas Brunie" <nbrunie at kalray.eu> Envoyé: Jeudi 16 Avril 2015 16:24:41 Objet: Re: [LLVMdev] CPU information in the LLVMTargetMachine constructor I'm fairly sure that you want to use `-march=mycpu`. -- Mats On 16 April 2015 at 14:07, Romaric Jodin <rjodin at kalray.eu> wrote:> Hi everyone, > > I'm working in a company to port LLVM on their own processors. > I'm try to support several set of instructions and several architectures. > > I'm using the "--target" options to choose my set of instructions, and I would like to use the "-mcpu" to choose the architecture of which I want to compile the code. > Does it seem right? > > But at the moment I cannot manage to have the CPU information in my "LLVMTargetMachine" constructor. > I have it when I go through llc: > clang -emit-llvm ... > llc -mcpu=mycpu ... > > But not when I go directly from clang > clang -mcpu=mycpu > > What should I do to have this information in the constructor using only the clang command? > > Best Regards, > Romaric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev