Hey there,
Been googling but can't find. Thought to ask the wizards.
The LLVM interpreter. I am creating a simple wrapper around it to run
a script. The program after linking is about 25 megs stripped of
debug symbols.
This seems a bit large.
Is it possible that this could somehow to be drastically reduced?
Is it worth going and trying to rip things out?
The code which instantiates the interpreter is here:
/*
* llvmscriptdemp.cpp - Example LLVM 'script'. Integrates LLVM bitcode with
* native C++.
*
* Written in 2011 by David C. Bishop <[email protected] >
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain
* worldwide. This software is distributed without any warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#include <string>
#include <memory>
#include <iostream>
#include <limits.h>
#include <llvm/IR/LLVMContext.h>
This file has been truncated. show original
Any help/advice/etc, greatly appreciated.
-tim
I have been able to get the executable down to 7 megs.
By:
auto ee = llvm::Interpreter::create(std::unique_ptr<Module>(mo));
and changing the linker flags.
I would like to get it down to a meg or less.
-tim
This is for a release build of LLVM?
or a debug build?
Hi
Not sure what your use case is but you might be interested in VMIR - https://github.com/andoma/vmir
VMIR does bitcode interpretion of bitcode and suboptimal-but-better-than-nothing-JIT on ARM
The stripped binary is around 170kb on x86_64. It’s still in its early stages so it might not
suit your needs but, as the README says, it can run all of the gcc-torture tests at all opt-levels.
You can contact me off-list if you want to know more.