mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
early memcpyopt
This commit is contained in:
@@ -873,7 +873,7 @@ void init_build_context(TargetMetrics *cross_target) {
|
|||||||
// -memcpyopt: MemCpy optimization
|
// -memcpyopt: MemCpy optimization
|
||||||
}
|
}
|
||||||
if (bc->ODIN_DEBUG == false) {
|
if (bc->ODIN_DEBUG == false) {
|
||||||
opt_flags = gb_string_appendc(opt_flags, "-mem2reg -memcpyopt -die ");
|
opt_flags = gb_string_appendc(opt_flags, "-mem2reg -die ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+17
-3
@@ -1506,8 +1506,16 @@ void remove_temp_files(String output_base) {
|
|||||||
i32 exec_llvm_opt(String output_base) {
|
i32 exec_llvm_opt(String output_base) {
|
||||||
#if defined(GB_SYSTEM_WINDOWS)
|
#if defined(GB_SYSTEM_WINDOWS)
|
||||||
// For more passes arguments: http://llvm.org/docs/Passes.html
|
// For more passes arguments: http://llvm.org/docs/Passes.html
|
||||||
|
|
||||||
return system_exec_command_line_app("llvm-opt",
|
return system_exec_command_line_app("llvm-opt",
|
||||||
"\"%.*sbin/opt\" \"%.*s.ll\" -o \"%.*s.bc\" %.*s "
|
"\"%.*sbin/opt\" \"%.*s.ll\" -o \"memcpy_pass_%.*s.bc\" %.*s "
|
||||||
|
"",
|
||||||
|
LIT(build_context.ODIN_ROOT),
|
||||||
|
LIT(output_base), LIT(output_base),
|
||||||
|
LIT(build_context.opt_flags));
|
||||||
|
|
||||||
|
|| system_exec_command_line_app("llvm-opt",
|
||||||
|
"\"%.*sbin/opt\" \"memcpy_pass_%.*s.bc\" -o \"%.*s.bc\" %.*s "
|
||||||
"",
|
"",
|
||||||
LIT(build_context.ODIN_ROOT),
|
LIT(build_context.ODIN_ROOT),
|
||||||
LIT(output_base), LIT(output_base),
|
LIT(output_base), LIT(output_base),
|
||||||
@@ -1515,8 +1523,14 @@ i32 exec_llvm_opt(String output_base) {
|
|||||||
#else
|
#else
|
||||||
// NOTE(zangent): This is separate because it seems that LLVM tools are packaged
|
// NOTE(zangent): This is separate because it seems that LLVM tools are packaged
|
||||||
// with the Windows version, while they will be system-provided on MacOS and GNU/Linux
|
// with the Windows version, while they will be system-provided on MacOS and GNU/Linux
|
||||||
return system_exec_command_line_app("llvm-opt",
|
|
||||||
"opt \"%.*s.ll\" -o \"%.*s.bc\" %.*s "
|
return system_exec_command_line_app("llvm-opt",
|
||||||
|
"opt \"%.*s.ll\" -o \"memcpy_pass_%.*s.bc\" -memcpyopt"
|
||||||
|
"",
|
||||||
|
LIT(output_base), LIT(output_base))
|
||||||
|
|
||||||
|
|| system_exec_command_line_app("llvm-opt",
|
||||||
|
"opt \"memcpy_pass_%.*s.bc\" -o \"%.*s.bc\" %.*s "
|
||||||
"",
|
"",
|
||||||
LIT(output_base), LIT(output_base),
|
LIT(output_base), LIT(output_base),
|
||||||
LIT(build_context.opt_flags));
|
LIT(build_context.opt_flags));
|
||||||
|
|||||||
Reference in New Issue
Block a user