[LLVMdev] Set up ExecutionEngine according to actual machine capabilities

Mueller-Roemer, Johannes Sebastian Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de
Mon May 11 01:59:52 PDT 2015


I am currently setting up my Module with

module->setTargetTriple(llvm::sys::getProcessTriple()
#ifdef _WIN32
                               + "-elf"
#endif
);

And my ExecutionEngine with

llvm::EngineBuilder(std::move(module))
                                               .setErrorStr(&err)
                                               .setMCPU(llvm::sys::getHostCPUName())
                                               .create()

This works fine on most machines, however on some virtualized machines this fails because the host CPU name implies AVX, however AVX is in fact disabled, leading to an illegal instruction when running JIT-compiled functions.

Is there a better way to set up the executionengine so that such failure do not occur (but all available features are used)?

--
Johannes S. Mueller-Roemer, MSc
Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-606  |  Fax +49 6151 155-139
johannes.mueller-roemer at igd.fraunhofer.de  |  www.igd.fraunhofer.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150511/00b4db0b/attachment.html>


More information about the llvm-dev mailing list