Skip to content

Commit a51ce77

Browse files
authored
fix llvm backend (#112)
1 parent 8aba4e7 commit a51ce77

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mlir/extras/runtime/refbackend.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
except:
2424
warnings.warn("no execution engine in mlir bindings; refbackend won't work")
2525

26-
2726
from .. import types as T
2827
from ...dialects.memref import cast
2928
from ..runtime.passes import Pipeline, run_pipeline
@@ -113,9 +112,11 @@ def convert_arg_to_ctype(arg, unranked=True):
113112

114113
def convert_returns_from_ctype(args, mlir_types):
115114
return tuple(
116-
arg
117-
if mlir_type_to_ctype(type)
118-
else unranked_memref_to_numpy(arg, memref_type_to_np_dtype(type))
115+
(
116+
arg
117+
if mlir_type_to_ctype(type)
118+
else unranked_memref_to_numpy(arg, memref_type_to_np_dtype(type))
119+
)
119120
for arg, type in zip(args, mlir_types)
120121
)
121122

@@ -294,8 +295,10 @@ def compile(
294295
verify=verify,
295296
)
296297

298+
# python: /project/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:821:
299+
# llvm::Instruction* {anonymous}::InstructionsState::getMainOp() const: Assertion `valid() && "InstructionsState is invalid."' failed.
297300
def load(
298-
self, module, consume_return_callback=None, opt_level=2
301+
self, module, consume_return_callback=None, opt_level=0
299302
) -> LLVMJITBackendInvoker:
300303
return LLVMJITBackendInvoker(
301304
module,

0 commit comments

Comments
 (0)