diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -434,6 +434,12 @@ OpBuilder<(ins "Type":$resultType, "Value":$basePtr, "ValueRange":$indices, "ArrayRef":$structIndices, CArg<"ArrayRef", "{}">:$attributes)>, + OpBuilder<(ins "Type":$resultType, "Type":$basePtrType, "Value":$basePtr, + "ValueRange":$indices, + CArg<"ArrayRef", "{}">:$attributes)>, + OpBuilder<(ins "Type":$resultType, "Type":$basePtrType, "Value":$basePtr, + "ValueRange":$indices, + CArg<"ArrayRef", "{}">:$attributes)>, OpBuilder<(ins "Type":$resultType, "Type":$basePtrType, "Value":$basePtr, "ValueRange":$indices, "ArrayRef":$structIndices, CArg<"ArrayRef", "{}">:$attributes)> diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -567,6 +567,13 @@ return type; } +void GEPOp::build(OpBuilder &builder, OperationState &result, Type resultType, + Type elementType, Value basePtr, ValueRange indices, + ArrayRef attributes) { + build(builder, result, resultType, elementType, basePtr, indices, + SmallVector(indices.size(), kDynamicIndex), attributes); +} + void GEPOp::build(OpBuilder &builder, OperationState &result, Type resultType, Value basePtr, ValueRange indices, ArrayRef structIndices,