Skip to content

Commit 7223eb0

Browse files
authored
fix BenchGC execution issue when driver is mlir (#337)
1 parent 9658857 commit 7223eb0

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

test/benchgc/src/benchgc/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ def get_module_and_args(flags: argparse.Namespace):
275275

276276
entry = benchgc.mlir.util.get_kernel_func_from_module(module, flags.entry)
277277

278+
with module.context:
279+
entry.attributes["llvm.emit_c_interface"] = ir.UnitAttr.get()
280+
278281
for i, arg in enumerate(args):
279282
# use zero filling if the arg is return value
280283
set_default_fill(flags, arg, args, i >= len(entry.type.inputs))

test/benchgc/src/benchgc/mlir/module.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def init_module(
4141
results=[x.get_mlir_type(ctx) for x in outputs],
4242
),
4343
)
44-
f.attributes["llvm.emit_c_interface"] = ir.UnitAttr.get()
45-
4644
with ir.InsertionPoint(f.add_entry_block()):
4745
block_args = f.entry_block.arguments
4846
func.ReturnOp(op_func(ctx, *block_args))
@@ -67,8 +65,6 @@ def init_reduce_module(
6765
results=[output.get_mlir_type(ctx)],
6866
),
6967
)
70-
f.attributes["llvm.emit_c_interface"] = ir.UnitAttr.get()
71-
7268
with ir.InsertionPoint(f.add_entry_block()):
7369
block_args = f.entry_block.arguments
7470

test/benchgc/src/benchgc/pattern/mlp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ def init_module(self, ctx: ir.Context) -> ir.Module:
104104
inputs=[src] + weights + bias, results=[result]
105105
),
106106
)
107-
f.attributes["llvm.emit_c_interface"] = ir.UnitAttr.get()
108-
109107
with ir.InsertionPoint(f.add_entry_block()):
110108
data = f.entry_block.arguments[0]
111109
bias_idx = len(weights) + 1

0 commit comments

Comments
 (0)