[Mlir-commits] [mlir] [mlir] support dialect attribute translation to LLVM IR (PR #75309)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Dec 13 02:05:54 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-vector
Author: Oleksandr "Alex" Zinenko (ftynse)
<details>
<summary>Changes</summary>
Extend the `amendOperation` mechanism for translating dialect attributes attached to operations from another dialect when translating MLIR to LLVM IR. Previously, this mechanism would have no knowledge of the LLVM IR instructions created for the given operation, making it impossible for it to perform local modifications such as attaching operation-level metadata. Collect instructions inserted by the LLVM IR builder and pass them to `amendOperation`.
---
Patch is 49.57 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/75309.diff
17 Files Affected:
- (modified) mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h (+14-8)
- (modified) mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h (+108-3)
- (modified) mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/ArmSME/ArmSMEToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp (+2-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp (+3-2)
- (modified) mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp (+3-3)
- (modified) mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp (+47-41)
- (modified) mlir/lib/Target/LLVMIR/Dialect/ROCDL/ROCDLToLLVMIRTranslation.cpp (+3-2)
- (modified) mlir/lib/Target/LLVMIR/Dialect/X86Vector/X86VectorToLLVMIRTranslation.cpp (+1-1)
- (modified) mlir/lib/Target/LLVMIR/ModuleTranslation.cpp (+16-13)
- (modified) mlir/test/Target/LLVMIR/test.mlir (+24)
- (modified) mlir/test/lib/Dialect/Test/TestToLLVMIRTranslation.cpp (+18-4)
``````````diff
diff --git a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
index 0531c0ec953fe2..84aff946531355 100644
--- a/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
+++ b/mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
@@ -18,12 +18,14 @@
#include "mlir/Support/LogicalResult.h"
namespace llvm {
+class Instruction;
class IRBuilderBase;
} // namespace llvm
namespace mlir {
namespace LLVM {
class ModuleTranslation;
+class CapturingIRBuilder;
} // namespace LLVM
/// Base class for dialect interfaces providing translation to LLVM IR.
@@ -40,7 +42,7 @@ class LLVMTranslationDialectInterface
/// Hook for derived dialect interface to provide translation of the
/// operations to LLVM IR.
virtual LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const {
return failure();
}
@@ -48,11 +50,13 @@ class LLVMTranslationDialectInterface
/// Hook for derived dialect interface to act on an operation that has dialect
/// attributes from the derived dialect (the operation itself may be from a
/// different dialect). This gets called after the operation has been
- /// translated. The hook is expected to use moduleTranslation to look up the
- /// translation results and amend the corresponding IR constructs. Does
- /// nothing and succeeds by default.
+ /// translated and accepts as second argument the list of LLVM IR instructions
+ /// that were constructed when translating the operation. The hook is expected
+ /// to use moduleTranslation to look up the translation results and amend the
+ /// corresponding IR constructs. Does nothing and succeeds by default.
virtual LogicalResult
- amendOperation(Operation *op, NamedAttribute attribute,
+ amendOperation(Operation *op, ArrayRef<llvm::Instruction *> instructions,
+ NamedAttribute attribute,
LLVM::ModuleTranslation &moduleTranslation) const {
return success();
}
@@ -68,7 +72,7 @@ class LLVMTranslationInterface
/// Translates the given operation to LLVM IR using the interface implemented
/// by the op's dialect.
virtual LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const {
if (const LLVMTranslationDialectInterface *iface = getInterfaceFor(op))
return iface->convertOperation(op, builder, moduleTranslation);
@@ -78,11 +82,13 @@ class LLVMTranslationInterface
/// Acts on the given operation using the interface implemented by the dialect
/// of one of the operation's dialect attributes.
virtual LogicalResult
- amendOperation(Operation *op, NamedAttribute attribute,
+ amendOperation(Operation *op, ArrayRef<llvm::Instruction *> instructions,
+ NamedAttribute attribute,
LLVM::ModuleTranslation &moduleTranslation) const {
if (const LLVMTranslationDialectInterface *iface =
getInterfaceFor(attribute.getNameDialect())) {
- return iface->amendOperation(op, attribute, moduleTranslation);
+ return iface->amendOperation(op, instructions, attribute,
+ moduleTranslation);
}
return success();
}
diff --git a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
index 3f797f41f10ab0..72d4de332eef69 100644
--- a/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
+++ b/mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
@@ -22,6 +22,7 @@
#include "mlir/Target/LLVMIR/LLVMTranslationInterface.h"
#include "mlir/Target/LLVMIR/TypeToLLVM.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Frontend/OpenMP/OMPIRBuilder.h"
@@ -50,6 +51,108 @@ class DINodeAttr;
class LLVMFuncOp;
class ComdatSelectorOp;
+namespace detail {
+/// A customized inserter for LLVM's IRBuilder that captures all LLVM IR
+/// instructions that are created for future reference.
+///
+/// This is intended to be used with the `CollectionScope` RAII object:
+///
+/// llvm::IRBuilder<..., InstructionCapturingInserter> builder;
+/// {
+/// InstructionCapturingInserter::CollectionScope scope(builder);
+/// // Call IRBuilder methods as usual.
+///
+/// // This will return a list of all instructions created by the builder,
+/// // in order of creation.
+/// builder.getInserter().getCapturedInstructions();
+/// }
+/// // This will return an empty list.
+/// builder.getInserter().getCapturedInstructions();
+///
+/// The capturing functionality is _disabled_ by default for performance
+/// consideration. It needs to be explicitly enabled, which is achieved by
+/// creating a `CollectionScope`.
+class InstructionCapturingInserter : public llvm::IRBuilderCallbackInserter {
+public:
+ /// Constructs the inserter.
+ InstructionCapturingInserter()
+ : llvm::IRBuilderCallbackInserter([this](llvm::Instruction *instruction) {
+ if (LLVM_LIKELY(enabled))
+ capturedInstructions.push_back(instruction);
+ }) {}
+
+ /// Returns the list of LLVM IR instructions captured since the last cleanup.
+ ArrayRef<llvm::Instruction *> getCapturedInstructions() const {
+ return capturedInstructions;
+ }
+
+ /// Clears the list of captured LLVM IR instructions.
+ void clearCapturedInstructions() { capturedInstructions.clear(); }
+
+ /// RAII object enabling the capture of created LLVM IR instructions.
+ class CollectionScope {
+ public:
+ /// Creates the scope for the given inserter.
+ explicit CollectionScope(InstructionCapturingInserter &reference)
+ : reference(reference) {
+ wasEnabled = reference.enabled;
+ if (wasEnabled)
+ previouslyCollectedInstructions.swap(reference.capturedInstructions);
+ reference.enable(true);
+ }
+
+ /// Creates the scope for the given `llvm::IRBuilder`.
+ template <typename Ty,
+ typename = std::enable_if_t<std::is_base_of_v<
+ std::remove_reference_t<
+ decltype(std::declval<Ty &>().getInserter())>,
+ InstructionCapturingInserter>>>
+ explicit CollectionScope(Ty &builder)
+ : CollectionScope(builder.getInserter()) {}
+
+ /// Ends the scope.
+ ~CollectionScope() {
+ previouslyCollectedInstructions.swap(reference.capturedInstructions);
+ // If collection was enabled (likely in another, surrounding scope), keep
+ // the instructions collected in this scope.
+ if (wasEnabled) {
+ llvm::append_range(reference.capturedInstructions,
+ previouslyCollectedInstructions);
+ }
+ reference.enable(wasEnabled);
+ }
+
+ private:
+ /// Back reference to the inserter.
+ InstructionCapturingInserter &reference;
+
+ /// List of instructions in the inserter prior to this scope.
+ SmallVector<llvm::Instruction *> previouslyCollectedInstructions;
+
+ /// Whether the inserter was enabled prior to this scope.
+ bool wasEnabled;
+ };
+
+ void enable(bool enabled) { this->enabled = enabled; }
+
+private:
+ /// List of captured instructions.
+ SmallVector<llvm::Instruction *> capturedInstructions;
+
+ /// Whether the collection is enabled.
+ bool enabled = false;
+};
+} // namespace detail
+
+// A class rather than a "using" declaration to support forward declarations
+// elsewhere.
+class CapturingIRBuilder
+ : public llvm::IRBuilder<llvm::ConstantFolder,
+ detail::InstructionCapturingInserter> {
+public:
+ using IRBuilder::IRBuilder;
+};
+
/// Implementation class for module translation. Holds a reference to the module
/// being translated, and the mappings between the original and the translated
/// functions, basic blocks and values. It is practically easier to hold these
@@ -209,7 +312,7 @@ class ModuleTranslation {
/// PHI nodes are constructed for block arguments but are _not_ connected to
/// the predecessors that may not exist yet.
LogicalResult convertBlock(Block &bb, bool ignoreArguments,
- llvm::IRBuilderBase &builder);
+ CapturingIRBuilder &builder);
/// Gets the named metadata in the LLVM IR module being constructed, creating
/// it if it does not exist.
@@ -299,7 +402,7 @@ class ModuleTranslation {
~ModuleTranslation();
/// Converts individual components.
- LogicalResult convertOperation(Operation &op, llvm::IRBuilderBase &builder);
+ LogicalResult convertOperation(Operation &op, CapturingIRBuilder &builder);
LogicalResult convertFunctionSignatures();
LogicalResult convertFunctions();
LogicalResult convertComdats();
@@ -315,7 +418,9 @@ class ModuleTranslation {
LogicalResult createTBAAMetadata();
/// Translates dialect attributes attached to the given operation.
- LogicalResult convertDialectAttributes(Operation *op);
+ LogicalResult
+ convertDialectAttributes(Operation *op,
+ ArrayRef<llvm::Instruction *> instructions);
/// Translates parameter attributes and adds them to the returned AttrBuilder.
llvm::AttrBuilder convertParameterAttrs(DictionaryAttr paramAttrs);
diff --git a/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp
index 044462d33cfd1f..018246b3622134 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/AMX/AMXToLLVMIRTranslation.cpp
@@ -32,7 +32,7 @@ class AMXDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
Operation &opInst = *op;
#include "mlir/Dialect/AMX/AMXConversions.inc"
diff --git a/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp
index 7098592d506e06..17c16cd00994e3 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/ArmNeon/ArmNeonToLLVMIRTranslation.cpp
@@ -33,7 +33,7 @@ class ArmNeonDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
Operation &opInst = *op;
#include "mlir/Dialect/ArmNeon/ArmNeonConversions.inc"
diff --git a/mlir/lib/Target/LLVMIR/Dialect/ArmSME/ArmSMEToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ArmSME/ArmSMEToLLVMIRTranslation.cpp
index e6ee41188d594a..fd141b52e117cb 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/ArmSME/ArmSMEToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/ArmSME/ArmSMEToLLVMIRTranslation.cpp
@@ -32,7 +32,7 @@ class ArmSMEDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
Operation &opInst = *op;
#include "mlir/Dialect/ArmSME/IR/ArmSMEIntrinsicConversions.inc"
diff --git a/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp
index cd10811b68f028..325d0acc476166 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/ArmSVE/ArmSVEToLLVMIRTranslation.cpp
@@ -32,7 +32,7 @@ class ArmSVEDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
Operation &opInst = *op;
#include "mlir/Dialect/ArmSVE/IR/ArmSVEConversions.inc"
diff --git a/mlir/lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp
index 51c304cfbb8e5f..04894a52a889a3 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp
@@ -25,7 +25,7 @@ class BuiltinDialectLLVMIRTranslationInterface
using LLVMTranslationDialectInterface::LLVMTranslationDialectInterface;
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const override {
return success(isa<ModuleOp>(op));
}
diff --git a/mlir/lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp
index eecc8f1001ca4f..22fac6b93d4ef7 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp
@@ -12,6 +12,7 @@
#include "mlir/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Target/LLVMIR/LLVMTranslationInterface.h"
+#include "mlir/Target/LLVMIR/ModuleTranslation.h"
#include "llvm/ADT/TypeSwitch.h"
using namespace mlir;
@@ -41,7 +42,7 @@ class GPUDialectLLVMIRTranslationInterface
using LLVMTranslationDialectInterface::LLVMTranslationDialectInterface;
LogicalResult
- convertOperation(Operation *operation, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *operation, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const override {
return llvm::TypeSwitch<Operation *, LogicalResult>(operation)
.Case([&](gpu::GPUModuleOp) { return success(); })
diff --git a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
index f144c7158d6796..acf43eb4e2ce98 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
@@ -410,7 +410,7 @@ class LLVMDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
return convertOperationImpl(*op, builder, moduleTranslation);
}
diff --git a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
index 88e3a455340750..c61e93ef723d73 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
@@ -132,7 +132,7 @@ class NVVMDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final {
Operation &opInst = *op;
#include "mlir/Dialect/LLVMIR/NVVMConversions.inc"
@@ -142,7 +142,8 @@ class NVVMDialectLLVMIRTranslationInterface
/// Attaches module-level metadata for functions marked as kernels.
LogicalResult
- amendOperation(Operation *op, NamedAttribute attribute,
+ amendOperation(Operation *op, ArrayRef<llvm::Instruction *> instructions,
+ NamedAttribute attribute,
LLVM::ModuleTranslation &moduleTranslation) const final {
auto func = dyn_cast<LLVM::LLVMFuncOp>(op);
if (!func)
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
index b964d1c082b200..56fd29ccd22371 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp
@@ -261,7 +261,7 @@ processDataOperands(llvm::IRBuilderBase &builder,
/// Converts an OpenACC data operation into LLVM IR.
static LogicalResult convertDataOp(acc::DataOp &op,
- llvm::IRBuilderBase &builder,
+ LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) {
llvm::LLVMContext &ctx = builder.getContext();
auto enclosingFuncOp = op.getOperation()->getParentOfType<LLVM::LLVMFuncOp>();
@@ -484,7 +484,7 @@ class OpenACCDialectLLVMIRTranslationInterface
/// Translates the given operation to LLVM IR using the provided IR builder
/// and saving the state in `moduleTranslation`.
LogicalResult
- convertOperation(Operation *op, llvm::IRBuilderBase &builder,
+ convertOperation(Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const final;
};
@@ -493,7 +493,7 @@ class OpenACCDialectLLVMIRTranslationInterface
/// Given an OpenACC MLIR operation, create the corresponding LLVM IR
/// (including OpenACC runtime calls).
LogicalResult OpenACCDialectLLVMIRTranslationInterface::convertOperation(
- Operation *op, llvm::IRBuilderBase &builder,
+ Operation *op, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation) const {
return llvm::TypeSwitch<Operation *, LogicalResult>(op)
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index 4f6200d29a70a6..3b535f2ac21c8a 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -89,7 +89,7 @@ class OpenMPVarMappingStackFrame
/// Find the insertion point for allocas given the current insertion point for
/// normal operations in the builder.
static llvm::OpenMPIRBuilder::InsertPointTy
-findAllocaInsertPoint(llvm::IRBuilderBase &builder,
+findAllocaInsertPoint(LLVM::CapturingIRBuilder &builder,
const LLVM::ModuleTranslation &moduleTranslation) {
// If there is an alloca insertion point on stack, i.e. we are in a nested
// operation and a specific point was provided by some surrounding operation,
@@ -133,7 +133,7 @@ findAllocaInsertPoint(llvm::IRBuilderBase &builder,
/// to `continuationBlock`. Populates `continuationBlockPHIs` with the PHI nodes
/// of the continuation block if provided.
static llvm::BasicBlock *convertOmpOpRegions(
- Region ®ion, StringRef blockName, llvm::IRBuilderBase &builder,
+ Region ®ion, StringRef blockName, LLVM::CapturingIRBuilder &builder,
LLVM::ModuleTranslation &moduleTranslation, LogicalResult &bodyGenStatus,
SmallVectorImpl<llvm::PHINode *> *continuationBlockPHIs = nullptr) {
llvm::BasicBlock *continuationBlock =
@@ -261,7 +261,7 @@ static llvm::omp::ProcBindKind getProcBindKind(omp::ClauseProcBindKind kind) {
/// Converts an OpenMP 'master' operation into LLVM IR using OpenMPIRBuilder.
static LogicalResult
-convertOmpMaster(Operation &opInst, llvm::...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/75309
More information about the Mlir-commits
mailing list