Skip to content

Commit ef5b0e2

Browse files
committed
Enable the NVPTX LLVM back-end, and add patches fixing bugs.
Use of the NVPTX back-end is only tested on LLVM 3.9 (and hence depends on #19123), in combination with the CUDAnative.jl package.
1 parent d8e2380 commit ef5b0e2

File tree

4 files changed

+1409
-1
lines changed

4 files changed

+1409
-1
lines changed

deps/llvm.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ LLVM_CFLAGS += $(CFLAGS)
7878
LLVM_CXXFLAGS += $(CXXFLAGS)
7979
LLVM_CPPFLAGS += $(CPPFLAGS)
8080
LLVM_LDFLAGS += $(LDFLAGS)
81-
LLVM_TARGETS := host
81+
ifeq ($(LLVM_USE_CMAKE),1)
82+
LLVM_TARGETS := host;NVPTX
83+
else
84+
LLVM_TARGETS := host,nvptx
85+
endif
8286
LLVM_TARGET_FLAGS := --enable-targets=$(LLVM_TARGETS)
8387
LLVM_CMAKE += -DLLVM_TARGETS_TO_BUILD:STRING="$(LLVM_TARGETS)" -DCMAKE_BUILD_TYPE="$(LLVM_CMAKE_BUILDTYPE)"
8488
LLVM_CMAKE += -DLLVM_TOOLS_INSTALL_DIR=$(shell $(JULIAHOME)/contrib/relative_path.sh $(build_prefix) $(build_depsbindir))
@@ -479,6 +483,10 @@ $(eval $(call LLVM_PATCH,llvm-PR22923)) # Remove for 4.0
479483
$(eval $(call LLVM_PATCH,llvm-r282182)) # Remove for 4.0
480484
$(eval $(call LLVM_PATCH,llvm-arm-fix-prel31))
481485
$(eval $(call LLVM_PATCH,llvm-D25865-cmakeshlib))
486+
# patches for NVPTX
487+
$(eval $(call LLVM_PATCH,llvm-D9168_argument_alignment)) # Remove for 4.0
488+
$(eval $(call LLVM_PATCH,llvm-D23597_sdag_names)) # Dep for D24300, remove for 4.0
489+
$(eval $(call LLVM_PATCH,llvm-D24300_ptx_intrinsics)) # Remove for 4.0
482490
endif # LLVM_VER
483491

484492
ifeq ($(LLVM_VER),3.7.1)

0 commit comments

Comments
 (0)