Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ RUNTIME_CPP_COMPONENTS = \
fake_get_symbol \
fake_thread_pool \
float16_t \
force_include_types \
fuchsia_clock \
fuchsia_host_cpu_count \
fuchsia_yield \
Expand All @@ -773,7 +774,6 @@ RUNTIME_CPP_COMPONENTS = \
linux_host_cpu_count \
linux_yield \
matlab \
metadata \
metal \
metal_objc_arm \
metal_objc_x86 \
Expand Down Expand Up @@ -978,6 +978,8 @@ $(BIN_DIR)/build_halide_h: $(ROOT_DIR)/tools/build_halide_h.cpp
-include $(OBJECTS:.o=.d)
-include $(INITIAL_MODULES:.o=.d)

.SECONDARY:

# Compile generic 32- or 64-bit code
# (The 'nacl' is a red herring. This is just a generic 32-bit little-endian target.)
RUNTIME_TRIPLE_32 = "le32-unknown-nacl-unknown"
Expand Down Expand Up @@ -1136,8 +1138,6 @@ clean:
rm -rf $(DISTRIB_DIR)
rm -rf $(ROOT_DIR)/apps/*/bin

.SECONDARY:

CORRECTNESS_TESTS = $(shell ls $(ROOT_DIR)/test/correctness/*.cpp) $(shell ls $(ROOT_DIR)/test/correctness/*.c)
PERFORMANCE_TESTS = $(shell ls $(ROOT_DIR)/test/performance/*.cpp)
ERROR_TESTS = $(shell ls $(ROOT_DIR)/test/error/*.cpp)
Expand Down
6 changes: 0 additions & 6 deletions src/CodeGen_LLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,6 @@ void CodeGen_LLVM::init_codegen(const std::string &name, bool any_strict_float)

semaphore_t_type = get_llvm_struct_type_by_name(module.get(), "struct.halide_semaphore_t");
internal_assert(semaphore_t_type) << "Did not find halide_semaphore_t in initial module";

semaphore_acquire_t_type = get_llvm_struct_type_by_name(module.get(), "struct.halide_semaphore_acquire_t");
internal_assert(semaphore_acquire_t_type) << "Did not find halide_semaphore_acquire_t in initial module";

parallel_task_t_type = get_llvm_struct_type_by_name(module.get(), "struct.halide_parallel_task_t");
internal_assert(parallel_task_t_type) << "Did not find halide_parallel_task_t in initial module";
}

std::unique_ptr<llvm::Module> CodeGen_LLVM::compile(const Module &input) {
Expand Down
4 changes: 1 addition & 3 deletions src/CodeGen_LLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ class CodeGen_LLVM : public IRVisitor {
*scalar_value_t_type,
*device_interface_t_type,
*pseudostack_slot_t_type,
*semaphore_t_type,
*semaphore_acquire_t_type,
*parallel_task_t_type;
*semaphore_t_type;

// @}

Expand Down
7 changes: 4 additions & 3 deletions src/LLVM_Runtime_Linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ DECLARE_CPP_INITMOD(errors)
DECLARE_CPP_INITMOD(fake_get_symbol)
DECLARE_CPP_INITMOD(fake_thread_pool)
DECLARE_CPP_INITMOD(float16_t)
DECLARE_CPP_INITMOD(force_include_types)
DECLARE_CPP_INITMOD(fuchsia_clock)
DECLARE_CPP_INITMOD(fuchsia_host_cpu_count)
DECLARE_CPP_INITMOD(fuchsia_yield)
Expand All @@ -102,7 +103,6 @@ DECLARE_CPP_INITMOD(linux_clock)
DECLARE_CPP_INITMOD(linux_host_cpu_count)
DECLARE_CPP_INITMOD(linux_yield)
DECLARE_CPP_INITMOD(matlab)
DECLARE_CPP_INITMOD(metadata)
DECLARE_CPP_INITMOD(module_aot_ref_count)
DECLARE_CPP_INITMOD(module_jit_ref_count)
DECLARE_CPP_INITMOD(msan)
Expand Down Expand Up @@ -783,7 +783,7 @@ std::unique_ptr<llvm::Module> link_with_wasm_jit_runtime(llvm::LLVMContext *c, c
modules.push_back(get_initmod_to_string(c, bits_64, debug));
modules.push_back(get_initmod_alignment_32(c, bits_64, debug));
modules.push_back(get_initmod_device_interface(c, bits_64, debug));
modules.push_back(get_initmod_metadata(c, bits_64, debug));
modules.push_back(get_initmod_force_include_types(c, bits_64, debug));
modules.push_back(get_initmod_float16_t(c, bits_64, debug));
modules.push_back(get_initmod_errors(c, bits_64, debug));
modules.push_back(get_initmod_msan_stubs(c, bits_64, debug));
Expand Down Expand Up @@ -1014,7 +1014,6 @@ std::unique_ptr<llvm::Module> get_initial_module_for_target(Target t, llvm::LLVM

modules.push_back(get_initmod_allocation_cache(c, bits_64, debug));
modules.push_back(get_initmod_device_interface(c, bits_64, debug));
modules.push_back(get_initmod_metadata(c, bits_64, debug));
modules.push_back(get_initmod_float16_t(c, bits_64, debug));
modules.push_back(get_initmod_errors(c, bits_64, debug));

Expand Down Expand Up @@ -1220,6 +1219,8 @@ std::unique_ptr<llvm::Module> get_initial_module_for_target(Target t, llvm::LLVM
modules.push_back(get_initmod_runtime_api(c, bits_64, debug));
}

modules.push_back(get_initmod_force_include_types(c, bits_64, debug));

link_modules(modules, t);

if (t.os == Target::Windows &&
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set(RUNTIME_CPP
fake_get_symbol
fake_thread_pool
float16_t
force_include_types
fuchsia_clock
fuchsia_host_cpu_count
fuchsia_yield
Expand All @@ -37,7 +38,6 @@ set(RUNTIME_CPP
linux_host_cpu_count
linux_yield
matlab
metadata
metal
metal_objc_arm
metal_objc_x86
Expand Down
24 changes: 24 additions & 0 deletions src/runtime/force_include_types.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "HalideRuntime.h"
#include "runtime_internal.h"

extern "C" struct mxArray { int32_t unused; };

namespace Halide {
namespace Runtime {
namespace Internal {

struct AllTheTypes {
halide_filter_metadata_t a;
halide_filter_argument_t b;
halide_scalar_value_t c;
halide_semaphore_t d;
mxArray e;
};

WEAK void halide_unused_force_include_types() {
static __attribute__((used)) AllTheTypes a;
}

} // namespace Internal
} // namespace Runtime
} // namespace Halide
16 changes: 0 additions & 16 deletions src/runtime/metadata.cpp

This file was deleted.

3 changes: 3 additions & 0 deletions src/runtime/runtime_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
// Can be generated via the following:
// cat src/runtime/runtime_internal.h src/runtime/HalideRuntime*.h | grep "^[^ ][^(]*halide_[^ ]*(" | grep -v '#define' | sed "s/[^(]*halide/halide/" | sed "s/(.*//" | sed "s/^h/ \(void *)\&h/" | sed "s/$/,/" | sort | uniq

extern "C" void halide_unused_force_include_types();

extern "C" __attribute__((used)) void *halide_runtime_api_functions[] = {
(void *)&halide_buffer_copy,
(void *)&halide_buffer_to_string,
Expand Down Expand Up @@ -210,4 +212,5 @@ extern "C" __attribute__((used)) void *halide_runtime_api_functions[] = {
(void *)&halide_d3d12compute_finalize_kernels,
(void *)&halide_d3d12compute_release_context,
(void *)&halide_d3d12compute_run,
(void *)&halide_unused_force_include_types,
};