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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ LLVM_CXX_FLAGS += -DLLVM_VERSION=$(LLVM_VERSION_TIMES_10)
WITH_X86 ?= $(findstring x86, $(LLVM_COMPONENTS))
WITH_ARM ?= $(findstring arm, $(LLVM_COMPONENTS))
WITH_HEXAGON ?= $(findstring hexagon, $(LLVM_COMPONENTS))
ifeq ($(shell test $(LLVM_VERSION_TIMES_10) -ge 170; echo $$?),0)
WITH_RISCV ?= $(findstring riscv, $(LLVM_COMPONENTS))
else
# leave WITH_RISCV undefined
endif
WITH_AARCH64 ?= $(findstring aarch64, $(LLVM_COMPONENTS))
WITH_POWERPC ?= $(findstring powerpc, $(LLVM_COMPONENTS))
WITH_NVPTX ?= $(findstring nvptx, $(LLVM_COMPONENTS))
Expand Down
14 changes: 12 additions & 2 deletions dependencies/llvm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,18 @@ foreach (comp IN LISTS known_components)
string(TOUPPER "TARGET_${comp}" OPTION)
string(TOUPPER "WITH_${comp}" DEFINE)

cmake_dependent_option(${OPTION} "Include ${comp} target" ON
"${comp} IN_LIST LLVM_TARGETS_TO_BUILD" OFF)
if (comp STREQUAL "RISCV" AND LLVM_PACKAGE_VERSION VERSION_LESS 17.0)
# We default the RISCV target to OFF for LLVM versions prior to 17.0;
# it's not clear how robust and well-tested Halide's RISCV codegen
# is with LLVM16, and a great deal of effort is being put into
# improving it in LLVM17... so default to off so that people won't
# hurt themselves too badly.
cmake_dependent_option(${OPTION} "Include ${comp} target" OFF
"${comp} IN_LIST LLVM_TARGETS_TO_BUILD" OFF)
else ()
cmake_dependent_option(${OPTION} "Include ${comp} target" ON
"${comp} IN_LIST LLVM_TARGETS_TO_BUILD" OFF)
endif ()
if (${OPTION} OR Halide_SHARED_LLVM)
message(STATUS "Enabling ${comp} backend")
list(APPEND Halide_LLVM_DEFS $<BUILD_INTERFACE:${DEFINE}>)
Expand Down