-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[MLIR] Avoid #include OMPIRBuilder.h #151302
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] Avoid #include OMPIRBuilder.h #151302
Conversation
@llvm/pr-subscribers-mlir @llvm/pr-subscribers-mlir-llvm Author: Michael Kruse (Meinersbur) Changes
Since its inclusion in #147069, additional indirect dependencies on headers included by Reported-by: fabrizio-indirli Full diff: https://github.com/llvm/llvm-project/pull/151302.diff 2 Files Affected:
diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
index f3f73f49f199a..f0bd5245a7d41 100644
--- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
@@ -25,11 +25,12 @@
#include "mlir/Target/LLVMIR/TypeToLLVM.h"
#include "llvm/ADT/SetVector.h"
-#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
#include "llvm/IR/FPEnv.h"
+#include "llvm/IR/Module.h"
namespace llvm {
class BasicBlock;
+class CanonicalLoopInfo;
class Function;
class IRBuilderBase;
class OpenMPIRBuilder;
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index cffe310c468c4..52cd0cec0c800 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -30,6 +30,7 @@
#include "mlir/IR/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/TypeSwitch.h"
+#include "llvm/IR/IRBuilder.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
|
The sanizer bots are reporting a missing declaration: ``` In file included from /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp:17: In file included from /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h:26: /home/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h:318:34: error: no type named 'CallBase' in namespace 'llvm' 318 | llvm::CallBase *call, | ~~~~~~^ 1 error generated. ``` https://lab.llvm.org/buildbot/#/builders/94/builds/9340 https://lab.llvm.org/buildbot/#/builders/24/builds/11029 https://lab.llvm.org/buildbot/#/builders/169/builds/13454 https://lab.llvm.org/buildbot/#/builders/25/builds/10250 PR #151302 removed some indirect header #includes which had to be includes explicitly. I do not know why this particular error only occurs with the sanitizer buildbots. Fix by adding a forward declaration.
Thank you! |
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
can be replaced with forward-declarations ofOpenMPIRBuilder
andCanonicalLoopInfo
. This also avoids a dependency toomp_gen
of the LLVMFrontendOpenMP component which is included indirectly inOMPIRBuilder.h
.Since its inclusion in #147069, additional indirect dependencies on headers included by
OMPIRBuilder.h
were introduced as well. These are now included directly.Reported-by: fabrizio-indirli
See #147069 (comment)