[LLVMdev] Proper values for LLVMCreateTargetMachine

Dmitry Mikushin dmitry at kernelgen.org
Wed Dec 26 15:26:26 PST 2012


Hi Timothy,

https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/Platform.cpp?root=kernelgen&view=markup

In this example either Host or NVPTX target machine is created and then
used for code generation:

https://hpcforge.org/scm/viewvc.php/trunk/src/runtime/CodeGen.cpp?root=kernelgen&view=markup

This example in turn was long ago studied from llc.cpp, I think.

So the basic idea is first to select triple, then create target for this
triple, then create target machine from target, triple and extra
target-specific options.

If you are compiling for native host, default triple would suffice:

Triple triple;
triple.setTriple(sys::getDefaultTargetTriple());

Hope it helps.
- D.

2012/12/26 Timothy Baldridge <tbaldridge at gmail.com>

> I can't seem to get LLVMCreateTargetMachine to work on my box (MBP i7 OS X
> 10.8). What should the values of triple, cpu and features be? I'm just
> looking for a way to get this up and going for now, I don't need specific
> optimizations.
>
> No matter what I send the function, I always get nil back. I'm giving it
> LLVMGetFirstTarget as the target value.
>
> Thanks for the help,
>
> Timothy
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121227/1461320f/attachment.html>


More information about the llvm-dev mailing list