[PATCH] D80739: [mlir][GPU] Link relevant LLVM components in GPUCommon instead of test

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 10:23:38 PDT 2020


ftynse created this revision.
ftynse added reviewers: herhut, mehdi_amini.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mgorny.
Herald added a project: LLVM.
ftynse added reviewers: stephenneuendorffer, jpienaar.

D80142 <https://reviews.llvm.org/D80142> restructured MLIR-to-GPU-binary conversion to support multiple
targets. It also modified cmake files to link relevant LLVM components
in test/lib, which broke shared-library builds, and likely made the
conversions unusable outside mlir-opt (or other tools that link in test
library targets). Link these components to GPUCommon instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80739

Files:
  mlir/lib/Conversion/GPUCommon/CMakeLists.txt
  mlir/test/lib/Transforms/CMakeLists.txt


Index: mlir/test/lib/Transforms/CMakeLists.txt
===================================================================
--- mlir/test/lib/Transforms/CMakeLists.txt
+++ mlir/test/lib/Transforms/CMakeLists.txt
@@ -1,21 +1,3 @@
-if (MLIR_CUDA_CONVERSIONS_ENABLED)
-  set(NVPTX_LIBS
-    MC
-    NVPTXCodeGen
-    NVPTXDesc
-    NVPTXInfo
-  )
-endif()
-
-if (MLIR_ROCM_CONVERSIONS_ENABLED)
-  set(AMDGPU_LIBS
-    MC
-    AMDGPUCodeGen
-    AMDGPUDesc
-    AMDGPUInfo
-  )
-endif()
-
 # Exclude tests from libMLIR.so
 add_mlir_library(MLIRTestTransforms
   TestAllReduceLowering.cpp
@@ -50,10 +32,6 @@
   MLIRStandardOpsIncGen
   MLIRTestVectorTransformPatternsIncGen
 
-  LINK_COMPONENTS
-  ${AMDGPU_LIBS}
-  ${NVPTX_LIBS}
-
   LINK_LIBS PUBLIC
   MLIRAffineOps
   MLIRAnalysis
Index: mlir/lib/Conversion/GPUCommon/CMakeLists.txt
===================================================================
--- mlir/lib/Conversion/GPUCommon/CMakeLists.txt
+++ mlir/lib/Conversion/GPUCommon/CMakeLists.txt
@@ -1,3 +1,21 @@
+if (MLIR_CUDA_CONVERSIONS_ENABLED)
+  set(NVPTX_LIBS
+    MC
+    NVPTXCodeGen
+    NVPTXDesc
+    NVPTXInfo
+  )
+endif()
+
+if (MLIR_ROCM_CONVERSIONS_ENABLED)
+  set(AMDGPU_LIBS
+    MC
+    AMDGPUCodeGen
+    AMDGPUDesc
+    AMDGPUInfo
+  )
+endif()
+
 add_mlir_conversion_library(MLIRGPUtoGPURuntimeTransforms
   ConvertLaunchFuncToRuntimeCalls.cpp
   ConvertKernelFuncToBlob.cpp
@@ -8,6 +26,8 @@
 
   LINK_COMPONENTS
   Core
+  ${AMDGPU_LIBS}
+  ${NVPTX_LIBS}
 
   LINK_LIBS PUBLIC
   MLIRGPU


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80739.266931.patch
Type: text/x-patch
Size: 1505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200528/a533eff2/attachment.bin>


More information about the llvm-commits mailing list