[Mlir-commits] [mlir] d70254a - [mlir][nvvm] Add missing include to llvm-config.h. (#83998)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 6 01:13:16 PST 2024


Author: Ingo Müller
Date: 2024-03-06T10:13:12+01:00
New Revision: d70254a623d7c23c493cc793756a5a9d758b0a14

URL: https://github.com/llvm/llvm-project/commit/d70254a623d7c23c493cc793756a5a9d758b0a14
DIFF: https://github.com/llvm/llvm-project/commit/d70254a623d7c23c493cc793756a5a9d758b0a14.diff

LOG: [mlir][nvvm] Add missing include to llvm-config.h. (#83998)

This is another follow-up of #83004. `NVVM/Target.cpp` uses the macro
`MLIR_NVPTXCOMPILER_ENABLED`, which is defined in `llvm-config.h` but
did not include that file, yielding a warning when compiled with
`-Wundef`. This PR adds the include.

~~This is another follow-up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_NVPTXCOMPILER_ENABLED`, which the CMake files previously defined
manually.~~

Added: 
    

Modified: 
    mlir/lib/Target/LLVM/NVVM/Target.cpp
    utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index d5b6645631edd6..e31df99ea20d6f 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -22,6 +22,7 @@
 #include "mlir/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.h"
 #include "mlir/Target/LLVMIR/Export.h"
 
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Support/FormatVariadic.h"

diff  --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 7f33f165992213..b6d4927388b854 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -6183,6 +6183,7 @@ cc_library(
         ":config",
         "//llvm:NVPTXCodeGen",
         "//llvm:Support",
+        "//llvm:config",
     ],
 )
 


        


More information about the Mlir-commits mailing list