[LLVMdev] CPU information in the LLVMTargetMachine constructor

Romaric Jodin rjodin at kalray.eu
Tue Apr 21 05:10:57 PDT 2015


Hi everyone,

I come back to you because I still have my problem.

I would like to have an information on the "CPU" argument of the "LLVMTargetMachine" constructor.
When I'm using llc with "-mcpu", I have it. But when I'm using clang I have nothing.

What should I do?

Best Regards,
Romaric

----- Mail original -----
De: "Romaric Jodin" <rjodin at kalray.eu>
À: "mats petersson" <mats at planetcatfish.com>
Cc: "Nicolas Brunie" <nbrunie at kalray.eu>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
Envoyé: Jeudi 16 Avril 2015 16:44:13
Objet: Re: [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

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list