Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flang/lib/Frontend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ add_flang_library(flangFrontend
LINK_COMPONENTS
Passes
Analysis
BitReader
Extensions
IRPrinter
IRReader
Expand Down
1 change: 1 addition & 0 deletions flang/lib/Optimizer/Dialect/Support/KindMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "flang/Optimizer/Dialect/Support/KindMapping.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/CommandLine.h"

/// Allow the user to set the FIR intrinsic type kind value to LLVM type
Expand Down
5 changes: 0 additions & 5 deletions mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
#include "mlir/Interfaces/ViewLikeInterface.h"
#include "mlir/Support/ThreadLocalCache.h"
#include "llvm/ADT/PointerEmbeddedInt.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"

namespace llvm {
class Type;
Expand Down
2 changes: 0 additions & 2 deletions mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,6 @@ def LLVM_AssumeOp

let builders = [
OpBuilder<(ins "Value":$cond)>,
OpBuilder<(ins "Value":$cond,
"ArrayRef<llvm::OperandBundleDefT<Value>>":$opBundles)>,
OpBuilder<(ins "Value":$cond, "llvm::StringRef":$tag, "ValueRange":$args)>,
OpBuilder<(ins "Value":$cond, "AssumeAlignTag":$tag, "Value":$ptr,
"Value":$align)>,
Expand Down
1 change: 1 addition & 0 deletions mlir/include/mlir/Target/LLVMIR/ModuleImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "mlir/Target/LLVMIR/Import.h"
#include "mlir/Target/LLVMIR/LLVMImportInterface.h"
#include "mlir/Target/LLVMIR/TypeFromLLVM.h"
#include "llvm/IR/Module.h"

namespace llvm {
class BasicBlock;
Expand Down
2 changes: 2 additions & 0 deletions mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#include "mlir/Target/LLVMIR/TypeToLLVM.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/Casting.h"

#include <optional>

using namespace mlir;
Expand Down
3 changes: 0 additions & 3 deletions mlir/lib/Dialect/LLVMIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ add_mlir_dialect_library(MLIRLLVMDialect
intrinsics_gen

LINK_COMPONENTS
AsmParser
BinaryFormat
BitReader
BitWriter
Core

LINK_LIBS PUBLIC
Expand Down
26 changes: 3 additions & 23 deletions mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/Support/Error.h"

#include <numeric>
Expand Down Expand Up @@ -4063,29 +4062,10 @@ void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
/*op_bundle_tags=*/ArrayAttr{});
}

void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
Value cond,
ArrayRef<llvm::OperandBundleDefT<Value>> opBundles) {
SmallVector<ValueRange> opBundleOperands;
SmallVector<Attribute> opBundleTags;
opBundleOperands.reserve(opBundles.size());
opBundleTags.reserve(opBundles.size());

for (const llvm::OperandBundleDefT<Value> &bundle : opBundles) {
opBundleOperands.emplace_back(bundle.inputs());
opBundleTags.push_back(
StringAttr::get(builder.getContext(), bundle.getTag()));
}

auto opBundleTagsAttr = ArrayAttr::get(builder.getContext(), opBundleTags);
return build(builder, state, cond, opBundleOperands, opBundleTagsAttr);
}

void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
Value cond, llvm::StringRef tag, ValueRange args) {
llvm::OperandBundleDefT<Value> opBundle(
tag.str(), SmallVector<Value>(args.begin(), args.end()));
return build(builder, state, cond, opBundle);
return build(builder, state, cond, ArrayRef<ValueRange>(args),
builder.getStrArrayAttr(tag));
}

void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
Expand Down
7 changes: 0 additions & 7 deletions mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,8 @@
#include "mlir/IR/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicsNVPTX.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <optional>
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Operation.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/IR/Type.h"

using namespace mlir;
using namespace ROCDL;
Expand Down
5 changes: 0 additions & 5 deletions mlir/lib/Dialect/LLVMIR/IR/VCIXDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Operation.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/SourceMgr.h"

using namespace mlir;
using namespace vcix;
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Target/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_mlir_library(MLIRTargetLLVM
intrinsics_gen

LINK_COMPONENTS
BitWriter
Core
IPO
IRReader
Expand Down
2 changes: 1 addition & 1 deletion mlir/unittests/Target/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(LLVM_LINK_COMPONENTS nativecodegen)
set(LLVM_LINK_COMPONENTS nativecodegen BitReader)

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)

Expand Down