Skip to content

How to find out the target triple and target data of the host machine via C bindings? #9371

@thielema

Description

@thielema
mannequin
Bugzilla Link 8999
Version 2.8
OS Linux
Attachments Create a function and optimize it via C bindings
CC @asl,@thielema

Extended Description

Please describe how to find out the information needed to let the optimizer work correct and adapted to the host machine when run via the C bindings to LLVM. I'll attach a C program that creates a small function, that shall be run in the JIT. As far as I understand, if I do not tell the target data to PassManager, then I get only generic optimizations. If I set the target data to something invalid (as in the outcommented AddTargetData) the optimizer even performs silently optimizations that are invalid for the host machine. (See http://llvm.org/bugs/show_bug.cgi?id=6394 for details.) Thus: How do I tell the LLVM optimizer to optimize with respect to the host, where I like to run the function in the JIT later?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions