[Mlir-commits] [mlir] [mlir] Fix some cmake dependencies in LLVMIR Dialect (PR #66956)

Markus Böck llvmlistbot at llvm.org
Wed Sep 20 23:58:14 PDT 2023


zero9178 wrote:

> Could you try changing the NVVM part to this:
> 
> ```
> diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
> index b5e6fbd4baf6..66a38d8ea4a1 100644
> --- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
> +++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
> @@ -49,6 +49,7 @@ add_mlir_dialect_library(MLIRNVVMDialect
>    DEPENDS
>    MLIRNVVMOpsIncGen
>    MLIRNVVMConversionsIncGen
> +  MLIRGPUCompilationAttrInterfacesIncGen
>    intrinsics_gen
>  
>    LINK_COMPONENTS
> @@ -70,6 +71,7 @@ add_mlir_dialect_library(MLIRROCDLDialect
>    DEPENDS
>    MLIRROCDLOpsIncGen
>    MLIRROCDLConversionsIncGen
> +  MLIRGPUCompilationAttrInterfacesIncGen
>    intrinsics_gen
>  
>    LINK_COMPONENTS
> diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
> index 76c043e41ea8..9033194f0fec 100644
> --- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
> +++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
> @@ -17,7 +17,6 @@
>  #include "mlir/Dialect/LLVMIR/NVVMDialect.h"
>  
>  #include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"
> -#include "mlir/Dialect/GPU/IR/GPUDialect.h"
>  #include "mlir/Dialect/Utils/StaticValueUtils.h"
>  #include "mlir/IR/Builders.h"
>  #include "mlir/IR/BuiltinAttributes.h"
> diff --git a/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
> index 32f34a8889af..a9e829716953 100644
> --- a/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
> +++ b/mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
> @@ -16,7 +16,6 @@
>  
>  #include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
>  
> -#include "mlir/Dialect/GPU/IR/GPUDialect.h"
>  #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
>  #include "mlir/IR/Builders.h"
>  #include "mlir/IR/BuiltinTypes.h"
> ```
> 
> NVVM & ROCDL don't require the full `GPUDialect` to be linked, only the header created by `MLIRGPUCompilationAttrInterfacesIncGen` to get generated .

Done. I've also gone ahead and changed the "include"s in both files to only include the header for the compilation interface that is purely used for the promised interface as far as I can tell.

https://github.com/llvm/llvm-project/pull/66956


More information about the Mlir-commits mailing list