Skip to content

Upgrade LLVM JIT #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ dist-mac: dist
./configure --enable-llvm
rm -rf dist
xcrun xcodebuild -scheme "projectM SDL" -configuration Release archive -archivePath build/ProjectM.xcarchive
xcrun xcodebuild -scheme "iProjectM" -configuration Release archive -archivePath build/iTunes.xcarchive
xcrun xcodebuild -scheme "Music Plugin" -configuration Release archive -archivePath build/iTunes.xcarchive
mkdir -p dist
# mv build/ProjectM.xcarchive/Products/Applications/projectM\ SDL.app dist/
mv src/projectM-iTunes/iTunes\ Visualizer.pkg dist/iTunes-plugin-macOS.pkg
mv src/projectM-iTunes/Music\ Visualizer\ Plugin.pkg dist/Music-plugin-macOS.pkg
mv src/projectM-sdl/projectM\ SDL.pkg dist/projectM-macOS.pkg
mv projectM-*.tar.gz dist/
@echo "Success!\nBuilt iTunes plugin installer and SDL apps in dist/"
Expand Down
2 changes: 1 addition & 1 deletion projectM.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/libprojectM/MilkdropPresetFactory/Expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1415,10 +1415,13 @@ Expr *Expr::jit(Expr *root, std::string name)
std::vector<Type *> arg_typess;
arg_typess.push_back(IntegerType::get(Context,32));
arg_typess.push_back(IntegerType::get(Context,32));
Constant* c = jitx.module->getOrInsertFunction<Type*>("Expr_eval",
Type::getFloatTy(Context),
IntegerType::get(Context,32),
IntegerType::get(Context,32));

auto funccallee = jitx.module->getOrInsertFunction<Type*>("Expr_eval",
Type::getFloatTy(Context),
IntegerType::get(Context,32),
IntegerType::get(Context,32));
llvm::Value* c = funccallee.getCallee();

auto *expr_eval_fun = cast<Function>(c);
BasicBlock *BB = BasicBlock::Create(Context, "EntryBlock", expr_eval_fun);
jitx.builder.SetInsertPoint(BB);
Expand Down
4 changes: 2 additions & 2 deletions src/libprojectM/MilkdropPresetFactory/JitContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct JitContext
context(getGlobalContext()), builder(getGlobalContext())
{
floatType = llvm::Type::getFloatTy(context);
module_ptr = llvm::make_unique<llvm::Module>(name, context);
module_ptr = std::make_unique<llvm::Module>(name, context);
module = module_ptr.get();

llvm::FastMathFlags fmf;
Expand All @@ -65,7 +65,7 @@ struct JitContext
// module->setDataLayout(getTargetMachine().createDataLayout());

// Create a new pass manager attached to it.
fpm = llvm::make_unique<llvm::legacy::FunctionPassManager>(module);
fpm = std::make_unique<llvm::legacy::FunctionPassManager>(module);
fpm->add(llvm::createInstructionCombiningPass());
fpm->add(llvm::createReassociatePass());
fpm->add(llvm::createGVNPass());
Expand Down
Loading