[LLVMdev] CPU information in the LLVMTargetMachine constructor

Romaric Jodin rjodin at kalray.eu
Thu Apr 16 06:07:23 PDT 2015


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



More information about the llvm-dev mailing list