Skip to content

Commit b588ff3

Browse files
committed
adapt to ArgumentAttributesOpInterface iface removal
1 parent 186c911 commit b588ff3

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,6 @@ def LLVM_CallOp : LLVM_MemAccessOpBase<"call",
701701
[AttrSizedOperandSegments,
702702
DeclareOpInterfaceMethods<FastmathFlagsInterface>,
703703
DeclareOpInterfaceMethods<CallOpInterface>,
704-
DeclareOpInterfaceMethods<ArgumentAttributesOpInterface>,
705704
DeclareOpInterfaceMethods<SymbolUserOpInterface>,
706705
DeclareOpInterfaceMethods<BranchWeightOpInterface>]> {
707706
let summary = "Call to an LLVM function.";

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,8 @@ void CallOp::print(OpAsmPrinter &p) {
13441344

13451345
// Reconstruct the function MLIR function type from operand and result types.
13461346
call_interface_impl::printFunctionSignature(
1347-
p, *this, args.getTypes(), /*isVariadic=*/false, getResultTypes());
1347+
p, args.getTypes(), getArgAttrsAttr(),
1348+
/*isVariadic=*/false, getResultTypes(), getResAttrsAttr());
13481349
}
13491350

13501351
/// Parses the type of a call operation and resolves the operands if the parsing

mlir/lib/Target/LLVMIR/ModuleImport.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,10 +2090,6 @@ void ModuleImport::convertParameterAttributes(llvm::Function *func,
20902090
void ModuleImport::convertParameterAttributes(llvm::CallBase *call,
20912091
CallOpInterface callOp,
20922092
OpBuilder &builder) {
2093-
auto argAttrsOpInterface =
2094-
dyn_cast<ArgumentAttributesOpInterface>(callOp.getOperation());
2095-
if (!argAttrsOpInterface)
2096-
return;
20972093
auto llvmAttrs = call->getAttributes();
20982094
SmallVector<llvm::AttributeSet> llvmArgAttrsSet;
20992095
bool anyArgAttrs = false;
@@ -2112,15 +2108,15 @@ void ModuleImport::convertParameterAttributes(llvm::CallBase *call,
21122108
SmallVector<DictionaryAttr> argAttrs;
21132109
for (auto &llvmArgAttrs : llvmArgAttrsSet)
21142110
argAttrs.emplace_back(convertParameterAttribute(llvmArgAttrs, builder));
2115-
argAttrsOpInterface.setArgAttrsAttr(getArrayAttr(argAttrs));
2111+
callOp.setArgAttrsAttr(getArrayAttr(argAttrs));
21162112
}
21172113

21182114
llvm::AttributeSet llvmResAttr = llvmAttrs.getRetAttrs();
21192115
if (!llvmResAttr.hasAttributes())
21202116
return;
21212117
SmallVector<DictionaryAttr, 1> resAttrs;
21222118
resAttrs.emplace_back(convertParameterAttribute(llvmResAttr, builder));
2123-
argAttrsOpInterface.setResAttrsAttr(getArrayAttr(resAttrs));
2119+
callOp.setResAttrsAttr(getArrayAttr(resAttrs));
21242120
}
21252121

21262122
LogicalResult ModuleImport::processFunction(llvm::Function *func) {

0 commit comments

Comments
 (0)