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,

I'm fairly sure that you want to use `-march=mycpu`.

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,

----- Mail original -----

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,

----- Mail original -----