Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir][nvvm] Add missing include to llvm-config.h. #83998

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

ingomueller-net
Copy link
Contributor

@ingomueller-net ingomueller-net commented Mar 5, 2024

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.

`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.
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 5, 2024

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir

Author: Ingo Müller (ingomueller-net)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/83998.diff

2 Files Affected:

  • (modified) mlir/lib/Target/LLVM/NVVM/Target.cpp (+1)
  • (modified) utils/bazel/llvm-project-overlay/mlir/BUILD.bazel (+1)
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 8a8dd6e10c48aa..e917d310415f35 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -6182,6 +6182,7 @@ cc_library(
         ":config",
         "//llvm:NVPTXCodeGen",
         "//llvm:Support",
+        "//llvm:config",
     ],
 )
 

@ingomueller-net ingomueller-net changed the title [mlir][nvvm] Add missing include to llvm-config.h. [mlir][nvvm] Expose MLIR_NVPTXCOMPILER_ENABLED in mlir-config.h. Mar 5, 2024
@ingomueller-net ingomueller-net force-pushed the llvm-config-dependency branch 2 times, most recently from 3923208 to bb6858e Compare March 5, 2024 12:39
@ingomueller-net ingomueller-net changed the title [mlir][nvvm] Expose MLIR_NVPTXCOMPILER_ENABLED in mlir-config.h. [mlir][nvvm] Add missing include to llvm-config.h. Mar 5, 2024
@ingomueller-net
Copy link
Contributor Author

Sorry for the noise. There are actually two unrelated changes to this file, one related to LLVM config (this PR) and one related to MLIR config (#84007) and I got confused by the two...

@ingomueller-net ingomueller-net merged commit d70254a into llvm:main Mar 6, 2024
10 checks passed
@ingomueller-net ingomueller-net deleted the llvm-config-dependency branch March 6, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants