Skip to content

Commit ffcee26

Browse files
authored
[MLIR] Avoid #include OMPIRBuilder.h (#151302)
`#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"` can be replaced with forward-declarations of `OpenMPIRBuilder` and `CanonicalLoopInfo`. This also avoids a dependency to `omp_gen` of the LLVMFrontendOpenMP component which is included indirectly in `OMPIRBuilder.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)
1 parent cf9be97 commit ffcee26

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
#include "mlir/Target/LLVMIR/TypeToLLVM.h"
2626

2727
#include "llvm/ADT/SetVector.h"
28-
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
2928
#include "llvm/IR/FPEnv.h"
29+
#include "llvm/IR/Module.h"
3030

3131
namespace llvm {
3232
class BasicBlock;
33+
class CanonicalLoopInfo;
3334
class Function;
3435
class IRBuilderBase;
3536
class OpenMPIRBuilder;

mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "mlir/IR/Types.h"
3131
#include "llvm/ADT/STLExtras.h"
3232
#include "llvm/ADT/TypeSwitch.h"
33+
#include "llvm/IR/IRBuilder.h"
3334
#include "llvm/Support/Casting.h"
3435
#include "llvm/Support/FormatVariadic.h"
3536
#include "llvm/Support/raw_ostream.h"

mlir/lib/Target/LLVMIR/Dialect/NVVM/LLVMIRToNVVMTranslation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "mlir/Target/LLVMIR/Dialect/NVVM/LLVMIRToNVVMTranslation.h"
1414
#include "mlir/Dialect/LLVMIR/NVVMDialect.h"
1515
#include "mlir/Target/LLVMIR/ModuleImport.h"
16+
#include "llvm/IR/ConstantRange.h"
1617

1718
using namespace mlir;
1819
using namespace mlir::NVVM;

0 commit comments

Comments
 (0)