[macruby-changes] [4215] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jun 8 23:11:12 PDT 2010
Revision: 4215
http://trac.macosforge.org/projects/ruby/changeset/4215
Author: lsansonetti at apple.com
Date: 2010-06-08 23:11:08 -0700 (Tue, 08 Jun 2010)
Log Message:
-----------
aot: apply standard -O3 passes + inlining on the module before emitting bitcode
Modified Paths:
--------------
MacRuby/trunk/rakelib/builder/options.rb
MacRuby/trunk/vm.cpp
Modified: MacRuby/trunk/rakelib/builder/options.rb
===================================================================
--- MacRuby/trunk/rakelib/builder/options.rb 2010-06-09 04:55:54 UTC (rev 4214)
+++ MacRuby/trunk/rakelib/builder/options.rb 2010-06-09 06:11:08 UTC (rev 4215)
@@ -117,7 +117,7 @@
INSTALL_NAME = File.join(FRAMEWORK_USR_LIB, 'lib' + RUBY_SO_NAME + '.dylib')
ARCHFLAGS = ARCHS.map { |a| '-arch ' + a }.join(' ')
-LLVM_MODULES = "core jit nativecodegen bitwriter bitreader"
+LLVM_MODULES = "core jit nativecodegen bitwriter bitreader ipo"
EXPORTED_SYMBOLS_LIST = "./exported_symbols_list"
OPTZFLAG = "-O#{OPTZ_LEVEL}"
Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp 2010-06-09 04:55:54 UTC (rev 4214)
+++ MacRuby/trunk/vm.cpp 2010-06-09 06:11:08 UTC (rev 4215)
@@ -29,9 +29,11 @@
#include <llvm/Target/TargetOptions.h>
#include <llvm/Target/TargetSelect.h>
#include <llvm/Transforms/Scalar.h>
+#include <llvm/Transforms/IPO.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/PrettyStackTrace.h>
#include <llvm/Support/MemoryBuffer.h>
+#include <llvm/Support/StandardPasses.h>
#include <llvm/Intrinsics.h>
#include <llvm/Bitcode/ReaderWriter.h>
#include <llvm/LLVMContext.h>
@@ -3750,8 +3752,11 @@
// Force a module verification.
rb_verify_module();
- // Optimize the IR.
- GET_CORE()->optimize(f);
+ // Run standard optimization passes on the module.
+ PassManager pm;
+ createStandardModulePasses(&pm, 3, false, true, true, true, true,
+ createFunctionInliningPass());
+ pm.run(*RoxorCompiler::module);
// Dump the bitcode.
std::string err;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100608/0c1edccf/attachment.html>
More information about the macruby-changes
mailing list